/* Accessible Trade Terminal — authentication pages (sign in / register / sign out).
   Self-contained and brand-matched to the marketing site (deep navy + muted gold, Inter),
   with automatic light/dark following the visitor's OS preference. No JS, no dependencies. */

:root {
  --brand-primary:       #0f2744;  /* deep navy */
  --brand-primary-hover: #173a66;
  --brand-accent:        #b48a30;  /* muted gold (text-contrast variant) */
  --bg:          #f6f6f4;
  --surface:     #ffffff;
  --surface-alt: #f0efea;
  --border:      #d9d6cf;
  --text:        #1a1f2b;
  --text-muted:  #525a6b;
  --danger:      #b00020;
  --radius:      10px;
  --radius-lg:   16px;
  --font-sans:   'Inter', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-primary:       #1d3a64;
    --brand-primary-hover: #27508a;
    --brand-accent:        #e0be6b;
    --bg:          #0b1220;
    --surface:     #121a2a;
    --surface-alt: #182339;
    --border:      #2a3655;
    --text:        #e8ecf3;
    --text-muted:  #9aa4bb;
    --danger:      #ff8094;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 50% -10%, color-mix(in srgb, var(--brand-primary) 14%, transparent), transparent);
}

/* ── Brand header (also the way back to the marketing site) ── */
.auth-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
}
.auth-header a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-header .mark {
  width: 1.9rem; height: 1.9rem;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

/* ── Centred card ── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}
.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 18px 50px rgba(8, 14, 28, 0.16);
}
.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.auth-card .auth-sub {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

/* ── Fields ── */
.auth-field { margin-bottom: 1.1rem; }
.auth-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.auth-input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-input:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 1px;
  border-color: var(--brand-accent);
}
.auth-hint { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}
.auth-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand-primary); }

/* ── Button ── */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--brand-primary);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.auth-btn:hover { background: var(--brand-primary-hover); }
.auth-btn:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.auth-btn--ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}
.auth-btn--ghost:hover { background: var(--surface-alt); }
.auth-btn + .auth-btn { margin-top: 0.6rem; }

/* ── Messages ── */
.auth-error {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}
.auth-error ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.field-error { display: block; margin-top: 0.3rem; font-size: 0.88rem; color: var(--danger); }

/* ── Footer link row ── */
.auth-alt {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
}
.auth-alt a { color: var(--brand-accent); font-weight: 600; }

a { color: var(--brand-accent); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
