:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --ink: #142033;
  --mute: #5b6b7c;
  --dim: #8a97a6;
  --line: #d7dee7;
  --navy: #173a63;
  --navy-deep: #102a4a;
  --sky: #2f6fed;
  --soft: #f3f6fa;
  --ok: #1f7a4d;
  --ok-hover: #196040;
  --warn: #9a6700;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(20, 32, 51, 0.08);
}

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

html, body { background: var(--bg); }

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(47, 111, 237, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(23, 58, 99, 0.1), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 40%, #e8eef5 100%);
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}

.ad-flag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 9px;
}

.topbar-date {
  font-size: 0.72rem;
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 22px 30px;
}

@media (min-width: 768px) {
  .shell { padding: 32px 24px 64px; }
  .card { padding: 40px 44px 42px; border-radius: 28px; }
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--navy), var(--sky));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 58, 99, 0.22);
}

.logo svg { width: 30px; height: 30px; }

.brand h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.brand p {
  font-size: 0.92rem;
  color: var(--mute);
  max-width: 34rem;
  margin: 0 auto;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .brand h1 { font-size: 2rem; }
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}

.feature {
  text-align: center;
  padding: 14px 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.feature .ico {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  color: var(--navy);
}

.feature span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mute);
  line-height: 1.35;
}

@media (min-width: 768px) {
  .feature { padding: 16px 10px; }
  .feature span { font-size: 0.8rem; }
}

.progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.progress i {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #dbe3ee;
}

.progress i.on { background: var(--navy); }
.progress i.done { background: var(--ok); }

.panel { min-height: 180px; }
.hidden { display: none !important; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--mute);
  margin-bottom: 8px;
}

.label-row b { color: var(--ink); font-weight: 700; }

.field-wrap { position: relative; margin-bottom: 8px; }

.field {
  width: 100%;
  height: 60px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  text-align: center;
  font-size: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: #fff;
  outline: none;
  padding: 0 44px;
  -webkit-appearance: none;
  appearance: none;
}

.field:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(23, 58, 99, 0.1);
}

.field.bad { border-color: var(--danger); }

.field-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--dim);
  margin-bottom: 16px;
  font-family: "IBM Plex Mono", monospace;
}

.err {
  display: none;
  text-align: center;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.err.show { display: block; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--navy-deep); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--mute);
  font-weight: 600;
}

.trust span { display: inline-flex; align-items: center; gap: 5px; }
.trust svg { width: 14px; height: 14px; color: var(--navy); }

.loading {
  text-align: center;
  padding: 18px 0 8px;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid #d7e2f0;
  border-top-color: var(--sky);
  animation: spin 0.9s linear infinite;
}

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

.loading-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 14px;
}

.bar-track {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  height: 10px;
  background: #e4ebf3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), var(--sky));
  transition: width 0.2s ease;
}

.loading-meta {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
}

.result { text-align: center; padding: 8px 0 0; }

.result h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.result-code {
  display: inline-block;
  margin: 6px 0 10px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 1.05rem;
}

.result-lead {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.result-sub {
  font-size: 0.84rem;
  color: var(--mute);
  margin-bottom: 18px;
  line-height: 1.6;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--ok);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid var(--ok);
  transition: background 0.15s ease;
}

.wa-btn:hover { background: var(--ok-hover); }
.wa-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }

.retry {
  display: inline-block;
  margin-top: 16px;
  background: none;
  border: 0;
  color: var(--mute);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.retry:hover { color: var(--navy); }

.risk {
  margin-top: 16px;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--dim);
  text-align: left;
  border-left: 2px solid var(--line);
  padding-left: 10px;
}

.risk.mt { margin-top: 18px; }

.footer {
  margin-top: 18px;
  padding: 0 4px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  font-size: 0.74rem;
  margin-bottom: 10px;
}

.footer-links a { color: var(--mute); }
.footer-links span { color: var(--dim); }

.legal-note {
  font-size: 0.68rem;
  color: var(--dim);
  line-height: 1.6;
}
