/* ═══════════════════════════════════════
   login.css — Estilos Auth Nubifly
   Depende de: variables.css (cargado antes)
   ═══════════════════════════════════════ */

/* ─── Fondo ─────────────────────────── */

html, body {
  min-height: 100%;
  font-family: var(--font-body);
  background: #ffffff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Sutil gradiente superior — muy suave */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 35% at 50% 0%, rgba(9,105,218,.04) 0%, transparent 70%);
}

/* Sin puntos de cuadrícula */
body::after { display: none; }

/* ─── Toolbar ───────────────────────── */

.toolbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: calc(env(safe-area-inset-top, 0px) + 11px) 20px 11px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,1);
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease, -webkit-backdrop-filter .3s ease;
}
.toolbar.scrolled {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px) saturate(200%); -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid rgba(208,215,222,0.4);
}

.toolbar-back {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px 7px 10px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-dim); cursor: pointer; text-decoration: none;
  font-family: var(--font-body); font-size: .85rem; font-weight: 500;
  transition: all var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.toolbar-back:hover { background: #f4f4f4; border-color: var(--border-strong); color: var(--text); }
.toolbar-back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; flex-shrink:0; }
.toolbar-back span { line-height: 1; }

/* ─── Page layout ───────────────────── */

.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 80px) 20px calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* Panel hero izquierdo - OCULTO por defecto (móvil) */
.auth-hero {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   DESKTOP: dos columnas — pantalla completa
   (900px–1199px: llena toda la pantalla)
   ══════════════════════════════════════════ */
@media (min-width: 900px) {

  html, body {
    height: 100%;
    background: #f0eeff;   /* lavanda muy suave de fondo */
  }

  body {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100vh;
    padding: 0;
  }

  body::before {
    background: none;   /* sin overlay extra en pantalla completa */
  }

  /* Toolbar visible — glass sobre el panel izquierdo */
  .toolbar {
    display: flex;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* ── Layout: grid dos columnas, pantalla completa ── */
  .page {
    position: relative;
    display: grid;
    grid-template-columns: 44% 56%;
    align-items: stretch;
    gap: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
  }

  /* ── Panel izquierdo — gradiente iridiscente ── */
  .auth-hero {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    position: relative;
    width: auto;
    height: 100%;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;   /* ← centrado vertical profesional */
    padding: 52px 52px 52px 52px;
    background:
      radial-gradient(ellipse 90% 70% at 10% 100%, rgba(200,160,255,0.55) 0%, transparent 60%),
      radial-gradient(ellipse 70% 60% at 90% 0%,   rgba(140,210,255,0.40) 0%, transparent 55%),
      radial-gradient(ellipse 60% 80% at 50% 50%,  rgba(220,180,255,0.25) 0%, transparent 70%),
      linear-gradient(155deg, #f0ecff 0%, #e4d8ff 25%, #f5e0ff 50%, #ddeeff 75%, #e4f8f4 100%);
  }

  .auth-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180,140,255,0.20) 0%, transparent 70%);
    pointer-events: none;
  }

  .auth-hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100,200,240,0.18) 0%, transparent 70%);
    pointer-events: none;
  }

  /* Botón Atrás — legible sobre panel iridiscente */
  .toolbar-back {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(180,160,220,0.4);
    color: #3a2860;
  }
  .toolbar-back:hover {
    background: rgba(255,255,255,0.82);
  }

  .auth-hero-content {
    position: relative;
    z-index: 1;
    max-width: 360px;
  }

  .auth-hero-badge {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8);
    display: grid;
    place-items: center;
    margin-bottom: 40px;   /* espacio entre icono y título */
    box-shadow: 0 4px 20px rgba(140,100,220,0.15), 0 1px 0 rgba(255,255,255,0.9) inset;
  }

  .auth-hero-badge svg {
    width: 26px; height: 26px;
    stroke: #6b48c8;
    fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
  }

  .auth-hero-title {
    font-family: var(--font-display);
    font-size: 2.4rem; font-weight: 700;
    color: #1a1040; line-height: 1.2;
    margin-bottom: 18px; letter-spacing: -0.025em;
  }

  .auth-hero-desc {
    font-size: 1rem; line-height: 1.65;
    color: #4a3870; margin-bottom: 40px;
  }

  .auth-hero-features { display: flex; flex-direction: column; gap: 14px; }

  .hero-feature {
    display: flex; align-items: center; gap: 11px;
    color: #2d1f60; font-size: 0.9rem; font-weight: 500;
  }

  .hero-feature svg {
    width: 18px; height: 18px;
    stroke: #7c52d4; fill: none;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
    background: rgba(140,100,220,0.12);
    border-radius: 5px; padding: 2px;
  }

  /* ── Columna derecha — formulario ── */
  .page > .auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 72px;
    background: #ffffff;
    width: 100%; max-width: none;
    height: 100%; overflow-y: auto;
  }

  /* Ocultar logo duplicado */
  .page > .auth-card .auth-logo { display: none; }

  .page > .auth-card .auth-box,
  .page > .auth-card .auth-footer,
  .page > .auth-card .auth-terms {
    width: 100%; max-width: 380px;
  }
}

/* ══════════════════════════════════════════
   LARGE DESKTOP: card flotante
   (1200px+: card centrado con bordes redondeados)
   ══════════════════════════════════════════ */
@media (min-width: 1200px) {

  html, body { background: #dddae8; }

  body {
    align-items: center;
    justify-content: center;
    padding: 40px;
  }

  body::before {
    background:
      radial-gradient(ellipse 80% 60% at 20% 80%, rgba(160,120,220,.18) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 80% 20%, rgba(100,180,220,.14) 0%, transparent 55%);
  }

  .page {
    width: min(1040px, 100%);
    height: min(620px, 88vh);
    min-height: unset;
    border-radius: 22px;
    border: 1.5px solid rgba(255,255,255,0.85);
    box-shadow:
      0 2px 0 rgba(255,255,255,0.6) inset,
      0 40px 100px rgba(80,50,130,0.16),
      0 8px 24px rgba(0,0,0,0.08);
  }

  .toolbar { display: none; }

  .page > .auth-card { padding: 56px 80px; }
}



/* ─── Card ──────────────────────────── */

.auth-card {
  width: 100%; max-width: 400px;
  animation: slideUp .5s cubic-bezier(.4,0,.2,1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Logo block ────────────────────── */

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg,#eef0f4,#e6e9ed);
  border: 1px solid #d0d7de;
  display: grid; place-items: center;
  margin: 0 auto 14px;
  box-shadow: 0 0 0 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.1);
  position: relative;
}
.auth-logo-icon::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 14px;
  background: linear-gradient(145deg,rgba(0,0,0,.04),transparent);
  pointer-events: none;
}
.auth-logo-icon svg {
  width: 24px; height: 24px;
  stroke: #424a53; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  position: relative; z-index: 1;
}
.auth-logo-name {
  font-family: var(--font-mono); font-size: 1.1rem; font-weight: 500;
  letter-spacing: .04em; color: var(--text);
}
.auth-logo-name span { color: var(--accent); }

/* ─── Box ───────────────────────────── */

.auth-box {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.auth-box-accent { display: none; }
.auth-box-inner { padding: 0 0 24px; }
.auth-box-accent {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.15), rgba(0,0,0,.07), transparent);
}
.auth-box-inner { padding: 28px 28px 24px; }

/* ─── Header ────────────────────────── */

.auth-header { margin-bottom: 28px; }
.auth-title {
  font-size: 1.6rem; font-weight: 700;
  color: var(--text); letter-spacing: -.025em;
  margin-bottom: 6px;
}
.auth-sub { font-size: .88rem; color: var(--text-dim); line-height: 1.55; }

/* ─── Social buttons ────────────────── */

.social-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  border: 1.5px solid #d0d7de;
  border-radius: 8px;
  background: #f6f8fa;
  font-family: var(--font-body); font-size: .88rem; font-weight: 500;
  color: var(--text); cursor: pointer;
  transition: all var(--ease); text-decoration: none;
}
.social-btn:hover { border-color: #9198a1; background: #f0f2f5; }
.social-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ─── Divider ───────────────────────── */

.divider {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text {
  font-size: .72rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: .06em; text-transform: uppercase;
  font-family: var(--font-mono); white-space: nowrap;
}

/* ─── Campos ────────────────────────── */

.field-outer {
  display: grid; grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .38s cubic-bezier(.4,0,.2,1), opacity .28s ease, margin-bottom .38s cubic-bezier(.4,0,.2,1);
  margin-bottom: 12px;
}
.field-outer.hidden { grid-template-rows: 0fr; opacity: 0; margin-bottom: 0; pointer-events: none; }
.field-outer > .field { overflow: hidden; }

.field { position: relative; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.field-label-text {
  font-size: .88rem; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--text);
  transition: color var(--ease); font-family: var(--font-body);
}
.field:focus-within .field-label-text { color: var(--text); }
.field-label-action {
  font-size: .75rem; font-weight: 500; color: var(--text-dim);
  text-decoration: none; transition: opacity var(--ease);
  display: none;
}
.field-label-action:hover { opacity: .75; }
.show-forgot .field-label-action { display: block; }

.field-inner { position: relative; }
.field-input {
  width: 100%; height: 44px;
  border: 1.5px solid #d0d7de;
  border-radius: 8px;
  background: #ffffff;
  font-family: var(--font-body); font-size: .92rem;
  color: var(--text);
  padding: 0 38px 0 14px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  caret-color: var(--accent);
}
.field-input::placeholder { color: #9198a1; }
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
  background: #ffffff;
}
.field-input.valid  { border-color: rgba(63,185,80,.6); }
.field-input.error  { border-color: rgba(248,81,73,.6); box-shadow: 0 0 0 3px var(--red-glow); }

/* ─── Íconos de campo ───────────────── */

.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  padding: 4px; color: var(--text-muted);
  transition: color var(--ease); display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--text-dim); }
.pw-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.field-status {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; display: none; pointer-events: none;
}
.field-status svg { width: 15px; height: 15px; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; fill: none; display: none; }
.field-input.valid  ~ .field-status              { display: block; }
.field-input.valid  ~ .field-status .icon-ok     { display: block; stroke: var(--green); }
.field-input.error  ~ .field-status              { display: block; }
.field-input.error  ~ .field-status .icon-err    { display: block; stroke: var(--red); }

/* ─── Hints ─────────────────────────── */

.field-hint {
  font-size: .72rem; min-height: 15px; margin-top: 4px;
  color: var(--text-muted);
  transition: color var(--ease); font-family: var(--font-mono);
}
.field-hint.err { color: var(--red); }
.field-hint.ok  { color: var(--green); }

/* ─── Email progress ────────────────── */

.email-progress {
  height: 2px; border-radius: 2px; background: #e8eaed;
  margin-top: 5px; overflow: hidden; opacity: 0; transition: opacity .3s;
}
.email-progress.visible { opacity: 1; }
.email-bar { height: 100%; border-radius: 2px; width: 0; transition: width .3s ease, background .3s ease; }

/* ─── Password strength ─────────────── */

.pw-strength { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .3s ease, opacity .25s ease; margin-top: 5px; }
.pw-strength.visible { max-height: 36px; opacity: 1; }
.pw-bars { display: flex; gap: 3px; margin-bottom: 3px; }
.pw-bar { flex: 1; height: 2px; border-radius: 2px; background: #e8eaed; transition: background .3s; }
.pw-lbl { font-size: .68rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ─── Botón submit ──────────────────── */

.btn-submit {
  width: 100%; height: 44px;
  border-radius: 8px;
  border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  margin-top: 18px; position: relative; overflow: hidden;
  transition: all var(--ease);
  letter-spacing: .01em;
}
.btn-submit:disabled {
  background: #f0f2f5;
  color: var(--text-muted);
  border: 1.5px solid #d0d7de;
  cursor: not-allowed;
}
.btn-submit:not(:disabled) {
  background: linear-gradient(180deg,#2d333b,#24292f);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 12px rgba(0,0,0,.2);
}
.btn-submit:not(:disabled):hover {
  background: linear-gradient(180deg,#373e47,#2d333b);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 16px rgba(0,0,0,.25);
  transform: translateY(-1px);
}
.btn-submit:not(:disabled):active { transform: translateY(0); }

.btn-spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.btn-txt { transition: opacity .15s; }

/* ─── Footer del card ───────────────── */

.auth-footer {
  padding: 20px 0 0;
  border-top: 1px solid #e6eaef;
  background: transparent;
  text-align: center;
  font-size: .85rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.auth-footer a {
  color: #24292f; font-weight: 600;
  text-decoration: none;
  transition: opacity var(--ease);
}
.auth-footer a:hover { opacity: .75; }

/* ─── Términos ──────────────────────── */

.auth-terms {
  text-align: center;
  margin-top: 16px;
  font-size: .73rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.auth-terms a { color: var(--text-dim); text-decoration: underline; text-decoration-color: var(--border-hover); }
.auth-terms a:hover { color: var(--text); }

/* ─── Status badge ──────────────────── */

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-family: var(--font-mono); color: var(--text-muted);
  margin-top: 12px;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #1a7f37;
  box-shadow: 0 0 5px rgba(26,127,55,.4);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ─── Select / Región ───────────────── */

.select-wrapper { position: relative; }
.field-select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding-right: 36px;
  cursor: pointer;
  background: #ffffff;
}
.field-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(9,105,218,.12); }
.field-select option { color: var(--text); background: #ffffff; }
.field-select optgroup { font-size: .78rem; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
.select-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none; display: flex; align-items: center;
  color: var(--text-muted);
}
.select-arrow svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── Términos switch ───────────────── */

.terms-outer { margin-top: 4px; }

.terms-row {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; user-select: none;
  padding: 12px 14px;
  border: 1.5px solid #d0d7de;
  border-radius: 10px;
  background: #f8f9fa;
  transition: border-color var(--ease), background var(--ease);
}
.terms-row:hover { border-color: #9198a1; background: #f0f2f5; }

.terms-switch-wrap { position: relative; flex-shrink: 0; margin-top: 1px; }
.terms-checkbox {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.terms-switch {
  display: block;
  width: 40px; height: 22px;
  border-radius: 99px;
  background: #d0d7de;
  border: 1.5px solid rgba(0,0,0,.08);
  position: relative;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  flex-shrink: 0;
}
.terms-switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .2s;
}
.terms-checkbox:checked + .terms-switch {
  background: var(--accent, #0969da);
  border-color: rgba(9,105,218,.4);
  box-shadow: 0 0 0 3px rgba(9,105,218,.12);
}
.terms-checkbox:checked + .terms-switch::after {
  transform: translateX(18px);
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}

.terms-text {
  font-size: .83rem; color: var(--text-dim); line-height: 1.5;
  font-family: var(--font-body);
}
.terms-text a {
  color: var(--text); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--border-hover, #d0d7de);
  transition: opacity var(--ease);
}
.terms-text a:hover { opacity: .7; }

/* ─── Responsive ────────────────────── */

@media (max-width: 440px) {
  .auth-box-inner { padding: 22px 20px 20px; }
  .social-row     { grid-template-columns: 1fr; }
  .auth-footer    { padding: 14px 20px; }
}
