:root {
  --auth-bg: #edf4fa;
  --auth-card: rgba(255,255,255,.96);
  --auth-panel: #f4f8fb;
  --auth-text: #08243b;
  --auth-muted: #587188;
  --auth-line: rgba(8,49,79,.14);
  --auth-blue: #1769e0;
  --auth-blue-soft: #e8f1ff;
  --auth-green: #18754a;
  --auth-shadow: 0 24px 70px rgba(18,58,89,.16);
}
[data-auth-theme="dark"] {
  color-scheme: dark;
  --auth-bg: #061523;
  --auth-card: rgba(12,33,53,.97);
  --auth-panel: #122b41;
  --auth-text: #f4f9fd;
  --auth-muted: #a6bac9;
  --auth-line: rgba(185,219,240,.17);
  --auth-blue: #69b9ff;
  --auth-blue-soft: #143b5d;
  --auth-green: #8ee5b7;
  --auth-shadow: 0 26px 80px rgba(0,4,10,.42);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input { font: inherit; }
.auth-shell { min-height: 100dvh; margin: 0; padding: max(28px, env(safe-area-inset-top)) clamp(16px, 5vw, 40px) max(30px, env(safe-area-inset-bottom)); display: grid; place-items: center; background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--auth-blue) 14%, transparent), transparent 42%), var(--auth-bg); color: var(--auth-text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; transition: background .25s, color .25s; }
.auth-card { width: min(100%, 480px); padding: 28px clamp(24px, 7vw, 42px) 32px; position: relative; border: 1px solid var(--auth-line); border-radius: 24px; background: var(--auth-card); box-shadow: var(--auth-shadow); backdrop-filter: blur(18px); }
.auth-theme-toggle { min-width: 92px; height: 38px; margin-left: auto; padding: 0 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--auth-line); border-radius: 999px; background: var(--auth-panel); color: var(--auth-muted); cursor: pointer; }
.theme-sun, .theme-moon { font-size: 17px; line-height: 1; }
.theme-track { width: 34px; height: 20px; padding: 2px; display: block; border-radius: 999px; background: color-mix(in srgb, var(--auth-blue) 20%, var(--auth-line)); }
.theme-track span { width: 16px; height: 16px; display: block; border-radius: 50%; background: var(--auth-blue); transition: transform .22s; }
[data-auth-theme="dark"] .theme-track span { transform: translateX(14px); }
.auth-brand { margin: 16px 0 26px; display: flex; justify-content: center; }
.auth-logo { width: min(78%, 245px); height: auto; display: block; }
.auth-copy { text-align: center; }
.auth-eyebrow { display: block; margin-bottom: 8px; color: var(--auth-blue); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 10px; font-size: clamp(27px, 7vw, 34px); line-height: 1.1; letter-spacing: -.03em; }
.auth-card p { margin-top: 0; color: var(--auth-muted); font-size: 15px; line-height: 1.5; }
.auth-users { margin: 28px 0 18px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.auth-user { min-height: 72px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--auth-line); border-radius: 15px; background: var(--auth-panel); color: var(--auth-text); cursor: pointer; transition: transform .18s, border-color .18s, background .18s; }
.auth-user:active { transform: scale(.98); }
.auth-user span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--auth-blue) 14%, var(--auth-panel)); color: var(--auth-blue); font-size: 18px; font-weight: 900; }
.auth-user strong { font-size: 17px; }
.auth-user.active { border-color: var(--auth-blue); background: var(--auth-blue-soft); color: var(--auth-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-blue) 12%, transparent); }
.pin-change-grid { display: grid; gap: 12px; margin-top: 26px; }
.pin-panel { padding: 16px; border: 1px solid var(--auth-line); border-radius: 15px; background: var(--auth-panel); }
.pin-label { display: block; margin: 0 0 9px; color: var(--auth-text); font-size: 16px; font-weight: 850; }
.pin-input { width: 100%; height: 58px; padding: 0 14px; border: 1px solid var(--auth-line); border-radius: 11px; outline: none; background: var(--auth-card); color: var(--auth-text); font-size: 25px; font-weight: 800; letter-spacing: .42em; text-align: center; -webkit-text-security: disc; transition: border-color .18s, box-shadow .18s; }
.pin-input:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-blue) 13%, transparent); }
.pin-input::placeholder { color: color-mix(in srgb, var(--auth-muted) 55%, transparent); }
.auth-identifier input { width: 100%; height: 52px; padding: 0 14px; border: 1px solid var(--auth-line); border-radius: 11px; outline: none; background: var(--auth-card); color: var(--auth-text); font-size: 18px; font-weight: 700; text-align: center; }
.auth-identifier input:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-blue) 13%, transparent); }
.pin-panel small { display: block; margin-top: 8px; color: var(--auth-muted); font-size: 13px; line-height: 1.4; text-align: center; }
.auth-submit { width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #1769e0, #0954bd); color: #fff; box-shadow: 0 10px 24px rgba(23,105,224,.24); font-size: 17px; font-weight: 900; cursor: pointer; }
[data-auth-theme="dark"] .auth-submit { background: linear-gradient(135deg, #69b9ff, #3497e9); color: #06213a; }
.auth-passkey-login { width: 100%; min-height: 48px; margin-top: 10px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-panel); color: var(--auth-blue); font-size: 15px; font-weight: 850; cursor: pointer; }
.auth-passkey-login span { margin-right: 5px; font-size: 20px; vertical-align: -1px; }
.auth-error { min-height: 24px; margin: 13px 0 0 !important; color: #c43d3d !important; font-size: 14px !important; font-weight: 800; text-align: center; }
.auth-protection { margin-top: 14px; padding: 10px; display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px; border: 1px solid color-mix(in srgb, var(--auth-green) 22%, var(--auth-line)); border-radius: 11px; background: color-mix(in srgb, var(--auth-green) 8%, var(--auth-panel)); }
.auth-protection > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--auth-green); color: var(--auth-card); font-size: 12px; font-weight: 900; }
.auth-protection p { margin: 0; }
.auth-protection strong, .auth-protection small { display: block; }
.auth-protection strong { color: var(--auth-text); font-size: 12px; line-height: 1.3; }
.auth-protection small { margin-top: 3px; color: var(--auth-muted); font-size: 10.5px; line-height: 1.4; }
.auth-login-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(3,14,25,.7); backdrop-filter: blur(7px); }
.auth-login-modal { position: fixed; left: 50%; top: 50%; z-index: 1101; width: min(calc(100% - 28px), 410px); max-height: min(92dvh, 690px); overflow: auto; padding: 28px clamp(22px, 6vw, 34px) 24px; transform: translate(-50%, -50%); border: 1px solid var(--auth-line); border-radius: 22px; background: var(--auth-card); color: var(--auth-text); box-shadow: 0 30px 90px rgba(0,5,12,.42); text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.auth-login-close { position: absolute; right: 14px; top: 12px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--auth-panel); color: var(--auth-muted); font-size: 25px; cursor: pointer; }
.auth-login-avatar { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--auth-blue-soft); color: var(--auth-blue); font-size: 24px; font-weight: 900; }
.auth-login-kicker { margin: 0 0 5px !important; color: var(--auth-blue) !important; font-size: 11px !important; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.auth-login-modal h2 { margin: 0; font-size: 27px; line-height: 1.15; }
.auth-login-help { margin: 8px 0 18px !important; color: var(--auth-muted) !important; font-size: 14px !important; }
.auth-login-modal .auth-passkey-login { min-height: 54px; margin-top: 0; border-color: color-mix(in srgb, var(--auth-blue) 35%, var(--auth-line)); background: var(--auth-blue-soft); font-size: 16px; }
.auth-login-divider { margin: 16px 0; display: flex; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.auth-login-divider::before, .auth-login-divider::after { content: ""; height: 1px; flex: 1; background: var(--auth-line); }
.auth-login-modal .pin-panel { padding: 14px; text-align: left; }
.auth-login-modal .pin-label { font-size: 14px; }
.auth-login-modal .auth-submit { min-height: 52px; margin-top: 12px; }
.passkey-setup-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(3,14,25,.68); backdrop-filter: blur(6px); }
.passkey-setup { position: fixed; left: 50%; top: 50%; z-index: 1001; width: min(calc(100% - 28px), 420px); padding: 26px; transform: translate(-50%, -50%); border: 1px solid var(--auth-line); border-radius: 20px; background: var(--auth-card); color: var(--auth-text); box-shadow: var(--auth-shadow); text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.passkey-symbol { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--auth-blue-soft); color: var(--auth-blue); font-size: 33px; font-weight: 900; }
.passkey-setup h2 { margin: 0 0 9px; font-size: 24px; }
.passkey-setup > p:not(.auth-error) { margin: 0; color: var(--auth-muted); font-size: 15px; line-height: 1.5; }
.passkey-setup .auth-submit { margin-top: 20px; }
.passkey-later { min-height: 44px; margin-top: 6px; padding: 0 18px; border: 0; background: transparent; color: var(--auth-muted); font-weight: 800; cursor: pointer; }
.auth-bar { width: min(100%,560px); margin: 0 auto; min-height: 50px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.12); background: #102a56; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; }
.auth-bar-actions { display: flex; align-items: center; gap: 7px; }
.auth-bar a, .auth-bar button { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; background: transparent; color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.security-shell { min-height: 100dvh; padding: 24px 18px 60px; background: var(--auth-bg); color: var(--auth-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.security-wrap { width: min(100%,760px); margin: auto; }
.security-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:24px; }
.security-head a { color:var(--auth-blue); font-weight:800; text-decoration:none; }
.security-card { margin-bottom:14px; padding:18px; border:1px solid var(--auth-line); border-radius:14px; background:var(--auth-card); }
.security-user { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; }
.security-user small { display:block; margin-top:5px; color:var(--auth-muted); }
.security-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.security-actions button { min-height:38px; padding:0 11px; border:1px solid var(--auth-line); border-radius:8px; background:var(--auth-panel); color:var(--auth-text); font-weight:800; cursor:pointer; }
.activity-item { padding:11px 0; border-bottom:1px solid var(--auth-line); font-size:14px; }
.activity-item:last-child { border-bottom:0; }
@media (max-width: 520px) {
  .auth-shell { padding-left: 14px; padding-right: 14px; }
  .auth-card { padding: 22px 20px 26px; border-radius: 20px; }
  .auth-logo { width: min(82%, 225px); }
  .auth-users { gap: 7px; }
  .auth-user { min-height: 90px; }
  .auth-user strong { font-size: 16px; }
  .auth-login-modal { padding: 24px 20px 20px; border-radius: 19px; }
  .security-user { grid-template-columns: 1fr; }
  .security-actions { justify-content: flex-start; }
}
