:root {
  color-scheme: light;
  --bg: #e4e7ec;
  --surface: #e4e7ec;
  --shadow-light: #fff;
  --shadow-dark: #a8afbc;
  --text: #2a2e35;
  --text-muted: #4b5563;
  --accent: #3d5a80;
  --accent-dark: #2c4160;
  --brand-navy: #1f2a44;
  --brand-amber: #d99a2b;
  --error: #a93226;
  --focus: #1d4ed8;
  --band-low: #f08a6c;
  --band-mid: #f5d98c;
  --band-high: #8fcf9e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.numeric, input[type="number"] { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topbar {
  min-height: 80px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
}

.brand { display: flex; border-radius: 10px; }
.brand img { width: 140px; height: 48px; object-fit: contain; }
.topbar > span { color: var(--text-muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 12px; }
main { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }

.card {
  background: var(--surface);
  border: 0;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

.narrow { max-width: 430px; margin: 6vh auto 0; }
.login-mark { display: block; width: 88px; height: 88px; margin: -8px 0 16px -16px; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 26px; }
.heading { margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: var(--brand-navy); font-size: 22px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 22px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.muted, .hint { color: var(--text-muted); line-height: 1.55; }
.hint { font-size: 13px; margin-bottom: 18px; }

form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-columns { display: grid; grid-template-columns: .7fr 1fr 1fr; gap: 14px; }

button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  color: #fff;
  background: var(--accent);
  box-shadow: 5px 5px 12px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  font-weight: 600;
}
button:hover { background: var(--accent-dark); }
button:active { box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light); }
button:disabled { opacity: .65; cursor: wait; }
button.secondary { color: var(--accent); background: var(--surface); }
button.secondary:hover { color: var(--accent-dark); }
button.small { min-height: 36px; padding: 8px 14px; font-size: 13px; }
.message {
  padding: 14px 16px;
  margin-bottom: 24px;
  border-radius: 10px;
  background: var(--band-high);
  color: #14471f;
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}
.message.error { background: var(--band-low); color: #5a1f10; }
.providers-card { margin-top: 26px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; }
.providers { display: grid; gap: 16px; margin-top: 22px; }
.provider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 5px 5px 12px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}
.provider strong, .provider span { display: block; }
.provider span { margin-top: 6px; color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
.provider .badge {
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.provider .badge.active { background: var(--band-high); color: #14471f; }
.provider .badge.inactive { background: rgb(168 175 188 / 40%); color: var(--text); }
.empty { color: var(--text-muted); margin: 0; }
.result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  white-space: pre-wrap;
}

body.high-contrast {
  --bg: #fff;
  --surface: #fff;
  --text: #111;
  --text-muted: #333;
  --accent: #1d4ed8;
  --accent-dark: #172554;
  --shadow-light: transparent;
  --shadow-dark: transparent;
}
.high-contrast .card,
.high-contrast .provider,
.high-contrast .message,
.high-contrast .result,
.high-contrast button,
.high-contrast input,
.high-contrast .topbar { border: 1px solid var(--text); }
.high-contrast .message { color: #111; }
.high-contrast .message.error { color: #111; }

@media (max-width: 900px) {
  .grid, .two-columns, .three-columns { grid-template-columns: 1fr; }
  .topbar > span { display: none; }
  .topbar { gap: 12px; padding: 12px 16px; }
  .brand img { width: 112px; }
  .topbar-actions { gap: 8px; }
  main { padding: 28px 18px 48px; }
  .card { padding: 22px; }
  button.small { min-height: 44px; }
}

@media (max-width: 560px) {
  .provider { grid-template-columns: 1fr; }
  .provider button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .topbar-actions #contrast { max-width: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
