:root {
  color-scheme: dark;
  --bg: #100e15; --deep: #0c0a11; --card: #1d1923; --surface: #26212e;
  --border: #3b3444; --fg: #f8f4fc; --muted: #b8afc4; --accent: #efb23f;
  --bright: #f7cf6b; --ink: #241a08; --accent-text: #efb23f; --tint: #efb23f0d;
  --error-bg: #361d2b; --error-fg: #ffd4df; --warning-bg: #352817; --warning-fg: #ffe2ae;
  font: 500 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--fg);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f5ef; --deep: #fffaf0; --card: #fff; --surface: #f5f0e6;
  --border: #ded8ce; --fg: #2e2234; --muted: #706675; --accent-text: #825200;
  --error-bg: #fff0f3; --error-fg: #922342; --warning-bg: #fff1d5; --warning-fg: #744900;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100dvh; padding: max(32px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(32px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left)); display: flex; flex-direction: column; gap:24px; background:radial-gradient(ellipse at 8% 0%,#efb23f0b,transparent 52%),radial-gradient(ellipse at 100% 100%,#83547813,transparent 55%),var(--bg); }
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 54px; padding: 13px 18px; cursor: pointer; border-radius: 15px; border: 1px solid transparent; font-weight: 750; touch-action: manipulation; }
button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 4px; }
[hidden] { display: none !important; }
.topbar { display: flex; align-items: center; justify-content: center; width:100%; max-width:440px; margin:auto auto 0; padding:0; flex:none; }
.brand { display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; border-radius: 10px; }
.brand img { display: block; width: 128px; height: 124px; object-fit: contain; }
.brand .brand-color { display: none; }
html[data-theme="light"] .brand .brand-color { display: block; }
html[data-theme="light"] .brand .brand-white { display: none; }
.theme-toggle { position:absolute; top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right)); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; background: transparent; color: var(--muted); border: 0; border-radius: 12px; }
.theme-toggle:hover { background: var(--tint); color: var(--fg); }
.access-layout { max-width:440px; width:100%; margin:0 auto auto; padding:0; }
.access-card { position:relative; overflow:hidden; border:1px solid var(--border); border-radius:24px; background:var(--card); padding:32px; min-width:0; box-shadow:0 24px 72px #00000018; }
.access-card::before { content:"";position:absolute;top:0;left:24%;right:24%;height:2px;background:linear-gradient(90deg,transparent,var(--accent),transparent); }
#step-label { display:block;font-size:10px;font-weight:750;letter-spacing:.17em;text-align:center;color:var(--accent-text);margin:0 0 10px; }
.access-card h1 { font-size:1.75rem; font-weight:750; line-height:1.2; letter-spacing:-.035em; margin-bottom:10px; text-align:center; }
#form-description { text-align:center;max-width:290px;margin-inline:auto;line-height:1.6; }
.muted { color: var(--muted); font-size: .93rem; }
form > label { display: block; margin-top: 24px; margin-bottom: 9px; font-size: .85rem; font-weight: 750; }
input:not([type="radio"]) { width:100%; min-height:54px; border:1px solid var(--border); border-radius:12px; color:var(--fg); background:var(--bg); padding:14px 16px; font-size:1rem; transition:border-color .15s,box-shadow .15s; }
input:focus-visible { outline:none;border-color:var(--accent-text);box-shadow:0 0 0 3px #efb23f22; }
input::placeholder { color: var(--muted); opacity: .8; }
.password-field { display: flex; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.password-field:focus-within { border-color:var(--accent-text);box-shadow:0 0 0 3px #efb23f22; }
.password-field input { border: 0; background: transparent; min-width: 0; }
.password-field input:focus-visible { box-shadow:none; }
.password-field .reveal { color: var(--accent-text); font-size: .79rem; padding-inline: 12px; min-width: 70px; border-radius: 10px; background: transparent; flex-shrink: 0; }
.primary { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; background: linear-gradient(180deg, var(--bright), var(--accent)); color: var(--ink); box-shadow: 0 8px 24px #efb23f20; margin-top: 28px; }
.primary span { font-size: 1.2rem; }
.primary:not(:disabled):hover { filter:brightness(1.04);box-shadow:0 10px 28px #efb23f30; }
#login-submit::after { content:"→";font-size:21px;font-weight:500; }
.access-card[aria-busy="true"]::after { content:"";position:absolute;top:0;left:0;width:35%;height:3px;background:var(--accent);animation:access-loading 1.2s ease-in-out infinite; }
@keyframes access-loading { from{transform:translateX(-110%)}to{transform:translateX(390%)} }
.secondary { width: 100%; background: var(--surface); border-color: var(--border); color: var(--fg); }
.message { padding: 14px 16px; border-radius: 12px; font-size: .87rem; margin-top: 20px; overflow-wrap: anywhere; }
.error { color: var(--error-fg); background: var(--error-bg); border: 1px solid #b6647855; }
.warning { color: var(--warning-fg); background: var(--warning-bg); border: 1px solid #d6a13f70; }
.status { color: var(--accent-text); font-size: .85rem; margin-top: 18px; }
fieldset { border: 0; margin: 24px 0 16px; padding: 0; min-width: 0; }
legend { font-size: .85rem; font-weight: 750; margin-bottom: 12px; }
.channel { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; min-height: 76px; }
.channel + .channel { margin-top: 10px; }
.channel:has(input:checked) { border-color: var(--accent-text); background: var(--tint); }
.channel input { accent-color: var(--accent); width: 22px; height: 22px; margin: 0; flex: 0 0 22px; }
.channel strong, .channel small { display: block; }
.channel strong { font-size: .92rem; }
.channel small { color: var(--muted); font-size: .74rem; margin-top: 3px; }
.field-hint { font-size: .76rem; color: var(--muted); margin-top: 9px; }
#code { font-variant-numeric: tabular-nums; }
.text-button { color: var(--muted); background: transparent; width: 100%; margin-top: 12px; font-size: .85rem; }
#retry-session { margin-top: 24px; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px; z-index: 10; color: var(--ink); background: var(--accent); }
.skip-link:focus { top: 12px; }
noscript { padding: 20px; text-align: center; }
@media (max-width: 480px) {
  body { gap:22px;padding-top:max(28px,env(safe-area-inset-top));padding-bottom:max(28px,env(safe-area-inset-bottom)); }
  .brand img { width:110px;height:106px; }
  .access-card { padding:28px 24px;border-radius:22px; }
  .access-card h1 { font-size:1.6rem; }
}
@media (max-width: 360px) {
  body { padding-inline:14px; }
  .access-card { padding:24px 20px; }
  .access-card h1 { font-size:1.45rem; }
}
@media (max-height:700px) {
  body { gap:16px;padding-block:20px; }
  .brand img { width:92px;height:88px; }
  .access-card { padding:20px; }
  form > label { margin-top:18px; }
  .primary { margin-top:22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
