:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --paper: #ffffff;
  --surface: #f4f6f8;
  --line: #e4e7ec;
  --accent: #111827;
  --accent-hover: #263244;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(17, 24, 39, 0.1), transparent 40%),
    var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
summary {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
}

.language-button {
  min-width: 38px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.language-button.active {
  color: white;
  background: var(--ink);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.hero {
  margin-bottom: 24px;
  text-align: center;
}

.eyebrow,
.result-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 9vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 390px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.card {
  padding: 26px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.start-card,
.state-card,
.result-card {
  text-align: center;
}

.phone-illustration {
  position: relative;
  width: 104px;
  height: 154px;
  margin: 2px auto 26px;
  border: 5px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(150deg, #ffffff 0%, #e7ebef 100%);
  box-shadow: 0 12px 22px rgba(17, 24, 39, 0.14);
}

.phone-illustration::after {
  position: absolute;
  right: -8px;
  top: 48px;
  width: 3px;
  height: 26px;
  border-radius: 0 4px 4px 0;
  background: var(--ink);
  content: "";
}

.camera {
  position: absolute;
  left: 12px;
  width: 13px;
  height: 13px;
  border: 3px solid #89919e;
  border-radius: 50%;
  background: var(--ink);
}

.camera-one {
  top: 13px;
}

.camera-two {
  top: 33px;
}

.camera-three {
  top: 53px;
}

.phone-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 24px;
  color: var(--ink);
  font-size: 49px;
  font-weight: 800;
}

.button {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 15px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:active {
  transform: scale(0.985);
}

.button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(17, 24, 39, 0.25);
  outline-offset: 3px;
}

.button-primary {
  border: 1px solid var(--accent);
  color: white;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-shop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--success);
  color: white;
  background: var(--success);
  text-decoration: none;
}

.button-shop:hover {
  background: #05603a;
}

.shop-note {
  margin: 0 8px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.button-secondary {
  margin-top: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}

.button-secondary:hover {
  border-color: #c9ced6;
  background: #fafafa;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.state-card h2,
.result-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.13;
  letter-spacing: -0.04em;
}

.state-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 2px auto 20px;
  border: 5px solid #e4e7ec;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.success-icon,
.warning-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  font-size: 27px;
  font-weight: 800;
}

.success-icon {
  color: var(--success);
  background: var(--success-soft);
}

.warning-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  font-weight: 750;
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.raw-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 14px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafa;
  text-align: left;
}

.raw-model span {
  color: var(--muted);
  font-size: 13px;
}

.raw-model strong {
  font-size: 14px;
  text-align: right;
}

.result-message {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.diagnostics {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.diagnostics summary {
  padding: 17px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.diagnostics dl {
  margin: 15px 0 0;
}

.diagnostics dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
}

.diagnostics dt {
  color: var(--muted);
}

.diagnostics dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
}

.confirmed-card .next-step {
  margin-top: 10px;
  padding: 14px;
  border-radius: 13px;
  background: var(--surface);
}

footer {
  margin-top: 22px;
  color: #89919e;
  font-size: 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (min-width: 600px) {
  .app-shell {
    padding-top: 32px;
  }

  .topbar {
    margin-bottom: 60px;
  }

  .card {
    padding: 32px;
  }
}

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