:root {
  color-scheme: light dark;
  --r1-gold: #d7ad55;
  --r1-gold-soft: rgba(215, 173, 85, .32);
  --r1-emerald: #075846;
  --r1-emerald-bright: #0c9974;
}

.theme-switch {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--r1-gold-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}
.theme-switch button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] {
  color: #fff8df;
  background: linear-gradient(135deg, #087258, #d7ad55);
  box-shadow: 0 0 18px rgba(215,173,85,.28);
}
.header { position: relative; padding-top: 2px; }

html[data-theme="light"] {
  color-scheme: light;
  --text: #123f35;
  --muted: #55776f;
  --card: rgba(255,255,255,.72);
  --line: rgba(7,88,70,.14);
  --gold: #c99c3e;
  --gold2: #8e681f;
  --cyan: #087a61;
  --ok: #087a61;
}
html[data-theme="light"] body {
  background: linear-gradient(180deg,#fbf9f3 0%,#eef7f3 46%,#dceee8 100%);
  color: var(--text);
}
html[data-theme="light"] body::before { opacity: .18; }
html[data-theme="light"] .card,
html[data-theme="light"] .user-card,
html[data-theme="light"] .metric,
html[data-theme="light"] .track-box {
  color: var(--text);
  background: rgba(255,255,255,.68);
  border-color: rgba(7,88,70,.14);
  box-shadow: 0 15px 45px rgba(5,70,54,.07), inset 0 1px rgba(255,255,255,.8);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea { color:var(--text); background:rgba(255,255,255,.76); border-color:rgba(7,88,70,.18); }
html[data-theme="light"] .footer { background:rgba(247,252,249,.92); border-color:rgba(7,88,70,.13); }
html[data-theme="light"] .footer button.active { color:#075846; text-shadow:none; }

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  overflow: auto;
  color: #f8f2df;
  background: #021a15 url('/assets/concepts/final-access-system/02-dark-production-background.png') center top / cover no-repeat;
}
.access-gate.visible { display: block; }
html[data-theme="light"] .access-gate {
  color: #123f35;
  background-color: #f8f6ef;
  background-image: url('/assets/concepts/final-access-system/01-light-production-background.png');
}
.access-gate::before {
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(0,18,14,.08),rgba(0,18,14,.68));
}
html[data-theme="light"] .access-gate::before { background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(248,246,239,.74)); }
.access-gate-inner {
  position:relative;
  z-index:1;
  width:min(520px,100%);
  min-height:100%;
  margin:auto;
  padding:calc(36px + env(safe-area-inset-top)) 22px calc(34px + env(safe-area-inset-bottom));
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  text-align:center;
}
.access-gate-brand { font-size:12px; letter-spacing:.28em; color:var(--r1-gold); margin-bottom:18px; }
.access-gate-card {
  padding:26px 20px 20px;
  border:1px solid rgba(215,173,85,.5);
  border-radius:28px;
  background:rgba(2,34,27,.78);
  box-shadow:0 24px 80px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter:blur(20px);
}
html[data-theme="light"] .access-gate-card { background:rgba(255,255,255,.82); box-shadow:0 24px 80px rgba(4,69,54,.14); }
.access-gate h1 { margin:0 0 10px; font-size:clamp(26px,7vw,38px); line-height:1.08; text-transform:uppercase; }
.access-gate-date { color:var(--r1-gold); font-size:13px; letter-spacing:.08em; text-transform:uppercase; }
.access-countdown { margin:18px 0; font-size:clamp(25px,8vw,42px); font-variant-numeric:tabular-nums; letter-spacing:.03em; }
.access-gate-message { margin:0 auto 18px; max-width:390px; font-size:14px; line-height:1.55; opacity:.82; white-space:pre-wrap; }
.access-gate-reason { margin:-8px 0 16px; color:var(--r1-gold); font-size:12px; }
.access-support {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:52px;
  padding:12px 18px;
  border:1px solid #d7ad55;
  border-radius:999px;
  color:#fffdf4;
  background:linear-gradient(135deg,#075846,#0a7b60);
  box-shadow:0 0 0 1px rgba(215,173,85,.15),0 14px 34px rgba(0,0,0,.22);
  text-decoration:none;
  font-weight:800;
}
.gold-thread {
  --progress: 0deg;
  width:92px;
  height:92px;
  margin:0 auto 16px;
  border-radius:50%;
  background:conic-gradient(var(--r1-gold) var(--progress),rgba(215,173,85,.15) 0);
  padding:2px;
  filter:drop-shadow(0 0 10px rgba(215,173,85,.35));
}
.gold-thread::before {
  content:"";
  display:block;
  width:100%;height:100%;border-radius:50%;
  background:rgba(3,42,33,.72);
}
html[data-theme="light"] .gold-thread::before { background:rgba(255,255,255,.82); }
.gold-thread.indefinite { animation:goldPulse 2.8s ease-in-out infinite; }
@keyframes goldPulse { 50% { filter:drop-shadow(0 0 22px rgba(215,173,85,.7)); opacity:.82; } }

.restriction-box { margin-top:12px; padding:12px; border:1px solid rgba(215,173,85,.25); border-radius:14px; }
.restriction-box .restriction-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.restriction-box .restriction-grid > * { min-width:0; }
.restriction-box .chk { display:flex; gap:8px; align-items:center; }
.restriction-box .chk input { width:18px; height:18px; margin:0; }
.restriction-status { margin:8px 0; font-size:12px; color:var(--r1-gold); }

@media (prefers-reduced-motion: reduce) {
  .gold-thread.indefinite { animation:none; }
}
