:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --fill: #f5f5f7;
  --line: #d2d2d7;
  --red: #e02424;
  --green: #1d9a4b;
  --amber: #c26a00;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { display: flex; justify-content: center; padding: 28px 16px 0; }
.logo { width: 150px; height: auto; mix-blend-mode: multiply; }

.wrap {
  flex: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 9vh 20px 40px;
}
@media (max-width: 480px) { .wrap { padding-top: 6vh; } }

h1, h2 {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.022em;
  text-align: center;
  margin: 0 0 10px;
}
@media (min-width: 600px) { h1 { font-size: 44px; } }
.lead {
  font-size: 17px;
  line-height: 1.47;
  color: var(--muted);
  text-align: center;
  margin: 0 auto 36px;
  max-width: 340px;
}

/* Inputs — grouped iOS-style list with floating labels */
.group {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.field { position: relative; }
.field + .field { border-top: 1px solid var(--line); }
.field input {
  display: block;
  width: 100%;
  height: 58px;
  padding: 22px 16px 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;           /* ≥16px stops iOS zooming on focus */
  color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus { outline: none; background: #fafafc; }
.field input.mono { font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.field label {
  position: absolute;
  left: 16px;
  top: 19px;
  font-size: 17px;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .15s ease, color .15s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.72); }
.field input:focus + label { color: var(--ink); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 0;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
}
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }

.error { color: var(--red); font-size: 15px; text-align: center; margin: 8px 0 0; }

.btn {
  position: relative;
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn .spinner {
  display: none;
  position: absolute; right: 20px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: block; }
.btn-plain { background: var(--fill); color: var(--ink); margin-top: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }

.help { display: block; text-align: center; margin-top: 22px; font-size: 15px; }

/* Result */
#result { text-align: center; animation: rise .4s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.badge { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.badge svg { width: 36px; height: 36px; }
.badge.ok { background: var(--green); }
.badge.warn { background: var(--amber); }
.badge.bad { background: var(--red); }
.badge.ok svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#result .lead { margin-bottom: 28px; }

.meta { margin: 0; background: var(--fill); border-radius: 14px; text-align: left; }
.meta:empty { display: none; }
.meta div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; font-size: 15px; }
.meta div + div { border-top: 1px solid #e5e5ea; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 500; text-align: right; }
.meta dd.mono { font-family: var(--mono); letter-spacing: .06em; }

.foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 20px 16px 28px;
  font-size: 12px;
  color: var(--muted);
}
.foot a { color: var(--muted); }

dialog {
  width: calc(100% - 32px);
  max-width: 400px;
  border: 0;
  border-radius: 18px;
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
dialog::backdrop { background: rgba(0,0,0,.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog h3 { margin: 0 0 12px; font-size: 20px; }
dialog ul { padding-left: 18px; margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 1.5; }
dialog li + li { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .badge.ok svg path { stroke-dashoffset: 0; }
}
