/* BAV public submission — modern, responsive, CSP-safe styles.
   No inline styles or external fonts (strict CSP); system font stack only.
   Light + dark themes via prefers-color-scheme; motion respects user prefs. */

:root {
  color-scheme: light dark;

  /* Brand */
  --accent: #1f4e79;
  --accent-strong: #163a5a;
  --accent-contrast: #ffffff;
  --accent-ring: rgba(31, 78, 121, 0.32);

  /* Light surfaces */
  --bg: #eef1f5;
  --bg-glow: rgba(31, 78, 121, 0.10);
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --fg: #16202b;
  --muted: #5b6776;
  --line: #d9dfe7;
  --line-strong: #c2cad6;

  /* Feedback */
  --error: #b00020;
  --error-bg: #fdecef;
  --error-line: #f3c2cb;
  --success: #1f7a4d;

  /* Shape & motion */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 43, 0.06), 0 12px 32px rgba(16, 32, 43, 0.10);
  --ring-width: 3px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #5b9bd5;
    --accent-strong: #74acdf;
    --accent-contrast: #0c151f;
    --accent-ring: rgba(91, 155, 213, 0.40);

    --bg: #0c1219;
    --bg-glow: rgba(91, 155, 213, 0.14);
    --surface: #141d28;
    --surface-soft: #1b2733;
    --fg: #e6edf5;
    --muted: #9aa7b5;
    --line: #2a3744;
    --line-strong: #3a4858;

    --error: #ff8a9b;
    --error-bg: #2a161b;
    --error-line: #5c2630;
    --success: #6cd29b;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 32rem at 50% -8rem, var(--bg-glow), transparent 70%);
  background-repeat: no-repeat;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem) 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Keyboard accessibility: a single, consistent focus ring everywhere. */
:focus-visible {
  outline: var(--ring-width) solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.card {
  width: 100%;
  max-width: 33rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  margin: auto 0;
}

/* Page logo (above the card; theme-swapped asset via <picture>) */
.page-logo {
  display: block;
  width: clamp(150px, 40vw, 210px);
  height: auto;
  margin: 0 auto clamp(1.25rem, 4vw, 2rem);
}

/* Brand / trust eyebrow */
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.brand__icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}
.brand__label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Step indicator */
.steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.steps__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.steps__sep {
  flex: 1 1 auto;
  height: 2px;
  min-width: 0.75rem;
  background: var(--line);
  border-radius: 2px;
}
.steps__dot {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.steps__item.is-current { color: var(--fg); font-weight: 600; }
.steps__item.is-current .steps__dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}
.steps__item.is-done .steps__dot {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 26rem) {
  .steps__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

h1 {
  font-size: clamp(1.35rem, 4.5vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}
.subtitle { color: var(--muted); margin: 0 0 1.25rem; }
p { margin: 0.55rem 0; }
.lede { margin-bottom: 1.4rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Vendor identity block */
.vendor-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin: 0 0 1.5rem;
}
.vendor-box__label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.vendor-box__name { font-weight: 650; font-size: 1.08rem; }

/* Form */
form { margin: 0; }
.field { margin-top: 1.1rem; }
.field:first-of-type { margin-top: 0; }
label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.field__hint { margin: 0.35rem 0 0; }

input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 1rem; /* >=16px keeps iOS from zooming on focus */
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input[type="text"]::placeholder { color: var(--muted); opacity: 0.7; }
input[type="text"]:hover { border-color: var(--accent); }
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 var(--ring-width) var(--accent-ring);
}
/* Only flag invalid fields after the user has interacted with them. */
input[type="text"]:user-invalid {
  border-color: var(--error);
}
input[type="text"]:user-invalid:focus {
  box-shadow: 0 0 0 var(--ring-width) var(--error-bg);
}
.field--mono input[type="text"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

button {
  margin-top: 1.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), transform 0.05s var(--ease);
}
button:hover { background: var(--accent-strong); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Error alert */
.alert {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--error-bg);
  border: 1px solid var(--error-line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin: 0 0 1.25rem;
  color: var(--error);
  font-size: 0.92rem;
  font-weight: 500;
}
.alert__icon { flex: none; width: 1.2rem; height: 1.2rem; margin-top: 0.1rem; }

/* Status (thanks / error pages) */
.status-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.9rem;
}
.status-icon--ok { color: var(--success); }
.status-icon--warn { color: var(--error); }

/* Footer */
.page-footer {
  width: 100%;
  max-width: 33rem;
  margin-top: 1.25rem;
  padding: 0 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.page-footer__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
}
.page-footer__icon { flex: none; width: 0.95rem; height: 0.95rem; }
.page-footer__link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-footer__link:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
