:root {
  --night: #06111c;
  --night-2: #0a1a28;
  --paper: #f6f1e7;
  --ink: #0b1b2b;
  --ink-soft: #3d5163;
  --muted: #6b7c8a;
  --gold: #c9a55c;
  --gold-soft: #e4cd96;
  --gold-deep: #9c7b36;
  --teal: #0b6e7a;
  --mint: #2bb8c8;
  --line-dark: rgba(228, 205, 150, 0.16);
  --line-light: rgba(11, 27, 43, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; min-height: 100dvh; }

/* ── Left art panel ── */
.auth-art {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 44px clamp(32px, 5vw, 72px);
  color: #f4efe4;
  background:
    radial-gradient(700px 520px at 85% 15%, rgba(11, 110, 122, 0.4), transparent 65%),
    radial-gradient(600px 420px at 0% 100%, rgba(201, 165, 92, 0.16), transparent 70%),
    var(--night);
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.auth-art-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(228, 205, 150, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(228, 205, 150, 0.05) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 15%, transparent 72%);
}
.auth-art > * { position: relative; }

.auth-brand { display: inline-flex; align-items: center; gap: 12px; }
.auth-brand img { filter: drop-shadow(0 4px 12px rgba(43, 184, 200, 0.25)); }
.auth-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand strong { font-weight: 800; letter-spacing: 0.14em; font-size: 0.92rem; }
.auth-brand small { font-size: 0.72rem; opacity: 0.62; letter-spacing: 0.03em; }

.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
}
.auth-eyebrow::after { content: ""; width: 56px; height: 1px; background: currentColor; opacity: 0.5; }
.auth-art h1 {
  margin-top: 22px;
  font-family: var(--serif); font-weight: 350;
  font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1.05; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  max-width: 14ch;
}
.auth-art h1 em {
  font-style: italic; font-weight: 300;
  background: linear-gradient(100deg, var(--gold-soft), var(--gold) 55%, #f1dfb1);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-lead { margin-top: 20px; max-width: 46ch; color: rgba(244, 239, 228, 0.7); font-size: 1rem; line-height: 1.7; }
.auth-points { margin-top: 36px; border-top: 1px solid var(--line-dark); max-width: 460px; }
.auth-points li {
  display: flex; gap: 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line-dark);
  color: rgba(244, 239, 228, 0.82); font-size: 0.93rem;
}
.auth-points span { font-family: var(--serif); font-style: italic; color: var(--gold); min-width: 22px; }
.auth-foot { font-family: var(--serif); font-style: italic; color: rgba(244, 239, 228, 0.5); font-size: 0.98rem; }

/* ── Right form ── */
.auth-main {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 88px 24px 40px;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(201, 165, 92, 0.1), transparent 70%),
    var(--paper);
}
.auth-back {
  position: absolute; top: 32px; right: clamp(24px, 4vw, 48px);
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.86rem; font-weight: 600; color: var(--ink-soft);
  transition: color 0.3s;
}
.auth-back svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease); }
.auth-back:hover { color: var(--teal); }
.auth-back:hover svg { transform: translateX(-3px); }

.auth-card { width: min(420px, 100%); animation: rise 0.8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-brand-mobile { display: none; margin-bottom: 36px; color: var(--ink); }
.auth-kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); }
.auth-card h2 {
  margin-top: 12px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.015em;
}
.auth-sub { margin-top: 12px; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }

form { margin-top: 34px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field + .field { margin-top: 18px; }
.field label { display: block; margin-bottom: 8px; font-size: 0.82rem; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.control { position: relative; }
.control > svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; transition: stroke 0.3s;
}
.control input {
  width: 100%; height: 54px; padding: 0 48px 0 46px;
  border-radius: 14px; border: 1px solid var(--line-light);
  background: #fffdf8; color: var(--ink);
  font: 500 0.98rem var(--sans);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.control input::placeholder { color: #9aa8b3; }
.control input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(11, 110, 122, 0.12); }
.control:focus-within > svg { stroke: var(--teal); }
.reveal-pass {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
}
.reveal-pass:hover { background: rgba(11, 27, 43, 0.05); color: var(--ink); }
.reveal-pass svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.reveal-pass[aria-pressed="true"] { color: var(--teal); }

.submit {
  position: relative; width: 100%; height: 56px; margin-top: 28px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 0.98rem var(--sans); letter-spacing: 0.01em; color: #f6f1e7;
  background: linear-gradient(135deg, #0f2a3d, var(--night));
  box-shadow: 0 18px 36px -18px rgba(6, 17, 28, 0.8), inset 0 0 0 1px rgba(228, 205, 150, 0.25);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.submit::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(228, 205, 150, 0.22) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.9s var(--ease);
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 24px 44px -18px rgba(6, 17, 28, 0.85), inset 0 0 0 1px rgba(228, 205, 150, 0.45); }
.submit:hover::before { transform: translateX(100%); }
.submit:disabled { cursor: progress; transform: none; }
.submit-spin {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 2px solid rgba(246, 241, 231, 0.25); border-top-color: var(--gold-soft);
  opacity: 0; animation: spin 0.8s linear infinite;
}
.submit.is-busy .submit-label { opacity: 0; }
.submit.is-busy .submit-spin { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { min-height: 22px; margin-top: 14px; color: #b42318; font-size: 0.88rem; font-weight: 600; }
.error:empty { min-height: 0; margin: 0; }
.auth-help { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-light); color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.auth-help a { color: var(--teal); font-weight: 700; }
.auth-help a:hover { text-decoration: underline; }
.auth-copy { margin-top: 48px; color: var(--muted); font-size: 0.78rem; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-main {
    min-height: 100vh; min-height: 100dvh;
    background:
      radial-gradient(520px 360px at 100% 0%, rgba(11, 110, 122, 0.12), transparent 70%),
      radial-gradient(480px 320px at 0% 100%, rgba(201, 165, 92, 0.14), transparent 70%),
      var(--paper);
  }
  .auth-brand-mobile { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
