:root {
  --bg: #0f0f11;
  --surface: #18181c;
  --surface-2: #202026;
  --border: #2c2c36;
  --text: #f0f0f5;
  --muted: #8b8b9d;
  --gold: #f5c518;
  --gold-text: #f5c518;
  --danger: #ff8a8a;
  --success: #22c55e;
  --shadow: 0 24px 80px rgba(0,0,0,.44);
}

:root[data-theme="light"] {
  --bg: #f7f6f3;
  --surface: #fff;
  --surface-2: #efeee9;
  --border: #e2e0d8;
  --text: #18181c;
  --muted: #6b6b78;
  --gold: #c8930a;
  --gold-text: #806000;
  --danger: #b42318;
  --success: #18743a;
  --shadow: 0 24px 70px rgba(20,20,30,.12);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
a { color: inherit; }

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(245,197,24,.08), transparent 30rem),
    var(--bg);
}

.auth-shell {
  width: min(100% - 32px, 440px);
  margin: 0 auto;
  padding: 64px 0 40px;
}

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; margin-bottom: 28px; }
.auth-brand__name { font-size: 1.35rem; font-weight: 900; letter-spacing: -.04em; }
.auth-brand__name span { color: var(--gold-text); }
.auth-brand__tag { color: var(--muted); font-size: .82rem; }

.auth-card {
  background: rgba(24,24,28,.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .auth-card { background: rgba(255,255,255,.94); }

.auth-card__heading { margin-bottom: 26px; }
.auth-card__eyebrow { display: inline-block; color: var(--gold-text); font-size: .72rem; font-weight: 800; letter-spacing: .12em; margin-bottom: 9px; }
.auth-card h1 { margin: 0; font-size: 1.85rem; letter-spacing: -.035em; }
.auth-card p { margin: 8px 0 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }

.auth-form { display: grid; gap: 17px; }
.auth-field { display: grid; gap: 8px; font-size: .84rem; font-weight: 700; }
.auth-input-wrap { position: relative; }
.auth-input-wrap input {
  width: 100%;
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  padding: 0 92px 0 42px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-input-wrap input:not([data-password-toggle]) { padding-right: 14px; }
.auth-input-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,197,24,.12); }
.auth-input-wrap input::placeholder { color: var(--muted); opacity: .8; }
.auth-input-icon { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.auth-password-toggle { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 800; }
.auth-password-toggle:hover, .auth-password-toggle:focus-visible { color: var(--gold); outline: none; }

.auth-message { min-height: 20px; margin-top: -4px; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.auth-card .auth-message.is-error { color: var(--danger); }
.auth-message.is-success { color: var(--success); }

.auth-submit { min-height: 50px; border: 0; border-radius: 13px; background: var(--gold); color: #101010; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .18s ease, filter .18s ease; }
.auth-submit:hover { filter: brightness(1.04); transform: translateY(-1px); }
.auth-submit:disabled { cursor: wait; opacity: .75; transform: none; }
.auth-spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.25); border-top-color: #111; border-radius: 999px; display: none; animation: spin .7s linear infinite; }
.auth-submit.is-loading .auth-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-help { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; color: var(--muted); font-size: .8rem; text-align: center; }
.auth-help a { color: var(--gold-text); font-weight: 800; text-decoration: none; }
.auth-back { display: block; width: max-content; max-width: 100%; margin: 22px auto 0; color: var(--muted); font-size: .84rem; text-decoration: none; }
.auth-back:hover { color: var(--text); }

.auth-page--registration .auth-shell { width:min(100% - 32px,640px); padding-top:28px; }
.auth-page--registration .auth-brand { margin-bottom:18px; }
.auth-page--registration .auth-card { padding:24px; }
.auth-page--registration .auth-card__heading { margin-bottom:18px; }
.auth-page--registration .identity-form { gap:13px; }
.auth-form-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.auth-form-row > label { min-width:0; }
.auth-page--registration .identity-form label { font-size:.875rem; gap:6px; }
.auth-page--registration .identity-form small { font-size:.76rem; line-height:1.4; }
.auth-page--registration .auth-help { margin-top:17px; padding-top:16px; }
.auth-page--registration .auth-message { margin:0; min-height:0; font-size:.82rem; }
.auth-page--registration .auth-message:empty { display:none; }
.auth-form :focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
.auth-form input:not([type=checkbox]) { font-size:1rem; }
.auth-form [aria-invalid="true"] { border-color:var(--danger); }
:root[data-theme="light"] .auth-help a { color:#806000; }
@media(max-width:640px) {
  .auth-form-row { grid-template-columns:minmax(0,1fr); gap:13px; }
  .auth-page--registration .auth-shell { width:calc(100% - 24px); padding-top:24px; }
  .auth-page--registration .auth-card { padding:20px 18px; }
}

@media (max-width: 540px) {
  .auth-shell { width: min(100% - 24px, 440px); padding-top: 34px; }
  .auth-card { border-radius: 18px; padding: 22px 18px; }
  .auth-card h1 { font-size: 1.6rem; }
}
