/* =========================================================
   Oreka Fit · Acceso (login + registro)
   Un solo HTML. PC ≥ 861px: dos columnas. Móvil ≤ 860px: cabecera + hoja.
   Medidas en px copiadas 1:1 de los diseños (PC 1280×880, móvil 390 de ancho).
   ========================================================= */

:root {
  /* Color */
  --cream: #F5EFE6;        /* panel de marca / fondo móvil */
  --white: #FFFFFF;
  --ink: #1C1A24;          /* texto principal */
  --ink-2: #3B3742;        /* pilares, casilla */
  --muted: #55505C;        /* texto de apoyo marca */
  --muted-2: #5E5966;      /* subtítulos, pestaña inactiva, icono ojo */
  --muted-3: #6A6571;      /* términos, ayuda contraseña */
  --placeholder: #8C8792;
  --border: #DDD8D0;
  --field: #FBFAF8;
  --tabs-bg: #F2EEE8;
  --brand-orange: #C4552E; /* palabra «oreka fit» */
  --link: #B04A26;
  --link-hover: #8A3618;
  --orange: #D2633A;       /* segmento / punto Alimentación */
  --blue: #3A57C9;         /* segmento / punto Entrenamiento + botón */
  --yellow: #D9A441;       /* segmento / punto Progreso */
  --accent: var(--blue);   /* color del botón principal */

  /* Tipografía */
  --font-display: 'Quicksand', sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* fuente del sistema: San Francisco (Apple), Segoe UI (Windows), Roboto (Android) */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Contenedor ---------- */
.auth {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
}

/* ---------- Panel de marca (PC) ---------- */
.brand {
  width: clamp(420px, 46.875vw, 600px); /* 600px a 1280px de ancho */
  flex-shrink: 0;
  padding: 56px 64px;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.brand__logo { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 40px; height: 40px; }
.brand__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.5px;
  color: var(--brand-orange);
  line-height: 1;
}
.brand__copy { display: flex; flex-direction: column; gap: 20px; max-width: 400px; }
.brand__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--ink);
}
.brand__text { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); }

.pillars {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: 13px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--ink-2);
}
.pillars li { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot--orange { background: var(--orange); }
.dot--blue { background: var(--blue); }
.dot--yellow { background: var(--yellow); }

/* ---------- Zona del formulario (PC) ---------- */
.sheet {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.auth[data-mode="signup"] .sheet { padding: 40px 48px; }

.card { width: 100%; max-width: 400px; display: flex; flex-direction: column; }
.auth[data-mode="login"] .card { gap: 32px; }
.auth[data-mode="signup"] .card { gap: 26px; }

.panel { display: flex; flex-direction: column; }
.auth[data-mode="login"] .panel { gap: 32px; }
.auth[data-mode="signup"] .panel { gap: 26px; }

/* Pestañas */
.tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px; padding: 4px;
  background: var(--tabs-bg); border-radius: 14px;
}
.tab {
  height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted-2);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.tab[aria-selected="true"] {
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 26, 36, .12);
}

/* Cabecera del formulario */
.panel__head { display: flex; flex-direction: column; gap: 8px; }
.panel__title { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.2; }
.panel__sub { margin: 0; font-size: 16px; color: var(--muted-2); }

/* Formulario */
.form { display: flex; flex-direction: column; }
.form--login { gap: 20px; }
.form--signup { gap: 16px; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-size: 14px; font-weight: 600; }
.link-strong { font-size: 14px; font-weight: 600; text-decoration: none; }

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--field);
  font: inherit;
  font-size: 16px; /* 16px evita el zoom automático de iOS */
  color: var(--ink);
}
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(58, 87, 201, .14); }
.input[aria-invalid="true"] { border-color: #C0392B; }
.form--signup .input { height: 50px; }

.input-wrap { position: relative; }
.input--with-btn { padding-right: 52px; }
.eye {
  position: absolute; right: 4px; top: 4px;
  width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); cursor: pointer;
}
.eye:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.form--signup .eye { right: 3px; top: 3px; }
.form--signup .input--with-btn { padding-right: 48px; }

.pw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.strength { display: flex; flex-direction: column; gap: 8px; }
.meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.meter span { height: 4px; border-radius: 2px; background: var(--border); transition: background .2s; }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--orange); }
.meter[data-level="2"] span:nth-child(-n+2) { background: var(--yellow); }
.meter[data-level="3"] span:nth-child(-n+3) { background: var(--blue); }
.meter[data-level="4"] span { background: var(--blue); }
.hint { margin: 0; font-size: 13px; color: var(--muted-3); }

.check {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--ink-2); cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }

.btn {
  height: 54px; margin-top: 4px;
  border: 0; border-radius: 12px;
  background: var(--accent); color: var(--white);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
}
.btn:hover { filter: brightness(.94); }
.btn:focus-visible { outline: 3px solid rgba(58, 87, 201, .35); outline-offset: 2px; }

.terms { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted-3); text-align: center; }

.only-mobile { display: none !important; }

/* =========================================================
   MÓVIL (≤ 860px) — diseño de 390px de ancho
   ========================================================= */
@media (max-width: 860px) {
  body { background: var(--cream); }

  .only-mobile { display: flex !important; }
  label .only-mobile, span.only-mobile { display: inline !important; }
  .only-desktop { display: none !important; }

  .auth { flex-direction: column; background: var(--cream); }

  /* Cabecera crema */
  .brand {
    width: auto;
    flex-shrink: 0;
    padding: 32px 24px 56px;
    padding-top: max(32px, env(safe-area-inset-top));
    justify-content: flex-start;
    gap: 22px;
  }
  .brand__logo { gap: 10px; }
  .brand__mark { width: 32px; height: 32px; }
  .brand__wordmark { font-size: 24px; letter-spacing: -0.4px; }
  .brand__copy { gap: 12px; max-width: 300px; }
  .brand__title { font-size: 32px; line-height: 1.08; letter-spacing: -0.8px; }
  .brand__text { font-size: 15px; line-height: 1.5; }

  .pillars { gap: 8px 14px; font-size: 10.5px; letter-spacing: 1px; }
  .pillars li { gap: 6px; }
  .dot { width: 8px; height: 8px; }

  /* Hoja blanca que se monta 28px sobre la cabecera */
  .sheet,
  .auth[data-mode="signup"] .sheet {
    flex: 1;
    display: block;
    margin-top: -28px;
    position: relative;
    background: var(--white);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -6px 24px rgba(28, 26, 36, .06);
    padding: 24px 24px 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  .card,
  .auth[data-mode="login"] .card,
  .auth[data-mode="signup"] .card { max-width: none; min-height: 100%; gap: 24px; }
  .auth[data-mode="login"] .panel,
  .auth[data-mode="signup"] .panel { gap: 24px; }

  .panel__head { gap: 6px; }
  .panel__title { font-size: 26px; letter-spacing: -0.6px; }
  .panel__sub { font-size: 15px; }

  .form--login { gap: 18px; }
  .form--signup { gap: 16px; }

  .form--signup .input { height: 52px; }
  .form--signup .eye { right: 4px; top: 4px; }
  .form--signup .input--with-btn { padding-right: 52px; }

  /* Contraseñas una debajo de otra */
  .pw-grid { grid-template-columns: 1fr; gap: 16px; }
  .strength--mobile { gap: 8px; }
  .strength--mobile .meter { margin-top: 4px; }

  .check { min-height: 44px; }
  .check input { width: 20px; height: 20px; }

  .btn { border-radius: 14px; }
  .form--login .btn { margin-top: 0; }

  /* En login, los términos bajan al final de la hoja; en registro van tras el botón */
  .auth[data-mode="login"] .sheet { display: flex; flex-direction: column; }
  .auth[data-mode="login"] .card { flex: 1; }
  .auth[data-mode="login"] .panel--login { flex: 1; }
  .panel--login .terms { margin-top: auto; }
}
