/* ==========================================================================
   FLOW — APPLE CINEMATIC SYSTEM (styles.css)
   ========================================================================== */

:root {
  --bg-ivory: #faf8f5;
  --surface-card: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --border-gold: rgba(197, 160, 89, 0.28);
  --border-gold-strong: rgba(197, 160, 89, 0.65);

  --gold-primary: #b38b40;
  --gold-light: #dfba73;
  --gold-gradient: linear-gradient(135deg, #dfba73 0%, #b38b40 50%, #8c6a27 100%);
  --gold-glow: rgba(197, 160, 89, 0.22);

  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-tertiary: #78716c;

  --danger-burgundy: #9f1239;

  --shadow-prestige: 0 20px 45px -12px rgba(138, 110, 52, 0.12), 0 0 1px 1px rgba(197, 160, 89, 0.2);
  --shadow-hover: 0 30px 60px -15px rgba(138, 110, 52, 0.22), 0 0 0 1.5px var(--gold-primary);
  --spring-easing: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

body.light-theme {
  background-color: var(--bg-ivory);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Iluminación Ambiental de Fondo */
.light-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, #fde68a 0%, #fef3c7 50%, transparent 100%);
}

.orb-2 {
  width: 550px;
  height: 550px;
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #fed7aa 0%, #ffedd5 50%, transparent 100%);
}

/* Header Flotante Apple Glass */
.glass-nav {
  position: sticky;
  top: 1.25rem;
  margin: 0 auto;
  width: min(92%, 1150px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  padding: 0.75rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-badge-3d {
  width: 38px;
  height: 38px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 0.14em;
  display: block;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--gold-primary);
}

.gold-cta-nav {
  background: var(--gold-gradient);
  border: none;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s var(--spring-easing);
}

.gold-cta-nav:hover {
  transform: scale(1.03);
}

.dashboard-nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-pill-session {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdfaf3;
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.dot-online {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  color: var(--danger-burgundy);
  border-color: var(--danger-burgundy);
}

/* ================= HERO CINEMÁTICO APPLE ================= */
.hero-stage {
  position: relative;
  z-index: 1;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-primary);
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  max-width: 900px;
  margin-bottom: 1.25rem;
}

.gold-text-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-manifesto {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn-gold-large {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 30px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--gold-glow);
  transition: transform 0.2s var(--spring-easing), box-shadow 0.2s;
}

.btn-gold-large:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px var(--gold-glow);
}

.btn-secondary-large {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-large:hover {
  background: #fdfaf3;
  border-color: var(--gold-primary);
}

/* ================= SECCIONES INSTITUCIONALES ================= */
.section-container {
  position: relative;
  z-index: 1;
  width: min(92%, 1100px);
  margin: 5rem auto;
}

.section-header-center {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
  display: block;
  margin-bottom: 0.5rem;
}

.section-header-center h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-header-center p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bento-grid-brand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-3d {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold);
  border-radius: 28px;
  box-shadow: var(--shadow-prestige);
  transition: transform 0.25s var(--spring-easing), box-shadow 0.25s, border-color 0.25s;
}

.card-3d:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.brand-card {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-icon-box {
  width: 48px;
  height: 48px;
  background: #fdfaf3;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  box-shadow: 0 4px 12px var(--gold-glow);
}

.brand-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Franja de Ecosistema */
.showcase-strip {
  padding: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(145deg, #ffffff 0%, #fdfbf7 100%);
}

.strip-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0.5rem 0 1rem;
}

.strip-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.6;
}

.strip-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  padding-top: 2rem;
}

.metric-box b {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold-primary);
  display: block;
}

.metric-box span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-tertiary);
}

/* Membresía Bóveda */
.vault-metal-card {
  width: 100%;
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 32px;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  color: #ffffff;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-chip {
  width: 46px;
  height: 34px;
  background: linear-gradient(135deg, #e9d5a1, #b38b40);
  border-radius: 6px;
}

.card-brand-mark {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--gold-light);
}

.card-body-text h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.35;
  color: #f5f4ef;
}

.card-body-text p {
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

.card-bottom-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding-top: 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}

/* ================= DASHBOARD DE BIENVENIDA ================= */
.app-layout {
  position: relative;
  z-index: 1;
  width: min(92%, 950px);
  margin: 3rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.welcome-vault-card {
  padding: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.vault-avatar-big {
  width: 64px;
  height: 64px;
  background: var(--gold-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 8px 24px var(--gold-glow);
}

.welcome-text-wrap {
  flex: 1;
}

.vault-tag-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
  background: #fdfaf3;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border-gold);
}

.welcome-text-wrap h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  margin: 4px 0;
}

.welcome-text-wrap p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.welcome-status-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
}

.dashboard-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.dash-guide-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-guide-card svg {
  color: var(--gold-primary);
  width: 28px;
  height: 28px;
}

.dash-guide-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
}

.dash-guide-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ================= MODAL APPLE SHEET ================= */
.sim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
}

.sim-overlay.open {
  display: flex;
}

.apple-auth-sheet {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  padding: 2.25rem;
  border-radius: 32px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.25);
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.mini-badge {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.modal-top h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.close-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

.auth-toggle-pill {
  display: flex;
  background: #f5f4ef;
  border-radius: 100px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.toggle-sub-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-sub-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-google-auth {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}

.btn-google-auth:hover {
  background: #faf8f5;
  border-color: var(--gold-primary);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-gold);
}

.auth-divider span {
  padding: 0 10px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.auth-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.auth-field input {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-gold);
  background: #faf8f5;
  font-size: 0.9rem;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--gold-primary);
}

.auth-error-text {
  font-size: 0.78rem;
  color: var(--danger-burgundy);
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

@media (max-width: 768px) {
  .landing-nav-links { display: none; }
  .strip-metrics { flex-direction: column; gap: 1.5rem; }
}

/* Escenario 3D Cinemático */
.stage-3d-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  height: 440px;
  margin: 1.5rem auto 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

#webgl-canvas-container {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

#webgl-canvas-container:active {
  cursor: grabbing;
}

.stage-overlay-caption {
  position: absolute;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 4px 14px rgba(179, 139, 64, 0.08);
}