:root {
  --navy: #0B1F3A;
  --navy-2: #183251;
  --green: #3FA535;
  --green-dark: #2E7D27;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --text: #172033;
  --muted: #667085;
  --line: #E4E7EC;
  --danger: #B42318;
  --warning-bg: #FFF8E6;
  --success-bg: #ECFDF3;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(11, 31, 58, 0.08);
  --max: 920px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

button, input, select { font: inherit; }

button { cursor: pointer; }

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.topbar {
  background: var(--navy);
  color: white;
  border-bottom: 3px solid var(--green);
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topnav a {
  color: white;
  text-decoration: none;
  font-size: 0.94rem;
}

.topnav a:hover { text-decoration: underline; }

.page {
  padding: 32px 0 56px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-wrap {
  width: min(100%, 430px);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 28px;
}

.card { padding: 22px; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.2;
  color: var(--navy);
}

h2 {
  margin-bottom: 12px;
  font-size: 1.22rem;
  color: var(--navy);
}

.subtle, .helper {
  color: var(--muted);
}

.subtle { margin-bottom: 24px; }
.helper { font-size: 0.88rem; }

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  font-size: 0.93rem;
  font-weight: 650;
}

input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #CBD2DC;
  border-radius: 10px;
  background: white;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 165, 53, 0.14);
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 750;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-primary:hover { background: var(--green-dark); }

.btn-secondary {
  background: #EEF2F6;
  color: var(--navy);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-danger {
  background: #FEF3F2;
  color: var(--danger);
  border: 1px solid #FECDCA;
}

.full { width: 100%; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stack { display: grid; gap: 16px; }

.auth-switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notice {
  display: none;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.notice.show { display: block; }

.notice.error {
  color: var(--danger);
  background: #FEF3F2;
  border-color: #FECDCA;
}

.notice.success {
  color: #067647;
  background: var(--success-bg);
  border-color: #ABEFC6;
}

.notice.info {
  color: var(--navy);
  background: #EFF6FF;
  border-color: #B2DDFF;
}

.page-heading {
  margin-bottom: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: inline-flex;
  min-width: 58px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #CBD2DC;
  border-radius: 10px;
  background: white;
  font-weight: 650;
}

.choice input:checked + span {
  border-color: var(--green);
  background: #F0F9EF;
  color: var(--green-dark);
  box-shadow: 0 0 0 2px rgba(63,165,53,.10);
}

.practice-card {
  display: grid;
  gap: 20px;
}

.question-card {
  display: grid;
  gap: 18px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #F2F4F7;
}

.question-text {
  font-size: 1.08rem;
  line-height: 1.7;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.option-label {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #EEF2F6;
  color: var(--navy);
  font-weight: 800;
}

.solution {
  display: none;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.solution.show { display: block; }

.account-list {
  display: grid;
  gap: 0;
}

.account-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.account-item:last-child { border-bottom: 0; }

.account-key {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
}

.skeleton {
  background: linear-gradient(90deg, #F2F4F7 25%, #EAECF0 37%, #F2F4F7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.turnstile-slot:empty { display: none; }

.footer-note {
  margin-top: 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.hidden { display: none !important; }

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }

  .topbar-inner {
    min-height: 58px;
  }

  .topnav a:not(.keep-mobile) { display: none; }

  .auth-card { padding: 22px; }

  .account-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .row-between.mobile-stack {
    align-items: stretch;
    flex-direction: column;
  }
}
