:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --ink: #182236;
  --muted: #67748a;
  --line: #d9e1ec;
  --accent: #1769e0;
  --accent-dark: #0f4faa;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { align-items: center; background: #101827; color: white; display: flex; justify-content: space-between; min-height: 72px; padding: 12px 28px; }
.brand { align-items: center; color: white; display: flex; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { align-items: center; background: #2563eb; border-radius: 7px; color: white; display: inline-flex; font-size: 20px; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.brand-mark svg { width: 21px; height: 21px; }
.brand-mark.has-site-image { background: transparent; }
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand small { color: #aab3c2; font-size: 12px; }
.account-nav { align-items: center; display: flex; gap: 18px; }
.account-nav a, .text-button { color: #e5e7eb; }
.account-nav form { margin: 0; }
.text-button { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }

.page-main { margin: 0 auto; max-width: 1180px; padding: 32px 24px 56px; }
.page-heading, .section-heading { align-items: center; display: flex; gap: 20px; justify-content: space-between; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
h1 { font-size: 30px; letter-spacing: 0; margin: 0; }
h2 { font-size: 20px; letter-spacing: 0; margin: 0; }
.page-heading p, .intro { color: var(--muted); margin: 6px 0 0; }
.eyebrow { color: var(--muted); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0; margin-bottom: 5px; text-transform: uppercase; }

.login-layout { background: white; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr); min-height: 100vh; }
.login-visual { min-height: 100vh; overflow: hidden; position: relative; }
.login-visual img { height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.login-visual-shade { background: rgba(9, 16, 29, .38); inset: 0; position: absolute; }
.visual-caption { color: white; left: 36px; max-width: 520px; position: absolute; top: 42px; z-index: 1; }
.visual-caption .eyebrow { color: #d8ebe9; }
.visual-caption h2 { font-size: 25px; margin: 8px 0; }
.visual-caption p { color: #e0e7eb; margin: 0; max-width: 460px; }
.login-panel { align-items: center; display: flex; justify-content: center; padding: 48px; }
.login-form-wrap { max-width: 420px; width: 100%; }
.login-form-wrap h1 { font-size: 28px; }
.login-feature-image { display: block; width: calc(200% / 3); height: auto; margin: 0 auto 24px; object-fit: contain; }
.registration-form-wrap { max-width: 500px; }
.name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-form { display: grid; gap: 16px; margin-top: 26px; }
label { color: var(--muted); display: grid; font-size: 13px; font-weight: 700; gap: 6px; }
input, button, .button { border: 1px solid var(--line); border-radius: 6px; font: inherit; min-height: 42px; padding: 9px 11px; }
input { background: white; color: var(--ink); font-weight: 400; width: 100%; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); outline: 0; }
button, .button { align-items: center; cursor: pointer; display: inline-flex; font-weight: 750; justify-content: center; }
button:disabled { cursor: wait; opacity: .7; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); text-decoration: none; }
.secondary { background: #edf3fc; border-color: #cad8ed; color: #174f9f; }
.block { width: 100%; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 13px; }
.consent-field { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; color: var(--ink); font-weight: 500; line-height: 19px; }
.consent-field input { width: 18px; min-height: 18px; height: 18px; margin: 1px 0 0; padding: 0; }
.auth-result-page, .legal-page { min-height: 100vh; padding: 48px 22px; display: grid; place-items: center; background: var(--surface, #f4f7fa); }
.auth-result-card { width: min(100%, 560px); text-align: center; }
.auth-result-card h1 { font-size: 24px; }
.auth-result-card p { color: var(--muted); line-height: 21px; }
.auth-result-card .form-actions { margin-top: 24px; justify-content: center; }
.result-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; }
.result-icon.success { background: #e5f6ec; color: #146c3b; }
.result-icon.error { background: #fff0ef; color: #9b2d26; }
.result-icon svg { width: 22px; height: 22px; }
.legal-document { width: min(100%, 760px); }
.legal-document h1 { font-size: 26px; }
.legal-document h2 { margin: 24px 0 6px; font-size: 17px; }
.legal-document p { color: var(--muted); line-height: 22px; }
.legal-document .form-actions { margin-top: 28px; }

.notice { border: 1px solid var(--line); border-radius: 7px; margin-top: 18px; padding: 11px 13px; }
.notice.error { background: #fff3f2; border-color: #ffc7c2; color: #8f1d15; }
.notice.warning { background: var(--tiger-soft-warning, #fff8e7); border-color: #f0cf77; color: #755400; }
.notice.success { background: #edf9f1; border-color: #bce5c9; color: #146c3b; }

.identity-band { background: white; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin: 28px 0 36px; padding: 22px 0; }
.avatar-settings { margin-top: 28px; padding: 18px 20px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.avatar-preview { width: 64px; height: 64px; flex-basis: 64px; font-size: 18px; }
.avatar-settings-copy h2, .avatar-settings-copy p { margin: 0; }
.avatar-settings-copy p { margin-top: 3px; color: var(--tiger-card-muted-text); font-size: var(--tiger-small-size); }
.avatar-actions { display: flex; align-items: center; gap: 8px; }
.avatar-actions form { margin: 0; }
.avatar-upload { gap: 7px; }
.avatar-upload input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.avatar-actions svg { width: 16px; height: 16px; }
.identity-band dl { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.identity-band dl div { border-left: 2px solid #e5ebf3; padding-left: 14px; }
dt { color: var(--muted); font-size: 12px; font-weight: 700; }
dd { margin: 7px 0 0; overflow-wrap: anywhere; }
.role-tag, .current-badge, .count { background: #eaf1fb; border-radius: 999px; color: #31547f; display: inline-flex; font-size: 12px; font-weight: 750; margin: 1px 3px 1px 0; padding: 5px 9px; }
.count { min-width: 30px; justify-content: center; }
.session-list { display: grid; gap: 8px; margin-top: 14px; }
.session-row { align-items: center; background: white; border: 1px solid var(--line); border-radius: 7px; display: flex; gap: 20px; justify-content: space-between; padding: 14px 16px; }
.session-row strong, .session-row span { display: block; }
.session-row span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.session-row form { margin: 0; }
.danger.ghost { background: white; border-color: #f0b8b3; color: var(--danger); }
.empty { color: var(--muted); }

.password-layout { align-items: start; display: grid; gap: 64px; grid-template-columns: minmax(260px, .7fr) minmax(420px, 1fr); margin: 52px auto; max-width: 920px; }
.form-surface { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.form-surface .auth-form { margin-top: 0; }
.empty-state { margin: 80px auto; max-width: 560px; text-align: center; }
.empty-state p { color: var(--muted); }
.status-code { color: var(--danger); font-size: 52px; font-weight: 800; }
.login-form-wrap .primary { gap: 8px; background: #116466; border-color: #116466; }
.login-form-wrap .primary:hover { background: #0b5052; }
.login-footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.logout-surface { max-width: 620px; margin: 70px auto; padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.logout-surface .intro { max-width: 500px; margin: 10px auto 24px; }
.logout-surface .form-actions { justify-content: center; }
.logout-icon { width: 48px; height: 48px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #e6f2f1; color: #116466; }
.logout-icon svg { width: 22px; height: 22px; }
.form-actions button, .form-actions .button { gap: 7px; }

@media (max-width: 800px) {
  .login-layout { display: block; }
  .login-visual { min-height: 180px; }
  .visual-caption { display: none; }
  .login-panel { padding: 34px 22px; }
  .name-fields { grid-template-columns: 1fr; }
  .auth-links { align-items: flex-start; flex-direction: column; }
  .site-header { padding: 12px 16px; }
  .page-main { padding: 24px 16px 40px; }
  .page-heading, .section-heading, .session-row { align-items: stretch; flex-direction: column; }
  .avatar-settings { grid-template-columns: 56px minmax(0, 1fr); }
  .avatar-preview { width: 56px; height: 56px; flex-basis: 56px; }
  .avatar-actions { grid-column: 1 / -1; }
  .identity-band dl, .password-layout { grid-template-columns: 1fr; }
  .password-layout { gap: 24px; margin: 24px 0; }
  .account-nav > a { display: none; }
  .logout-surface { margin: 24px auto; padding: 24px 18px; }
}
