/* Color Palette and Variables */
:root {
  --corporate-blue: #0b1a30;
  --corporate-blue-light: #162c4c;
  --eco-green: #2ecc71;
  --eco-green-light: #48e28b;
  --accent-yellow: #f1c40f;
  --accent-yellow-hover: #f39c12;
  --text-light: #ffffff;
  --text-dark: #333333;
  --text-muted: #888888;
  --bg-white: #ffffff;
  --bg-light: #f5f7fa;
  --font-main: 'Outfit', 'Inter', sans-serif;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Utilities */
.btn-primary {
  background-color: var(--accent-yellow);
  color: var(--corporate-blue);
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--accent-yellow-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(241, 196, 15, 0.4);
}

.btn-secondary {
  background-color: var(--eco-green);
  color: var(--text-light);
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--eco-green-light);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
  transform: translateY(-2px);
}

/* --- LANDING PAGE --- */
.landing-container {
  display: flex;
  min-height: 100vh;
}

.landing-left {
  flex: 1;
  background: linear-gradient(135deg, var(--corporate-blue) 0%, var(--corporate-blue-light) 100%);
  color: var(--text-light);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Decorate the background of left side */
.landing-left::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(46,204,113,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.landing-left h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.landing-left h1 span {
  color: var(--eco-green);
}

.landing-left p.subtitle {
  font-size: 1.2rem;
  color: #c9d6ea;
  margin-bottom: 3rem;
  max-width: 500px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feature-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--eco-green);
  font-size: 1.5rem;
  backdrop-filter: blur(5px);
}

.feature-text h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.feature-text p {
  font-size: 0.9rem;
  color: #a0b2c6;
}

.landing-right {
  flex: 1;
  background-color: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-box {
  width: 100%;
  max-width: 450px;
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.auth-box:hover {
  box-shadow: var(--box-shadow-hover);
}

.auth-box h2 {
  font-size: 2rem;
  color: var(--corporate-blue);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.auth-box p.welcome-msg {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--corporate-blue);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e8f0;
  border-radius: var(--border-radius);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: var(--transition);
  background-color: #f8fafc;
}

.form-control:focus {
  outline: none;
  border-color: var(--eco-green);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--eco-green);
  text-decoration: none;
  font-weight: 600;
}

/* --- DASHBOARD --- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-white);
  border-right: 1px solid #e1e8f0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
}

.logo-area img {
  width: 40px;
  height: 40px;
}

.logo-area h2 {
  font-size: 1.2rem;
  color: var(--corporate-blue);
  font-weight: 800;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
}

.nav-item a:hover, .nav-item a.active {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--eco-green);
}

.nav-item a i {
  font-size: 1.2rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem 3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--bg-white);
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 45px;
  height: 45px;
  background-color: var(--eco-green);
  color: var(--text-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.user-info h4 {
  color: var(--corporate-blue);
  font-size: 0.95rem;
}

.user-info p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Bloque Financiero */
.finance-block {
  background: linear-gradient(135deg, var(--corporate-blue) 0%, var(--corporate-blue-light) 100%);
  border-radius: 20px;
  padding: 2rem;
  color: var(--text-light);
  box-shadow: 0 15px 35px rgba(11, 26, 48, 0.2);
  grid-column: 1 / -1; /* spans full width */
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.finance-block::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path fill="%232ecc71" d="M47.7,-65.4C59.9,-54.6,66.6,-37.2,71.5,-20.1C76.4,-3,79.5,13.8,74.5,28.6C69.5,43.4,56.5,56.2,41.2,64.2C25.9,72.2,8.4,75.4,-7.8,72.7C-23.9,70,-38.6,61.4,-51.7,49.8C-64.8,38.2,-76.3,23.6,-78.9,7.6C-81.5,-8.4,-75.2,-25.8,-63.9,-38.7C-52.6,-51.6,-36.3,-60.1,-20.5,-64.8C-4.7,-69.5,10.6,-70.4,25.8,-70.5C41,-70.6,35.5,-76.2,47.7,-65.4Z" transform="translate(100 100) scale(1.1)" opacity="0.1"/></svg>') no-repeat right center;
  background-size: cover;
  pointer-events: none;
}

.finance-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finance-stat .label {
  font-size: 0.9rem;
  color: #a0b2c6;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.finance-stat .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-yellow);
}

.finance-stat .sub-value {
  font-size: 0.9rem;
  color: var(--eco-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Bloque Operativo */
.card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--box-shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e1e8f0;
  padding-bottom: 1rem;
}

.card-title {
  font-size: 1.2rem;
  color: var(--corporate-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--eco-green);
}

.progress-container {
  margin-top: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background-color: #e1e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--eco-green);
  border-radius: 6px;
  width: 50%; /* Example dynamic width */
  transition: width 1s ease-in-out;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.phase-indicators {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.phase.active {
  color: var(--eco-green);
  font-weight: 700;
}

.tech-sheet-btn {
  margin-top: 2rem;
  width: 100%;
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--eco-green);
  border: 1px solid var(--eco-green);
}
.tech-sheet-btn:hover {
  background-color: var(--eco-green);
  color: white;
}

/* Zona Comunidad */
.community-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background-color: #f8fafc;
  transition: var(--transition);
  cursor: pointer;
}

.benefit-item:hover {
  background-color: #f1f5f9;
  transform: translateX(5px);
}

.benefit-icon {
  width: 40px;
  height: 40px;
  background-color: var(--corporate-blue);
  color: var(--accent-yellow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.benefit-text h4 {
  font-size: 0.95rem;
  color: var(--corporate-blue);
}
.benefit-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qr-code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.qr-code-wrapper i.fa-qrcode {
  font-size: 4rem;
  color: var(--corporate-blue);
  margin-bottom: 0.5rem;
}

.qr-code-wrapper p {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Responsive */
@media (max-width: 992px) {
  .landing-container {
    flex-direction: column;
  }
  .landing-left {
    padding: 3rem 2rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .finance-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .sidebar {
    width: 80px;
    padding: 1rem;
  }
  .sidebar .logo-area h2, .sidebar .nav-item span {
    display: none;
  }
  .main-content {
    margin-left: 80px;
  }
}
