/*
 * ACCI sign-in pages. The same tokens as the website (apps/web globals.css):
 * navy, emerald and gold, system fonts, visible focus (WCAG 2.2 AA).
 */
:root {
  --navy-50: #f3f4fb;
  --navy-100: #e5e7f4;
  --navy-200: #c1c6e5;
  --navy-500: #3a4490;
  --navy-600: #272f6f;
  --navy-700: #1a2056;
  --navy-900: #0a0d2e;
  --emerald-500: #10b981;
  --emerald-700: #047857;
  --gold-400: #f3c969;
  --red-50: #fef2f2;
  --red-700: #b91c1c;
  --amber-50: #fffbeb;
  --amber-800: #92400e;
  --green-50: #ecfdf5;
  --radius: 10px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body.acci {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f7f6fc 60%, #efeaf9 100%);
  color: var(--navy-900);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Inter,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 2px;
}

.acci-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 16px;
  min-height: 100vh;
}

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

.acci-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--navy-900);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.acci-mark-alt {
  color: var(--emerald-500);
}

.acci-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.acci-brand-name {
  font-weight: 700;
  font-size: 15px;
}

.acci-brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-500);
}

.acci-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 8px 24px -10px rgba(15, 23, 42, 0.12);
}

@media (max-width: 480px) {
  .acci-card {
    padding: 24px 18px;
  }
}

.acci-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.acci-lede,
.instruction {
  margin: 0 0 20px;
  color: var(--navy-700);
}

.acci-who {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.acci-who a {
  font-weight: 400;
}

a {
  color: var(--navy-600);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy-900);
}

.acci-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.acci-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acci-label,
label {
  font-weight: 600;
  font-size: 15px;
}

.acci-optional {
  font-weight: 400;
  color: var(--navy-500);
}

.acci-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--navy-200);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy-900);
  font: inherit;
}

.acci-input:focus-visible,
input:focus-visible,
select:focus-visible {
  border-color: var(--navy-600);
}

.acci-input[readonly] {
  background: var(--navy-50);
  color: var(--navy-700);
}

.acci-input[aria-invalid="true"] {
  border-color: var(--red-700);
}

.acci-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.12em;
}

.acci-hint {
  margin: 0;
  font-size: 14px;
  color: var(--navy-500);
}

.acci-field-error {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--red-700);
}

.acci-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.acci-check label {
  font-weight: 400;
}

.acci-checkbox,
.acci-radio,
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--navy-600);
  flex: none;
}

.acci-button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.acci-button-primary,
input[type="submit"] {
  background: var(--navy-600);
  color: #fff;
}

.acci-button-primary:hover,
input[type="submit"]:hover {
  background: var(--navy-700);
}

.acci-button-secondary {
  background: #fff;
  border-color: var(--navy-200);
  color: var(--navy-700);
}

.acci-button-secondary:hover {
  background: var(--navy-50);
}

.acci-button-block {
  width: 100%;
}

.acci-link-button {
  align-self: center;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--navy-600);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.acci-more {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 8px;
}

.acci-another-way {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.acci-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--navy-50);
  color: var(--navy-900);
  font-size: 15px;
}

.acci-alert p {
  margin: 4px 0 0;
}

.acci-alert-error {
  background: var(--red-50);
  color: var(--red-700);
  font-weight: 600;
}

.acci-alert-warning {
  background: var(--amber-50);
  color: var(--amber-800);
}

.acci-alert-success {
  background: var(--green-50);
  color: var(--emerald-700);
}

.acci-info {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--navy-100);
  font-size: 15px;
  color: var(--navy-700);
}

.acci-info p {
  margin: 0;
}

.acci-choices {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acci-recovery-codes {
  margin: 0 0 16px;
  padding: 16px 16px 16px 40px;
  border-radius: var(--radius);
  background: var(--navy-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  columns: 2;
}

.acci-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

#kc-totp-settings {
  padding-left: 20px;
}

#kc-totp-settings li {
  margin-bottom: 12px;
}

#kc-totp-secret-qr-code {
  display: block;
  width: 200px;
  height: 200px;
  margin: 8px 0;
  image-rendering: pixelated;
}

#kc-totp-secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.acci-footer {
  max-width: 440px;
  text-align: center;
  font-size: 14px;
  color: var(--navy-500);
}

.acci-footer p {
  margin: 4px 0;
}

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

@media print {
  body.acci {
    background: #fff;
  }

  .acci-brand,
  .acci-footer,
  .acci-recovery-actions,
  form,
  .acci-alert {
    display: none !important;
  }

  .acci-card {
    box-shadow: none;
  }
}
