/*
Theme Name: Reto Ahorro VAULT
Theme URI: https://tuimpulsoweb.com
Author: Tu Impulso Web
Description: PWA de gestión del reto de ahorro personal $10.050.000 COP — Kinetic Vault Design System sincronizado con Stitch.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Private
*/

/* ================================================================
   STITCH DESIGN TOKENS — Kinetic Vault (100% fidelidad)
   Proyecto: "Pantalla de Login" · ID: 4314356300640496045
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* — Palette principal — */
  --color-primary:              #b6a0ff;
  --color-primary-brand:        #390099;
  --color-primary-container:    #a98fff;
  --color-primary-dim:          #a78cff;
  --color-on-primary:           #350090;
  --color-on-primary-container: #280071;

  /* — Secondario / Oro — */
  --color-secondary:            #fdd404;
  --color-secondary-brand:      #FFD60A;
  --color-secondary-container:  #705d00;
  --color-on-secondary:         #594a00;

  /* — Superficies (regla "No-Line") — */
  --color-surface:              #0e0e0e;
  --color-surface-dim:          #0e0e0e;
  --color-surface-bright:       #2c2c2c;
  --color-surface-container-lowest: #000000;
  --color-surface-container-low: #131313;
  --color-surface-container:    #1a1a1a;
  --color-surface-container-high: #20201f;
  --color-surface-container-highest: #262626;
  --color-surface-variant:      #262626;
  --color-surface-tint:         #b6a0ff;

  /* — Texto — */
  --color-on-surface:           #ffffff;
  --color-on-surface-variant:   #adaaaa;
  --color-on-background:        #ffffff;

  /* — Bordes / Outline — */
  --color-outline:              #767575;
  --color-outline-variant:      #484847;

  /* — Error / Alerta — */
  --color-error:                #ff6e84;
  --color-error-container:      #a70138;
  --color-on-error:             #490013;

  /* — Terciario / Rosa — */
  --color-tertiary:             #ff96ba;
  --color-tertiary-container:   #fb81ad;

  /* — Fondo — */
  --color-background:           #0e0e0e;
  --color-neutral:              #121212;

  /* — Tipografía: Inter (escala editorial) — */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display-lg:  3.5rem;    /* balance principal */
  --font-headline-md: 1.75rem;   /* section headers */
  --font-title-md:    1.125rem;  /* card titles */
  --font-body-lg:     1rem;      /* descripción */
  --font-label-sm:    0.6875rem; /* micro-copy */

  /* — Border Radius (ROUND_FULL) — */
  --radius-xs:   0.25rem;
  --radius-sm:   0.5rem;
  --radius-md:   1rem;
  --radius-lg:   1.5rem;
  --radius-xl:   2rem;
  --radius-full: 999px;

  /* — Espaciado — */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* — Sombra (Tinted Shadow — primary 8%) — */
  --shadow-primary: 0 20px 40px rgba(182, 160, 255, 0.08);
  --shadow-gold:    0 8px 24px rgba(253, 212, 4, 0.15);

  /* — Glassmorphism — */
  --glass-bg:     rgba(14, 14, 14, 0.80);
  --glass-blur:   32px;
  --glass-modal:  rgba(44, 44, 44, 0.95);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-on-surface);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }

/* ================================================================
   LAYOUT — Mobile-first 390px
   ================================================================ */
.vault-app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  position: relative;
}

.vault-content {
  flex: 1;
  padding: 0 0 5rem 0; /* espacio para bottom nav */
  overflow-y: auto;
}

/* ================================================================
   SUPERFICIES — Tonal Architecture (regla "No-Line")
   ================================================================ */
.surface           { background: var(--color-surface); }
.surface-container { background: var(--color-surface-container); }
.surface-low       { background: var(--color-surface-container-low); }
.surface-high      { background: var(--color-surface-container-high); }
.surface-highest   { background: var(--color-surface-container-highest); }
.surface-bright    { background: var(--color-surface-bright); }

/* ================================================================
   TARJETAS — Depth layers
   ================================================================ */
.card {
  background: var(--color-surface-container);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:active { transform: scale(0.98); }

.card-hero {
  background: linear-gradient(135deg, var(--color-primary-brand) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-primary);
}

.card-gold {
  background: linear-gradient(135deg, var(--color-secondary-container) 0%, #3d3300 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
}

.card-dark {
  background: var(--color-surface-container-lowest);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-primary);
}

/* ================================================================
   BOTONES — Thumb-friendly (mínimo 56px)
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  min-width: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-body-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); opacity: 0.85; }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-brand) 0%, var(--color-primary) 100%);
  color: var(--color-on-surface);
  width: 100%;
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  width: 100%;
  box-shadow: var(--shadow-gold);
}

.btn-tertiary {
  background: transparent;
  color: var(--color-primary);
  width: 100%;
}

.btn-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-surface-container-high);
  font-size: 1.5rem;
}

/* ================================================================
   TIPOGRAFÍA
   ================================================================ */
.text-display   { font-size: var(--font-display-lg); font-weight: 700; line-height: 1.1; }
.text-headline  { font-size: var(--font-headline-md); font-weight: 500; }
.text-title     { font-size: var(--font-title-md); font-weight: 600; }
.text-body      { font-size: var(--font-body-lg); font-weight: 400; color: var(--color-on-surface-variant); }
.text-label     { font-size: var(--font-label-sm); font-weight: 500; color: var(--color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.08em; }

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-error     { color: var(--color-error); }
.text-white     { color: #ffffff; }
.text-muted     { color: var(--color-on-surface-variant); }

/* ================================================================
   CHIPS / KPI BADGES
   ================================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-label-sm);
  font-weight: 600;
  background: var(--color-surface-container-high);
  color: var(--color-on-surface-variant);
}

.chip-primary { background: rgba(182,160,255,0.15); color: var(--color-primary); }
.chip-gold    { background: rgba(253,212,4,0.15);   color: var(--color-secondary); }
.chip-error   { background: rgba(255,110,132,0.15); color: var(--color-error); }
.chip-success { background: rgba(100,220,100,0.15); color: #6ddc6d; }

/* ================================================================
   INPUTS — Ghost border + focus glow
   ================================================================ */
.input-wrapper {
  background: var(--color-surface-container-highest);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-4);
  position: relative;
  outline: 2px solid rgba(72, 72, 71, 0.2); /* ghost border */
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  outline-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(182, 160, 255, 0.12);
}

.vault-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-on-surface);
  font-size: var(--font-body-lg);
  padding: var(--space-4) 0;
  font-weight: 400;
}

.vault-input::placeholder { color: var(--color-on-surface-variant); }
.vault-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface-container-highest) inset;
  -webkit-text-fill-color: var(--color-on-surface);
}

.input-label {
  font-size: var(--font-label-sm);
  font-weight: 500;
  color: var(--color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: var(--space-2);
  display: block;
}

/* ================================================================
   NAVEGACIÓN INFERIOR — Glassmorphism
   ================================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  /* No borders — tonal architecture */
  border-top: 1px solid rgba(255,255,255,0.04);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  color: var(--color-on-surface-variant);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
  cursor: pointer;
}

.nav-item.active { color: var(--color-primary); }

.nav-item .nav-icon {
  font-size: 1.375rem;
  line-height: 1;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--color-surface-container-high);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-brand), var(--color-primary));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(182,160,255,0.5);
}

/* ================================================================
   MODAL — Glassmorphism (backdrop blur 20px)
   ================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.open { opacity: 1; visibility: visible; }

.modal-sheet {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--color-surface-bright);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
}

.modal-backdrop.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--color-outline-variant);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-6);
}

/* ================================================================
   CALENDARIO — Grid días
   ================================================================ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: var(--space-4);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  min-height: 40px;
  color: var(--color-on-surface-variant);
  background: var(--color-surface-container-high);
}

.calendar-day:active { transform: scale(0.9); }

.calendar-day.today {
  background: var(--color-primary-brand);
  color: white;
  box-shadow: 0 0 12px rgba(57,0,153,0.5);
}

.calendar-day.saved {
  background: rgba(100, 220, 100, 0.2);
  color: #6ddc6d;
}

.calendar-day.quincenal {
  background: rgba(253, 212, 4, 0.2);
  color: var(--color-secondary);
}

.calendar-day.future { opacity: 0.35; }
.calendar-day.empty  { background: transparent; }

/* ================================================================
   STREAK — Widget 🔥
   ================================================================ */
.streak-widget {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface-container-high);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.streak-fire { font-size: 2rem; line-height: 1; }

.streak-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.streak--epic    { color: var(--color-secondary); }
.streak--active  { color: var(--color-primary); }
.streak--zero    { color: var(--color-error); }

/* ================================================================
   CHART CONTAINERS
   ================================================================ */
.chart-container {
  position: relative;
  width: 100%;
  background: var(--color-surface-container);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-primary);
}

.chart-doughnut-wrap {
  max-width: 220px;
  margin: 0 auto;
  position: relative;
}

.chart-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

/* ================================================================
   LOGIN — Pantalla de Login (VAULT)
   ================================================================ */
.login-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-primary-brand) 0%, var(--color-surface) 60%);
  padding: var(--space-8) var(--space-6);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 30%, rgba(57,0,153,0.6) 0%, transparent 70%);
  pointer-events: none;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-10);
  position: relative;
  z-index: 1;
}

.login-logo-text {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--color-surface-container);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-primary);
  position: relative;
  z-index: 1;
}

/* Override WP login form */
.login-card form input[type="text"],
.login-card form input[type="password"] {
  width: 100%;
  background: var(--color-surface-container-highest);
  border: 2px solid rgba(72,72,71,0.2);
  border-radius: var(--radius-md);
  color: var(--color-on-surface);
  padding: var(--space-4);
  font-size: var(--font-body-lg);
  font-family: var(--font-family);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-top: 4px;
}

.login-card form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(182,160,255,0.12);
}

.login-card form label {
  font-size: var(--font-label-sm);
  font-weight: 600;
  color: var(--color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  display: block;
}

.login-card form p {
  margin-bottom: 1.25rem;
}

.login-card form .wp-pwd { position: relative; }

.login-card #wp-submit {
  background: linear-gradient(135deg, var(--color-primary-brand), var(--color-primary));
  color: white;
  height: 56px;
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-body-lg);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: var(--shadow-primary);
}

.login-card #wp-submit:active { transform: scale(0.97); }
.login-card form .login-remember { margin-bottom: 1.5rem; display: flex; align-items: center; }
.login-card form .login-remember input { width: auto; margin-right: 8px; margin-top: 0; }
.login-card #rememberme + label { color: var(--color-on-surface-variant); font-size: 0.875rem; text-transform:none; letter-spacing:0; display:inline; margin:0;}
.login-card #nav, .login-card #backtoblog { display: none; }

/* ================================================================
   UTILIDADES
   ================================================================ */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.w-full { width: 100%; }
.p-4    { padding: var(--space-4); }
.p-6    { padding: var(--space-6); }
.px-6   { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4   { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.mt-4   { margin-top: var(--space-4); }
.mt-6   { margin-top: var(--space-6); }
.mb-4   { margin-bottom: var(--space-4); }
.mb-6   { margin-bottom: var(--space-6); }
.text-center { text-align: center; }
.rounded-full { border-radius: var(--radius-full); }
.opacity-60 { opacity: 0.6; }

/* ================================================================
   ANIMACIONES MICRO
   ================================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-flame {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

@keyframes counter-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

.fire-animate { animation: pulse-flame 2s ease-in-out infinite; }

/* ================================================================
   NOTIFICACIÓN TOAST
   ================================================================ */
.toast {
  position: fixed;
  top: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--color-surface-bright);
  color: var(--color-on-surface);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-body-lg);
  font-weight: 500;
  z-index: 300;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-primary);
  max-width: 90%;
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 4px solid #6ddc6d; }
.toast.error   { border-left: 4px solid var(--color-error); }

/* ================================================================
   OFFLINE BANNER
   ================================================================ */
.offline-banner {
  background: var(--color-error-container);
  color: var(--color-on-surface);
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-label-sm);
  font-weight: 600;
  display: none;
}

.offline-banner.visible { display: block; }

/* ================================================================
   RESPONSIVE — pantallas > 430px
   ================================================================ */
@media (min-width: 430px) {
  .vault-app { box-shadow: 0 0 80px rgba(0,0,0,0.8); }
}
