:root {
  --bg: #0e1014;
  --card: #191c22;
  --text: #e9ebef;
  --muted: #9aa1ad;
  --line: #272c35;
  --field: #14171c;
  --accent: #ff7a18;
  --ok: #46c37b;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

[data-theme="light"] {
  --bg: #eef0f3;
  --card: #ffffff;
  --text: #191c22;
  --muted: #6c7480;
  --line: #e4e7ec;
  --field: #f6f7f9;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.hidden { display: none !important; }

.shell { width: 100%; display: grid; place-items: center; }

.card {
  width: min(420px, 100%);
  padding: 44px 34px 22px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  transition: background 0.2s ease;
}

.logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 12px;
}

h1 {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sub {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.view { animation: fade 0.3s ease both; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.bar {
  height: 4px;
  margin-top: 22px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.16s linear;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  min-height: 15px;
}

.widget {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  margin-top: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}

.widget-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.note.err { color: #e0574f; }

.tick {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(70, 195, 123, 0.14);
  color: var(--ok);
  font-size: 27px;
  line-height: 1;
}

.btn {
  margin-top: 20px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--accent); }

.btn:focus-visible,
.theme:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.foot strong { color: var(--text); font-weight: 600; }

.theme {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme:hover { color: var(--text); border-color: var(--muted); }

@media (max-width: 420px) {
  body { padding: 16px 14px; }
  .card { padding: 34px 20px 18px; border-radius: 16px; }
  h1 { font-size: 20px; }
  .sub { font-size: 13.5px; }
  .theme { top: 12px; right: 12px; width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
