/* Estilos de login.html (antes en <style> dentro de la página). */
:root {
      --navy: #00263e;
      --navy-deep: #001a2a;
      --navy-soft: #07344f;
      --gold: #c9a84c;
      --gold-soft: #d9bd6c;
      --ink: #0d1b2a;
      --muted: #5a6573;
      --line: #e8e3d6;
      --line-soft: #efece4;
      --bg: #fbf8f2;
      --error: #b8323b;
      --error-bg: #fdecee;
      --success: #2a6e4a;
      --success-bg: #ecf6f0;
    }

    [x-cloak] { display: none !important; }

    html, body { background: var(--bg); }
    body {
      font-family: 'Montserrat', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
      color: var(--ink);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      letter-spacing: -0.005em;
      margin: 0;
    }
    .serif { font-family: 'Playfair Display', Georgia, serif; letter-spacing: -0.01em; }

    /* ── Layout ───────────────────────────────────────── */
    .auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
    @media (min-width: 1024px) {
      .auth-shell { grid-template-columns: 1.05fr 1fr; }
    }

    /* ── Brand stage ──────────────────────────────────── */
    .brand-stage {
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(120% 80% at 0% 0%, #08395a 0%, var(--navy) 45%, var(--navy-deep) 100%);
      color: #fff;
      padding: 1.5rem 1.375rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 1.25rem;
    }
    @media (min-width: 1024px) {
      .brand-stage { padding: 3.25rem 3.75rem; min-height: 100vh; gap: 2rem; }
    }
    .brand-stage::before {
      content: '';
      position: absolute; inset: 0;
      background:
        radial-gradient(50% 35% at 85% 12%, rgba(201,168,76,0.20), transparent 70%),
        radial-gradient(40% 50% at 5% 95%, rgba(201,168,76,0.10), transparent 70%);
      pointer-events: none;
    }
    .brand-stage::after {
      content: 'F';
      position: absolute;
      bottom: -5rem; right: -3rem;
      font-family: 'Playfair Display', Georgia, serif;
      font-size: clamp(18rem, 32vw, 34rem);
      font-weight: 600;
      line-height: 1;
      color: rgba(201, 168, 76, 0.06);
      pointer-events: none; user-select: none;
    }

    .brand-mark { display: flex; align-items: center; gap: 0.75rem; position: relative; z-index: 1; }
    .brand-mark .logo-mark { display: flex; align-items: center; }
    .brand-mark .logo-mark svg { height: 3rem; width: auto; display: block; }
    .brand-mark .stack { display: flex; flex-direction: column; line-height: 1.1; }
    .brand-mark .wordmark {
      font-family: 'Playfair Display', Georgia, serif;
      font-weight: 600; font-size: 1.5rem;
      letter-spacing: -0.01em;
    }
    .brand-mark .eyebrow-small {
      font-size: 0.6875rem; font-weight: 500;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--gold);
      margin-top: 0.1875rem;
    }

    .stage-prose { position: relative; z-index: 1; max-width: 28rem; display: none; }
    @media (min-width: 1024px) { .stage-prose { display: block; } }
    .stage-prose .eyebrow {
      font-size: 0.75rem; font-weight: 500;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 1.125rem;
    }
    .stage-prose h2 {
      font-family: 'Playfair Display', Georgia, serif;
      font-weight: 500;
      font-size: clamp(1.875rem, 3vw, 2.5rem);
      line-height: 1.15;
      letter-spacing: -0.015em;
      color: #fff;
      margin: 0;
    }
    .stage-prose h2 em { font-style: italic; color: var(--gold-soft); }
    .stage-prose p {
      color: rgba(255,255,255,0.75);
      font-size: 0.9375rem; line-height: 1.65;
      margin: 1.125rem 0 0; max-width: 26rem;
    }

    .stage-foot {
      position: relative; z-index: 1;
      display: none;
      align-items: center; gap: 0.625rem;
      font-size: 0.75rem;
      color: rgba(255,255,255,0.55);
      letter-spacing: 0.02em;
    }
    @media (min-width: 1024px) { .stage-foot { display: flex; } }

    /* ── Form pane ─────────────────────────────────────── */
    .form-pane {
      display: flex; align-items: center; justify-content: center;
      padding: 2rem 1.125rem 2.5rem;
      background: var(--bg);
    }
    @media (min-width: 1024px) { .form-pane { padding: 3rem 3rem; } }
    .form-frame { width: 100%; max-width: 26rem; }

    /* ── Card ──────────────────────────────────────────── */
    .auth-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 1rem;
      padding: 1.875rem 1.625rem;
      box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 24px 60px -28px rgba(0,38,62,0.20),
        0 8px 24px -20px rgba(0,38,62,0.18);
      animation: cardIn 0.45s ease-out both;
    }
    @media (min-width: 480px) { .auth-card { padding: 2.125rem 2rem; } }
    @keyframes cardIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .auth-card h1 {
      font-family: 'Playfair Display', Georgia, serif;
      font-weight: 600;
      font-size: 1.625rem;
      color: var(--navy);
      letter-spacing: -0.015em;
      margin: 0;
    }
    .auth-card .sub {
      color: var(--muted);
      font-size: 0.875rem;
      margin: 0.375rem 0 0;
    }
    .accent-rule {
      width: 1.75rem; height: 2px;
      background: var(--gold);
      border-radius: 2px;
      margin: 0.875rem 0 0;
    }

    /* ── Fields ────────────────────────────────────────── */
    .field { margin-top: 1.25rem; position: relative; }
    .field label {
      display: flex; justify-content: space-between; align-items: baseline;
      font-size: 0.78125rem;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 0.4375rem;
      letter-spacing: 0.01em;
    }
    .input {
      width: 100%;
      padding: 0.75rem 0.875rem;
      border: 1.5px solid var(--line);
      background: #fff;
      border-radius: 0.625rem;
      font-size: 0.9375rem;
      font-family: inherit;
      color: var(--ink);
      outline: none;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
      box-sizing: border-box;
    }
    .input::placeholder { color: #a3aab4; }
    .input:hover { border-color: #d8d2bf; }
    .input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,168,76,0.16); }
    .input:disabled { background: #f8f6ef; cursor: not-allowed; }
    .input.has-trailing { padding-right: 2.75rem; }

    .trailing-btn {
      position: absolute;
      right: 0.375rem;
      bottom: 0.375rem;
      height: 2.25rem; width: 2.25rem;
      border-radius: 0.5rem;
      border: none; background: transparent;
      color: var(--muted);
      cursor: pointer;
      display: grid; place-items: center;
      transition: color 0.15s ease, background 0.15s ease;
    }
    .trailing-btn:hover { color: var(--navy); background: rgba(0,38,62,0.05); }
    .trailing-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
    .trailing-btn svg { width: 1.125rem; height: 1.125rem; stroke-width: 1.6; }

    .link-soft {
      color: var(--navy);
      font-size: 0.78125rem;
      font-weight: 500;
      text-decoration: none;
      background: none; border: none; padding: 0; cursor: pointer;
      border-bottom: 1px solid transparent;
      transition: color 0.15s, border-color 0.15s;
      font-family: inherit;
    }
    .link-soft:hover { color: #00385e; border-color: var(--gold); }
    .link-soft:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

    /* ── Primary button ────────────────────────────────── */
    .btn-primary {
      width: 100%;
      background: var(--navy);
      color: #fff;
      padding: 0.8125rem 1rem;
      border: none;
      border-radius: 0.625rem;
      font-size: 0.9375rem;
      font-weight: 600;
      letter-spacing: 0.005em;
      cursor: pointer;
      font-family: inherit;
      display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
      transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
      box-shadow: 0 8px 20px -10px rgba(0,38,62,0.5);
      margin-top: 1.5rem;
      min-height: 2.875rem;
    }
    .btn-primary:hover:not(:disabled) { background: #003a5e; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(0,38,62,0.55); }
    .btn-primary:active:not(:disabled) { transform: translateY(0); }
    .btn-primary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
    .btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
    .btn-primary svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }
    .btn-primary .chev { width: 1rem; height: 1rem; opacity: 0.85; transition: transform 0.15s ease; }
    .btn-primary:hover:not(:disabled) .chev { transform: translateX(2px); }
    .btn-primary .label { display: inline-block; line-height: 1; }

    /* ── Divider ───────────────────────────────────────── */
    .divider {
      display: flex; align-items: center; gap: 0.875rem;
      color: var(--muted);
      font-size: 0.6875rem;
      font-weight: 500;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      margin: 1.625rem 0 1.125rem;
    }
    .divider::before, .divider::after {
      content: ''; flex: 1; height: 1px; background: var(--line-soft);
    }

    /* ── OAuth ─────────────────────────────────────────── */
    .oauth-row {
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.625rem;
    }
    .btn-oauth {
      background: #fff;
      color: var(--ink);
      border: 1.5px solid var(--line);
      border-radius: 0.625rem;
      padding: 0.6875rem 0.5rem;
      font-size: 0.875rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
      transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.18s ease;
      min-height: 2.75rem;
    }
    .btn-oauth:hover:not(:disabled) {
      border-color: #cbc3a8;
      background: #fdfbf4;
      transform: translateY(-1px);
      box-shadow: 0 8px 18px -14px rgba(0,38,62,0.35);
    }
    .btn-oauth:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
    .btn-oauth:disabled { opacity: 0.55; cursor: not-allowed; }
    .btn-oauth svg { width: 1.125rem; height: 1.125rem; }

    /* ── Alerts ────────────────────────────────────────── */
    .alert {
      margin-top: 1.25rem;
      padding: 0.75rem 0.875rem;
      border-radius: 0.625rem;
      font-size: 0.8125rem;
      line-height: 1.45;
      display: flex; gap: 0.625rem; align-items: flex-start;
    }
    .alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
    .alert-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(184,50,59,0.18); }
    .alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(42,110,74,0.18); }

    /* ── Footer ────────────────────────────────────────── */
    .legal {
      margin-top: 1.375rem;
      font-size: 0.75rem;
      color: var(--muted);
      text-align: center;
      line-height: 1.55;
    }
    .legal a { color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--line); }
    .legal a:hover { border-color: var(--gold); }

    .spinner {
      width: 1rem; height: 1rem;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .spinner-navy {
      width: 1.75rem; height: 1.75rem;
      border: 2.5px solid var(--line);
      border-top-color: var(--navy);
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
    }

    @media (prefers-reduced-motion: reduce) {
      .auth-card { animation: none; }
      .btn-primary, .btn-oauth, .btn-primary .chev, .input, .trailing-btn { transition: none; }
    }
