:root {
  --accent: #2F80ED;
  --accent-strong: #256AD1;
  --accent-ring: rgba(47, 128, 237, 0.25);
  --bg: #EDEFF2;
  --panel: #FFFFFF;
  --border: #E4E8ED;
  --text: #1E2430;
  --muted: #5F6872;
  --danger: #C0392B;
  --danger-soft: #F7E4E1;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must win even over flex containers (.code-row). */
[hidden] {
  display: none !important;
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(20, 30, 50, 0.12);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}

.auth-brand-text {
  text-align: left;
  line-height: 1.2;
}

.auth-brand-text strong {
  display: block;
  font-size: 15px;
}

.auth-brand-text span {
  font-size: 12px;
  color: var(--muted);
}

.auth-heading {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.auth-sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-error {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.code-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.code-box {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.code-fallback,
.backup-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  letter-spacing: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.code-fallback.is-enhanced {
  display: none;
}

.code-box:focus,
.code-fallback:focus,
.backup-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.auth-noscript {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.trust-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-footer strong {
  font-weight: 600;
  color: var(--text);
}
