:root {
  color-scheme: light dark;
  --bg: #f5f6fa;
  --card: #fff;
  --card2: #f0f1f6;
  --tx: #12141a;
  --mu: #6b7180;
  --ac: #5b50f0;
  --bd: #e6e8ef;
  --red: #e5484d;
  --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --r: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f14;
    --card: #161922;
    --card2: #1d212c;
    --tx: #eceef3;
    --mu: #949bab;
    --ac: #8b84ff;
    --bd: #252a36;
    --red: #ff8d8d;
    --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: var(--ac); }
.mu { color: var(--mu); }
.err { color: var(--red); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
}

.lcard {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 28px 22px;
  box-shadow: var(--sh);
}
.lcard h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.lcard h2 {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.lead { margin: 8px 0 20px; }
.lcard > p.mu:not(.lead):not(.msg) { margin-top: 8px; }

form { display: flex; flex-direction: column; gap: 10px; }
.fld {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px;
  outline: none;
}
.fld:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 28%, transparent);
}

.btn {
  min-height: 48px;
  margin-top: 6px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ac);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.btn:disabled { opacity: .7; cursor: progress; }
.btn.ghost {
  width: 100%;
  margin-top: 18px;
  background: transparent;
  color: var(--tx);
  border: 1px solid var(--bd);
}

.msg { min-height: 1.3em; margin-top: 12px; font-size: 14px; }
.forgot-row { margin-top: 4px; }
.forgot {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
}

.enter { animation: in .3s ease both; }
@keyframes in {
  from { opacity: 0; transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .enter { animation: none; }
}

.home {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 28px);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.top h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}
.top h1 .brand-ico {
  width: 38px;
  height: 38px;
}
.sair {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  background: var(--card);
  font-weight: 600;
  box-shadow: var(--sh);
}
.sair:focus-visible, .btn:focus-visible, .forgot:focus-visible, .door:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}

.doors {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.door {
  display: flex;
  align-items: stretch;
  min-height: 112px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.door:hover { border-color: color-mix(in srgb, var(--stripe) 55%, var(--bd)); }
.door:active { transform: scale(.995); }
.stripe { width: 8px; flex: none; background: var(--stripe); }
.door.ygg { --stripe: #0a2e22; }
.door.dra { --stripe: #0a1128; }
.door.mun { --stripe: #1f5c6b; }
.door.ski { --stripe: #1c100c; }
.door-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 22px 20px;
  min-width: 0;
}
.door-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.door-icon {
  display: inline-flex;
  flex: none;
  width: 44px;
  height: 44px;
}
.door-icon .door-ico,
.door-icon img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.door-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.door-desc { color: var(--mu); font-size: 15px; }

@media (min-width: 840px) {
  .doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .door { min-height: 220px; }
  .door-name { font-size: 26px; }
  .door-body { padding: 28px 24px; }
}

.noscript {
  max-width: 36rem;
  margin: 24px auto;
  padding: 0 16px;
  color: var(--tx);
}
