/* SMS HUB — Keycloak login theme
   Same visual language as the SMS HUB app: warm grey page, navy brand panel,
   white cards with a soft ring, pill buttons, 8px-radius inputs. */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --sh-navy: #253a6b;
  --sh-navy-hover: #1d2f57;
  --sh-blue: #3f76bd;
  --sh-link: #2f6fb3;
  --sh-page: #f7f7f5;
  --sh-surface: #ffffff;
  --sh-ring: #e8e8e5;
  --sh-border: #dcdcd8;
  --sh-track: #efefec;
  --sh-text: #1f2937;
  --sh-text-strong: #111827;
  --sh-text-label: #4b5563;
  --sh-text-muted: #6b7280;
  --sh-danger-bg: #fbeae6;
  --sh-danger: #a8351f;
  --sh-warning-bg: #fbf0dd;
  --sh-warning: #8a5a12;
  --sh-success-bg: #e5f1e2;
  --sh-success: #2f6a2a;
  --sh-info-bg: #edf3fa;
  --sh-info: #2f5a8f;
  --sh-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html, body { margin: 0; min-height: 100%; }

.sh-body {
  background: var(--sh-page);
  color: var(--sh-text);
  font-family: var(--sh-font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.sh-shell {
  display: flex;
  min-height: 100vh;
  padding: 12px;
  gap: 12px;
}

.sh-brand {
  position: relative;
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 28px;
  border-radius: 16px;
  background: var(--sh-navy);
  color: #ffffff;
  overflow: hidden;
}

.sh-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.sh-logo { display: block; width: 172px; height: auto; }
.sh-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sh-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.sh-brand-name span { color: #8db6ec; }

.sh-brand-pattern {
  position: absolute;
  right: -60px;
  bottom: 40px;
  width: 300px;
  height: auto;
  opacity: 0.07;
  pointer-events: none;
}

.sh-brand-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.sh-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.sh-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border-radius: 14px;
  background: var(--sh-surface);
  box-shadow: 0 0 0 1px var(--sh-ring), 0 1px 2px rgba(15, 23, 42, 0.04);
}

@media (max-width: 860px) {
  .sh-shell { flex-direction: column; }
  .sh-brand { flex: 0 0 auto; flex-direction: row; align-items: center; padding: 14px 18px; border-radius: 14px; }
  .sh-brand-pattern { display: none; }
  .sh-logo { width: 132px; }
  .sh-main { align-items: flex-start; padding: 24px 0; }
}

@media (max-width: 480px) {
  .sh-shell { padding: 8px; }
  .sh-card { padding: 24px 20px; }
  .sh-brand-foot { display: none; }
}

/* ---------- header ---------- */

.sh-header { margin-bottom: 22px; }

.sh-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--sh-navy);
}

.sh-user {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--sh-track);
}
.sh-user-avatar {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #d4e3f6; color: #2f5a8f;
  font-size: 11px; font-weight: 700;
}
.sh-user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.sh-user-restart { font-size: 12px; white-space: nowrap; }

/* ---------- locale ---------- */

.sh-locale {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 20px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sh-track);
}
.sh-locale-item {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--sh-text-label);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}
.sh-locale-item.is-active { background: #ffffff; color: var(--sh-text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }

/* ---------- form ---------- */

.sh-form, .sh-card form { display: flex; flex-direction: column; gap: 16px; }

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

.sh-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.sh-label { font-size: 12.5px; font-weight: 600; color: var(--sh-text-label); }

.sh-required { color: var(--sh-danger); }

.sh-input,
.sh-card input[type="text"],
.sh-card input[type="email"],
.sh-card input[type="password"],
.sh-card input[type="tel"],
.sh-card select,
.sh-card textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--sh-text-strong);
  font: 400 14px var(--sh-font);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.sh-card textarea { height: auto; min-height: 96px; padding: 10px 12px; }

.sh-input:hover { border-color: #c9c9c5; }

.sh-input:focus,
.sh-card input:focus,
.sh-card select:focus,
.sh-card textarea:focus {
  outline: none;
  border-color: var(--sh-blue);
  box-shadow: 0 0 0 3px rgba(63, 118, 189, 0.18);
}

.sh-field--error .sh-input,
.sh-input[aria-invalid="true"] {
  border-color: #d9736a;
}
.sh-field--error .sh-input:focus,
.sh-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(178, 58, 34, 0.15); }

.sh-field-error { font-size: 12.5px; font-weight: 500; color: var(--sh-danger); }

.sh-help { margin: 0; font-size: 12.5px; color: var(--sh-text-muted); }

.sh-input-group { position: relative; display: flex; }
.sh-input-group .sh-input { padding-right: 72px; }
.sh-pw-toggle {
  position: absolute; right: 6px; top: 6px; height: 28px; padding: 0 10px;
  border: 0; border-radius: 999px; background: var(--sh-track);
  color: var(--sh-text-label); font: 500 12px var(--sh-font); cursor: pointer;
}
.sh-pw-toggle::after { content: "Show"; }
.sh-pw-toggle[aria-label*="Hide"]::after, .sh-pw-toggle[aria-label*="hide"]::after { content: "Hide"; }

.sh-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }

.sh-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sh-text); cursor: pointer; }
.sh-checkbox, .sh-card input[type="checkbox"], .sh-card input[type="radio"] {
  width: 16px; height: 16px; margin: 0; accent-color: var(--sh-navy);
}

/* ---------- buttons ---------- */

.sh-btn,
.sh-card input[type="submit"],
.sh-card button[type="submit"]:not(.sh-link-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 14px var(--sh-font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.sh-btn--primary,
.sh-card input[type="submit"],
.sh-card button[type="submit"]:not(.sh-link-button):not(.sh-btn--secondary) {
  background: var(--sh-navy);
  color: #ffffff;
}
.sh-btn--primary:hover,
.sh-card input[type="submit"]:hover { background: var(--sh-navy-hover); }
.sh-btn--primary:disabled { opacity: 0.6; cursor: default; }

.sh-btn--secondary {
  background: #ffffff;
  border-color: var(--sh-border);
  color: #374151;
  font-weight: 500;
}
.sh-btn--secondary:hover { background: #f7f7f5; }

.sh-btn--block { width: 100%; }

.sh-btn:focus-visible,
.sh-link:focus-visible,
.sh-link-button:focus-visible,
.sh-locale-item:focus-visible {
  outline: 2px solid var(--sh-blue);
  outline-offset: 2px;
}

.sh-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.sh-link,
.sh-card a:not(.sh-btn):not(.sh-locale-item) {
  color: var(--sh-link);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}
.sh-link:hover, .sh-card a:not(.sh-btn):not(.sh-locale-item):hover { text-decoration: underline; text-underline-offset: 2px; }

.sh-link-button {
  padding: 0; border: 0; background: none;
  color: var(--sh-link); font: 500 12.5px var(--sh-font); cursor: pointer;
}
.sh-link-button:hover { text-decoration: underline; text-underline-offset: 2px; }

.sh-try-another { margin-top: 14px; text-align: center; }

/* ---------- social providers ---------- */

.sh-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--sh-text-muted);
}
.sh-divider::before, .sh-divider::after { content: ""; flex: 1; height: 1px; background: #ececea; }

.sh-providers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.sh-provider-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }

/* ---------- alerts ---------- */

.sh-alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 18px; padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px; line-height: 1.45; font-weight: 500;
  background: var(--sh-info-bg); color: var(--sh-info);
}
.sh-alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.sh-alert--error   { background: var(--sh-danger-bg);  color: var(--sh-danger); }
.sh-alert--warning { background: var(--sh-warning-bg); color: var(--sh-warning); }
.sh-alert--success { background: var(--sh-success-bg); color: var(--sh-success); }
.sh-alert--info    { background: var(--sh-info-bg);    color: var(--sh-info); }

/* ---------- footer info ---------- */

.sh-info-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid #efefec; text-align: center; }
.sh-info { margin: 0; font-size: 13px; color: var(--sh-text-muted); }

/* ---------- base pages: lists (select authenticator, OTP devices) ---------- */

.sh-list { display: flex; flex-direction: column; gap: 8px; }
.sh-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--sh-ring);
  color: var(--sh-text); text-decoration: none;
}
.sh-list-item:hover { background: #f7f7f5; }
.sh-list-title { font-size: 14px; font-weight: 600; }

.sh-codes { padding: 12px 16px 12px 36px; border-radius: 10px; background: var(--sh-track); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- base pages: "back to login" + submit rows ---------- */

.sh-field.sh-options,
.sh-field:has(> #kc-form-buttons) {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 14px;
  margin-top: 4px;
}
.sh-field.sh-options .sh-options,
.sh-field:has(> #kc-form-buttons) .sh-options { justify-content: center; }
.sh-actions .sh-btn,
.sh-actions input[type="submit"],
.sh-actions button[type="submit"] { width: 100%; }

.sh-info-wrap { font-size: 13px; line-height: 1.5; color: var(--sh-text-muted); }
.sh-card form + form { margin-top: 8px; }

/* ---- OTP: zes cijfervakjes ---- */
.sh-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sh-card .sh-otp-digit {
  width: 100%; min-width: 0; height: 52px; box-sizing: border-box; padding: 0;
  border: 1px solid var(--sh-border); border-radius: 10px; background: var(--sh-surface);
  font: 600 22px/1 var(--sh-font); color: var(--sh-text-strong); text-align: center;
  font-variant-numeric: tabular-nums; caret-color: var(--sh-blue);
  transition: border-color .12s, box-shadow .12s;
}
.sh-card .sh-otp-digit:focus { outline: none; border-color: var(--sh-blue); box-shadow: 0 0 0 3px rgba(63, 118, 189, 0.18); }
.sh-card .sh-otp-digit.is-filled { background: #fbfbfa; }
.sh-card .sh-otp--error .sh-otp-digit { border-color: #c0533a; }
.sh-card .sh-otp--error .sh-otp-digit:focus { box-shadow: 0 0 0 3px rgba(192, 83, 58, 0.16); }
.sh-otp.is-busy { opacity: .6; pointer-events: none; }
@media (max-width: 480px) { .sh-otp { gap: 6px; } .sh-card .sh-otp-digit { height: 48px; font-size: 20px; } }

.sh-otp-devices { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sh-track); align-self: flex-start; }
.sh-otp-device-input { position: absolute; opacity: 0; pointer-events: none; }
.sh-otp-device { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--sh-text-label); cursor: pointer; }
.sh-otp-device-input:checked + .sh-otp-device { background: var(--sh-surface); color: var(--sh-text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.sh-otp-device-input:focus-visible + .sh-otp-device { outline: 2px solid var(--sh-blue); outline-offset: 1px; }

/* ---- Brand: SPL (html[data-brand="spl"]) ---- */
.sh-only-spl, .sh-logo--spl { display: none; }
html[data-brand="spl"] .sh-only-sms, html[data-brand="spl"] .sh-logo--sms { display: none; }
html[data-brand="spl"] .sh-only-spl { display: inline; }
html[data-brand="spl"] img.sh-only-spl { display: block; }
html[data-brand="spl"] .sh-logo--spl { display: block; }
html[data-brand="spl"] {
  --sh-navy: #1c1c1e;
  --sh-navy-hover: #2c2c2f;
  --sh-blue: #e09a00;
  --sh-link: #9a5f00;
}
html[data-brand="spl"] .sh-otp-digit:focus,
html[data-brand="spl"] .sh-card input:focus,
html[data-brand="spl"] .sh-card select:focus,
html[data-brand="spl"] .sh-input:focus { box-shadow: 0 0 0 3px rgba(240, 164, 0, 0.22); }
.sh-brand-pattern--spl { width: 340px; right: -90px; bottom: 60px; }
html[data-brand="spl"] .sh-user-avatar { background: #fbefd6; color: #8a5a00; }
html[data-brand="spl"] .sh-brand-pattern--spl { opacity: 0.05; }
