/* =========================================================
   NutriFit — styles.css
   Paleta cálida editorial, fuentes con personalidad,
   responsive para móvil/tablet/desktop.
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  /* Paleta principal */
  --sage: #6B7F5E;
  --sage-deep: #4F6049;
  --sage-soft: #A8B89C;
  --sage-bg: #E8EBE2;

  --terra: #C4704B;
  --terra-deep: #9B5232;
  --terra-soft: #E8B69A;

  --mustard: #D4A843;
  --mustard-soft: #F1D996;

  --cream: #FAF8F5;
  --cream-deep: #F2EDE4;
  --paper: #FFFEFB;

  --ink: #2D2D2D;
  --ink-soft: #5C5C5C;
  --ink-mute: #8A8A85;

  --line: #E5E0D5;
  --line-soft: #EEEAE0;

  --good: #6B9F5E;
  --warn: #D4A843;
  --bad:  #C4704B;

  /* Tipografía */
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Outfit", system-ui, sans-serif;

  /* Radios — variados a propósito */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* Sombras suaves, no genéricas */
  --shadow-1: 0 1px 2px rgba(45, 45, 45, 0.04), 0 4px 12px rgba(45, 45, 45, 0.05);
  --shadow-2: 0 2px 6px rgba(45, 45, 45, 0.06), 0 12px 28px rgba(45, 45, 45, 0.07);
  --shadow-warm: 0 6px 20px rgba(196, 112, 75, 0.18);

  /* Anims */
  --t: 220ms cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset suave ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 2.8rem); line-height: 1.1; }
h2 { font-size: 1.6rem; line-height: 1.2; }
h3 { font-size: 1.2rem; }
em { font-style: italic; color: var(--terra); }

/* Grain overlay sutil */
.grain-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.18 0 0 0 0 0.15 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Containers ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.container.narrow { max-width: 820px; }

/* =========================================================
   LOGIN
   ========================================================= */
.login-body {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(125deg,
      var(--cream) 0%,
      #EFE8DA 25%,
      #DDE3D0 50%,
      #EFE8DA 75%,
      var(--cream) 100%);
  background-size: 400% 400%;
  animation: aurora-bg 18s ease infinite;
}
@keyframes aurora-bg {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Blobs flotantes que dan el efecto aurora */
.login-body::before,
.login-body::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.login-body::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(107, 127, 94, 0.32), transparent 70%);
  top: -10%; left: -8%;
  animation: blob-float-a 32s ease-in-out infinite;
}
.login-body::after {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(196, 112, 75, 0.22), transparent 70%);
  bottom: -12%; right: -10%;
  animation: blob-float-b 38s ease-in-out infinite;
}
@keyframes blob-float-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33%      { transform: translate(80px, 60px) rotate(120deg) scale(1.12); }
  66%      { transform: translate(-40px, 100px) rotate(240deg) scale(0.92); }
}
@keyframes blob-float-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  40%      { transform: translate(-90px, -50px) rotate(-110deg) scale(1.18); }
  75%      { transform: translate(40px, -80px) rotate(-220deg) scale(0.88); }
}

.login-shell {
  width: 100%;
  max-width: 1100px;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 640px;
  position: relative;
  z-index: 2;
}

.login-illustration {
  position: relative;
  padding: 56px 48px;
  background:
    linear-gradient(160deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}
/* Blobs internos del panel izquierdo — efecto aurora más sutil */
.login-illustration::before,
.login-illustration::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}
.login-illustration::before {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.45), transparent 70%);
  top: -100px; right: -80px;
  animation: blob-shift-a 28s ease-in-out infinite;
}
.login-illustration::after {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(196, 112, 75, 0.40), transparent 70%);
  bottom: -120px; left: -60px;
  animation: blob-shift-b 34s ease-in-out infinite;
}
@keyframes blob-shift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, 80px) scale(1.15); }
}
@keyframes blob-shift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(80px, -60px) scale(1.18); }
}
/* Eleva el contenido sobre los blobs */
.illu-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--cream);
}
.brand-name { letter-spacing: -0.01em; }

.illu-headline {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.4vw, 3rem);
  line-height: 1.05;
  margin: 40px 0 18px;
  font-weight: 400;
}
.illu-headline em { color: var(--mustard-soft); font-style: italic; }
.illu-sub {
  max-width: 360px;
  color: rgba(250, 248, 245, 0.86);
  font-size: 1.02rem;
  margin-bottom: 16px;
}

.illu-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.shape { position: absolute; opacity: 0.18; }
.shape-circle {
  width: 220px; height: 220px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  top: -60px; right: -80px;
}
.shape-leaf {
  width: 140px; height: 200px;
  background: var(--mustard);
  border-radius: 100% 20% 80% 20%;
  transform: rotate(25deg);
  bottom: 80px; right: -50px;
  opacity: 0.22;
}
.shape-blob {
  width: 180px; height: 180px;
  background: var(--terra);
  border-radius: 64% 36% 50% 50% / 40% 60% 40% 60%;
  bottom: -60px; left: -40px;
  opacity: 0.25;
}

.illu-quote {
  position: relative;
  z-index: 1;
  border-left: 3px solid var(--mustard-soft);
  padding-left: 16px;
  max-width: 360px;
}
.illu-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0;
  color: rgba(250, 248, 245, 0.94);
}
.quote-mark {
  font-family: var(--serif);
  font-size: 3.5rem;
  line-height: 0.5;
  color: var(--mustard-soft);
  display: inline-block;
  margin-bottom: 6px;
}

.login-panel {
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card { width: 100%; max-width: 420px; margin: 0 auto; }
.login-header h2 {
  font-size: 1.85rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.login-header p { color: var(--ink-soft); margin: 0 0 32px; }

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream-deep);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: background var(--t), color var(--t);
}
.auth-tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.field input, .field select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: var(--r-sm);
  font-size: 1rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(107, 127, 94, 0.12);
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.show-password {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  padding: 6px;
  display: grid; place-items: center;
}
.show-password:hover { color: var(--sage); }

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 0.9rem;
}
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-soft); }
.check input { accent-color: var(--sage); }
.link-muted { color: var(--terra); font-weight: 500; }
.link-muted:hover { color: var(--terra-deep); }

.btn-primary {
  width: 100%;
  padding: 14px 22px;
  background: var(--sage);
  color: var(--paper);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-1);
  transition: transform var(--t), background var(--t), box-shadow var(--t);
}
.btn-primary:hover { background: var(--sage-deep); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  padding: 11px 22px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-weight: 500;
  transition: border-color var(--t), background var(--t);
}
.btn-secondary:hover { border-color: var(--sage); background: var(--cream); }

.login-error {
  color: var(--terra-deep);
  font-size: 0.92rem;
  min-height: 1.2em;
  margin: 12px 0 0;
}

.demo-credentials {
  margin-top: 28px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.10), rgba(196, 112, 75, 0.06));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.dc-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  color: var(--terra-deep);
  font-weight: 600;
}
.demo-credentials ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.demo-credentials li { font-size: 0.88rem; display: flex; flex-direction: column; }
.demo-credentials strong { color: var(--ink); font-weight: 600; }
.demo-credentials span { color: var(--ink-soft); font-size: 0.82rem; }

.login-foot {
  margin-top: 28px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-align: center;
}

/* =========================================================
   APP — Header
   ========================================================= */
.app-body { background: var(--cream); padding-bottom: 80px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--sage-deep);
}
.brand:hover { color: var(--sage); }
.brand-logo {
  max-height: 36px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}
.brand-logo-white { max-height: 48px; }
/* Fallback SVG: oculto por defecto. Sólo se revela si el <img> falla. */
.brand-svg-fallback { display: none; }
.brand-logo.failed { display: none; }
.brand-logo.failed ~ .brand-svg-fallback { display: inline-block; }

.main-nav {
  display: flex;
  gap: 4px;
  background: var(--cream-deep);
  padding: 4px;
  border-radius: var(--r-pill);
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background var(--t), color var(--t);
}
.nav-link:hover { color: var(--ink); }
.nav-link.active {
  background: var(--paper);
  color: var(--sage-deep);
  box-shadow: var(--shadow-1);
}

.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--cream-deep); color: var(--ink); }
.badge-dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  background: var(--terra);
  border-radius: 50%;
  border: 2px solid var(--paper);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
}
/* Avatar: img encima de iniciales con gradiente. Si la img falla
   o no carga, se elimina con onerror y queda visible el fallback. */
.avatar {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  color: var(--cream);
  background: linear-gradient(135deg, var(--sage), var(--sage-deep));
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1rem;
  flex-shrink: 0;
}
.avatar .avatar-initials {
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity .25s ease;
}
.avatar img.loaded { opacity: 1; }

.avatar-sm { width: 36px; height: 36px; font-size: 0.95rem; }
.avatar-md { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.8rem; }
.avatar-xl {
  width: 112px; height: 112px;
  font-size: 2.3rem;
  border: 4px solid var(--paper);
  box-shadow: var(--shadow-2);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta strong { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.user-meta small { font-size: 0.72rem; color: var(--ink-mute); }
.logout-btn {
  padding: 8px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: background var(--t), color var(--t);
}
.logout-btn:hover { background: var(--cream-deep); color: var(--terra); }

/* =========================================================
   APP — Vistas
   ========================================================= */
.app-main { padding: 36px 0 60px; position: relative; z-index: 2; }
.view { display: none; animation: fade-up .35s ease both; }
.view.active { display: block; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.view-head { margin-bottom: 28px; max-width: 760px; }
.view-title { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: 8px; }
.view-sub { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px; gap: 16px;
}
.section-head.spaced { margin-top: 44px; }
.section-title { font-size: 1.55rem; }
.section-sub { color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- Dashboard: hello-row ---------- */
.hello-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
  padding: 36px 36px;
  background: linear-gradient(105deg, var(--paper) 0%, var(--cream-deep) 100%);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.hello-greet { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.hello-name {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.4vw, 2.9rem);
  margin: 4px 0 6px;
  color: var(--sage-deep);
  font-weight: 500;
}
.hello-sub { margin: 0; color: var(--ink-soft); }
.hello-illustration { flex-shrink: 0; }

/* ---------- Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 44px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  transition: transform var(--t), box-shadow var(--t);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.stat-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--cream-deep);
  border-radius: var(--r-sm);
}
.stat-card div { display: flex; flex-direction: column; }
.stat-card strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.stat-card small { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.stat-streak .stat-icon { background: #FCE7C7; }
.stat-content .stat-icon { background: var(--sage-bg); }
.stat-goal .stat-icon { background: #F0DCC8; }
.stat-points .stat-icon { background: #F4E8D5; }

/* ---------- Tools grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 12px;
}
.tool-card {
  display: block;
  padding: 28px 26px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative;
  overflow: hidden;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: transparent; }
.tool-emoji {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 18px 24px 16px 22px;
  margin-bottom: 16px;
}
.tool-card h3 { font-family: var(--serif); margin-bottom: 6px; }
.tool-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 14px; }
.tool-cta { color: var(--terra-deep); font-weight: 500; font-size: 0.92rem; }

.tool-nutri { background: linear-gradient(160deg, #F4F7EE 0%, var(--paper) 60%); }
.tool-nutri .tool-emoji { background: var(--sage-bg); }
.tool-nutri:hover { border-color: var(--sage-soft); }

.tool-health { background: linear-gradient(160deg, #F8ECE2 0%, var(--paper) 60%); }
.tool-health .tool-emoji { background: #F1DCC8; }
.tool-health:hover { border-color: var(--terra-soft); }

.tool-workout { background: linear-gradient(160deg, #FAF1DC 0%, var(--paper) 60%); }
.tool-workout .tool-emoji { background: var(--mustard-soft); }
.tool-workout:hover { border-color: var(--mustard); }

/* ---------- Hero slider ---------- */
.slider {
  position: relative;
  width: 100%;
  height: 350px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  background: var(--cream-deep);
}
.slider-track { position: relative; width: 100%; height: 100%; }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity .8s ease, transform .8s ease, visibility 0s linear .8s;
  cursor: pointer;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity .8s ease, transform .8s ease, visibility 0s linear 0s;
}
.slide-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ph-a, var(--sage)), var(--ph-b, var(--sage-deep)));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.slide-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}
.slide-bg img.loaded { opacity: 1; }
.slide-fallback {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 0 40px;
  letter-spacing: -0.01em;
  max-width: 80%;
  line-height: 1.15;
}
.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 75%, rgba(0,0,0,0.75) 100%);
}
.slide-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 40px 32px;
  color: var(--paper);
}
.slide-badge {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}
.slide-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0 0 8px;
  line-height: 1.15;
  max-width: 720px;
  font-weight: 500;
  color: var(--paper);
}
.slide-desc {
  font-size: 0.98rem;
  margin: 0 0 16px;
  max-width: 660px;
  opacity: 0.92;
}
.slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px 11px 24px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.94rem;
  box-shadow: var(--shadow-1);
  transition: transform var(--t), background var(--t);
}
.slide-cta:hover { transform: translateX(2px); background: var(--cream); }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-1);
  z-index: 5;
  transition: background var(--t), transform var(--t);
}
.slider-arrow:hover { background: var(--paper); }
.slider-prev { left: 18px; }
.slider-next { right: 18px; }
.slider-prev:hover { transform: translateY(-50%) translateX(-2px); }
.slider-next:hover { transform: translateY(-50%) translateX(2px); }

.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.slider-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background var(--t), width var(--t);
}
.slider-dot:hover { background: rgba(255, 255, 255, 0.7); }
.slider-dot.active {
  background: var(--paper);
  width: 24px;
  border-radius: 999px;
}

/* ---------- Continue ---------- */
.continue-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.continue-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  transition: box-shadow var(--t);
}
.continue-card:hover { box-shadow: var(--shadow-1); }
.continue-thumb { border-radius: var(--r-sm); overflow: hidden; }
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.continue-cat { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--terra-deep); margin: 0 0 4px; font-weight: 600; }
.continue-card h4 { font-family: var(--serif); font-size: 1.02rem; margin: 0 0 10px; line-height: 1.25; }
.progress-bar { height: 6px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--terra)); border-radius: inherit; }
.progress-meta { font-size: 0.78rem; color: var(--ink-mute); margin: 6px 0 0; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.chip {
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--t);
}
.chip:hover { border-color: var(--sage-soft); color: var(--ink); }
.chip.active { background: var(--sage); border-color: var(--sage); color: var(--cream); }

/* ---------- Content cards ---------- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.content-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.cc-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--cream-deep);
  overflow: hidden;
}
.cc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.content-card:hover .cc-thumb img { transform: scale(1.04); }
.cc-type {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  background: rgba(45, 45, 45, 0.78);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
}
.cc-play {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--paper);
  border-radius: 50%;
  color: var(--sage-deep);
  box-shadow: var(--shadow-1);
}
.cc-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.cc-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--terra-deep); margin: 0 0 6px; font-weight: 600; }
.cc-title { font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; margin: 0 0 8px; color: var(--ink); }
.cc-desc { font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 12px; flex: 1; }
.cc-meta { font-size: 0.8rem; color: var(--ink-mute); display: flex; gap: 10px; }

/* ---------- Tool forms ---------- */
.tool-form {
  padding: 32px 36px;
  background: var(--paper);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
}
.form-row { display: grid; gap: 16px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.tool-form .btn-primary { margin-top: 8px; }

/* Quiz */
.quiz-form .field { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.quiz-form .field:last-of-type { border-bottom: none; }
.quiz-q { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 12px; color: var(--ink); }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-soft);
  cursor: pointer;
  transition: all var(--t);
}
.quiz-option:hover { border-color: var(--sage-soft); background: var(--paper); }
.quiz-option input { accent-color: var(--sage); }
.quiz-option input:checked + span { color: var(--sage-deep); font-weight: 500; }
.quiz-option:has(input:checked) {
  background: var(--sage-bg);
  border-color: var(--sage);
}

/* ---------- Results ---------- */
.results {
  margin-top: 28px;
  padding: 36px 36px;
  background: var(--paper);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
  animation: fade-up .4s ease both;
}
.results h2 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 6px; }
.results .lead { color: var(--ink-soft); margin: 0 0 24px; }

/* Macros bars */
.macro-bars { display: grid; gap: 14px; margin: 22px 0; }
.macro-bar { }
.macro-bar-head { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 6px; }
.macro-bar-head strong { font-family: var(--serif); font-weight: 500; }
.macro-bar-fill { height: 10px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.macro-bar-fill span { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; }
.macro-p span { background: linear-gradient(90deg, var(--sage), var(--sage-deep)); }
.macro-c span { background: linear-gradient(90deg, var(--mustard), var(--terra)); }
.macro-g span { background: linear-gradient(90deg, var(--terra-soft), var(--terra)); }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0 6px;
}
.metric-tile {
  padding: 16px 18px;
  background: var(--cream);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
}
.metric-tile small { color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.metric-tile strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 4px;
  color: var(--ink);
}
.metric-tile .imc-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--r-pill);
}

/* Meals */
.meal-plan { margin: 24px 0; }
.meal-card {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--cream);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  border: 1px solid var(--line-soft);
}
.meal-name { font-family: var(--serif); color: var(--terra-deep); margin: 0; font-size: 1rem; font-weight: 500; letter-spacing: 0.01em; }
.meal-detail { color: var(--ink); margin: 4px 0 0; font-size: 0.96rem; }
.meal-kcal { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--sage-deep); }

/* Tips list */
.tips {
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--sage-bg), var(--cream));
  border-radius: var(--r-md);
  border-left: 4px solid var(--sage);
}
.tips h4 { font-family: var(--serif); margin: 0 0 10px; color: var(--sage-deep); }
.tips ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.tips li { margin-bottom: 6px; }

/* Health circle score */
.score-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 24px;
}
.score-circle {
  width: 160px; height: 160px;
  position: relative;
  display: grid; place-items: center;
}
.score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-circle .ring-bg { fill: none; stroke: var(--cream-deep); stroke-width: 12; }
.score-circle .ring-val { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.score-label { position: absolute; text-align: center; }
.score-label strong { font-family: var(--serif); font-size: 2.4rem; display: block; font-weight: 500; }
.score-label small { color: var(--ink-soft); font-size: 0.8rem; }

.health-dimensions { display: grid; gap: 12px; }
.dim-bar { }
.dim-head { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 4px; }
.dim-bar-fill { height: 8px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.dim-bar-fill span { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; }

.alert-box {
  margin-top: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #F8ECE2, var(--paper));
  border-left: 4px solid var(--terra);
  border-radius: var(--r-md);
}
.alert-box p { margin: 0; color: var(--ink); font-size: 0.95rem; }
.alert-box strong { color: var(--terra-deep); }

/* Workout */
.day-card {
  background: var(--cream);
  padding: 20px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.day-card h3 {
  font-family: var(--serif);
  color: var(--sage-deep);
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.day-sub { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 14px; }
.exer-section { margin-bottom: 14px; }
.exer-section h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--terra-deep);
  margin: 0 0 8px;
  font-weight: 600;
}
.exer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.exer-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  font-size: 0.92rem;
}
.exer-item strong { font-weight: 500; }
.exer-item span { color: var(--ink-soft); font-size: 0.86rem; }
.exer-meta { font-family: var(--serif); color: var(--sage-deep); font-weight: 500; }

/* =========================================================
   PROFILE
   ========================================================= */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 28px 32px;
  background: linear-gradient(120deg, var(--paper) 0%, var(--cream-deep) 100%);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}
.profile-hero::before {
  content: "";
  position: absolute;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(212,168,67,0.18), transparent 65%);
  top: -60px; right: -60px;
  pointer-events: none;
}
.profile-hero-meta { flex: 1; min-width: 0; }
.profile-hero-meta h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}
.profile-hero-meta p {
  margin: 4px 0 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.profile-hero-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.profile-hero-stats div { display: flex; flex-direction: column; }
.profile-hero-stats small {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.profile-hero-stats strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--sage-deep);
  margin-top: 2px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 18px;
  margin-bottom: 12px;
}
.profile-card {
  padding: 26px 28px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
}
.profile-card h3 { font-family: var(--serif); margin: 0 0 16px; color: var(--sage-deep); }
.profile-list { margin: 0; display: grid; gap: 10px; }
.profile-list div { display: flex; justify-content: space-between; gap: 14px; }
.profile-list dt { color: var(--ink-soft); font-size: 0.88rem; }
.profile-list dd { margin: 0; font-weight: 500; color: var(--ink); font-size: 0.94rem; text-align: right; }
.profile-progress { background: linear-gradient(135deg, var(--cream), var(--cream-deep)); }
.progress-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.progress-stat { padding: 14px 16px; background: var(--paper); border-radius: var(--r-sm); }
.progress-stat small { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.progress-stat strong { font-family: var(--serif); font-size: 1.6rem; display: block; margin-top: 4px; color: var(--sage-deep); font-weight: 500; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.badge {
  padding: 22px 18px;
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  text-align: center;
  transition: transform var(--t);
}
.badge:hover { transform: translateY(-2px); }
.badge-emoji {
  font-size: 2.4rem;
  display: inline-grid; place-items: center;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mustard-soft), #F4D89A);
  margin-bottom: 10px;
}
.badge h4 { font-family: var(--serif); font-size: 1rem; margin: 4px 0 4px; }
.badge p { color: var(--ink-soft); font-size: 0.82rem; margin: 0; }
.badge.locked .badge-emoji {
  background: var(--cream-deep);
  filter: grayscale(1);
  opacity: 0.55;
}
.badge.locked h4, .badge.locked p { color: var(--ink-mute); }

/* =========================================================
   Bottom nav (móvil)
   ========================================================= */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(255, 254, 251, 0.96);
  border-top: 1px solid var(--line-soft);
  padding: 8px 4px;
  backdrop-filter: blur(10px);
  justify-content: space-around;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--r-sm);
}
.bnav-item.active { color: var(--sage-deep); }
.bnav-item.active svg { stroke: var(--sage-deep); }

/* =========================================================
   Modal
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.55);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal-content {
  position: relative;
  width: 100%;
  max-width: 880px;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  margin: auto;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--paper);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: background var(--t);
}
.modal-close:hover { background: var(--cream-deep); }
.modal-body { padding: 32px 40px 40px; }

/* Video modal */
.modal-video {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 22px;
}
.modal-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Blog modal */
.blog-article { max-width: 700px; margin: 0 auto; padding: 6px 0 0; }
.blog-cover { width: 100%; aspect-ratio: 21/9; object-fit: cover; border-radius: var(--r-md); margin-bottom: 24px; }
.blog-meta { display: flex; gap: 18px; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 14px; }
.blog-meta span:first-child { color: var(--terra-deep); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; }
.blog-article h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 500;
}
.blog-article .blog-content { font-size: 1.04rem; line-height: 1.75; color: var(--ink); }
.blog-article .blog-content p { margin: 0 0 16px; }
.blog-article .blog-content p.lead { font-size: 1.18rem; color: var(--ink-soft); font-family: var(--serif); font-style: italic; font-weight: 400; }
.blog-article .blog-content h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 28px 0 10px;
  color: var(--sage-deep);
}
.blog-article .blog-content ul, .blog-article .blog-content ol { padding-left: 22px; margin: 0 0 16px; }
.blog-article .blog-content li { margin-bottom: 6px; }
.blog-article .blog-content strong { color: var(--ink); font-weight: 600; }
.blog-article .blog-content em { color: var(--terra-deep); font-style: italic; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-illustration { padding: 40px 32px; }
  .login-panel { padding: 40px 32px; }
  .illu-headline { font-size: 1.8rem; margin: 24px 0 12px; }
  .slider { height: 290px; }
  .slide-content { padding: 22px 26px 26px; }
  .slider-arrow { width: 38px; height: 38px; }
  .slider-prev { left: 10px; }
  .slider-next { right: 10px; }
  .content-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .profile-progress { grid-column: span 2; }
  .main-nav { display: none; }
  .bottom-nav { display: flex; }
  .hello-row { grid-template-columns: 1fr; padding: 28px; }
  .hello-illustration { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 4px; }
  .profile-hero { padding: 22px; gap: 18px; }
  .avatar-xl { width: 88px; height: 88px; font-size: 1.9rem; }
}

@media (max-width: 640px) {
  .container, .container.narrow { padding: 0 18px; }
  .login-body { padding: 12px; }
  .login-illustration { padding: 32px 24px; }
  .login-panel { padding: 32px 24px; }
  .content-grid { grid-template-columns: 1fr; }
  .slider { height: 250px; border-radius: var(--r-md); }
  .slide-content { padding: 20px 22px 22px; }
  .slide-badge { font-size: 0.66rem; padding: 4px 10px; margin-bottom: 8px; }
  .slide-desc { font-size: 0.88rem; margin-bottom: 12px; }
  .slide-cta { padding: 9px 18px; font-size: 0.88rem; }
  .slider-arrow { width: 34px; height: 34px; }
  .slider-prev { left: 8px; }
  .slider-next { right: 8px; }
  .slide-fallback { font-size: 1.4rem; padding: 0 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .tool-form { padding: 24px 22px; }
  .results { padding: 24px 22px; }
  .form-row.two { grid-template-columns: 1fr; }
  .continue-row { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-progress { grid-column: span 1; }
  .modal-body { padding: 24px 20px 30px; }
  .blog-cover { aspect-ratio: 16/9; }
  .icon-btn { display: none; }
  .meal-card { grid-template-columns: 1fr; gap: 4px; }
  .score-row { grid-template-columns: 1fr; }
  .score-circle { margin: 0 auto; }
  .demo-credentials li { font-size: 0.82rem; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-hero-stats { justify-content: center; }
}
