:root {
  --bg-0: #060911;
  --bg-1: #0b1220;
  --panel: rgba(12, 20, 36, 0.82);
  --panel-border: rgba(125, 170, 220, 0.18);
  --ink: #e8eef8;
  --mute: #93a4bd;
  --dim: #6d7f99;
  --line: rgba(148, 175, 210, 0.16);
  --cyan: #2ec4b6;
  --cyan-2: #5eead4;
  --sky: #4aa3ff;
  --ok: #25c28a;
  --danger: #ff6b6b;
  --soft: rgba(255, 255, 255, 0.04);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html, body {
  min-height: 100%;
  background: var(--bg-0);
}

body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(46, 196, 182, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 10%, rgba(74, 163, 255, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(37, 194, 138, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

.bg-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 175, 210, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 175, 210, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 20%, transparent 75%);
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 14px max(48px, env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}

.rail {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 26, 0.55);
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 700;
}

.rail b {
  color: var(--cyan-2);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px 30px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.55), rgba(74, 163, 255, 0.45), transparent);
}

@media (min-width: 768px) {
  .shell { padding: 36px 24px 64px; }
  .card { padding: 40px 42px 42px; }
}

.brand { text-align: center; margin-bottom: 22px; position: relative; z-index: 1; }

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 196, 182, 0.28);
  background: rgba(46, 196, 182, 0.08);
  color: var(--cyan-2);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}

.logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #041018;
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(145deg, var(--cyan-2), var(--sky));
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35), 0 14px 34px rgba(46, 196, 182, 0.22);
}

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

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

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

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

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

.feature .ico {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(46, 196, 182, 0.18), rgba(74, 163, 255, 0.12));
  border: 1px solid rgba(94, 234, 212, 0.22);
  color: var(--cyan-2);
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--mono);
}

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

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

.progress i {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 175, 210, 0.18);
}

.progress i.on {
  background: linear-gradient(90deg, var(--cyan), var(--sky));
  box-shadow: 0 0 12px rgba(46, 196, 182, 0.35);
}

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

.panel { position: relative; z-index: 1; }
.hidden { display: none !important; }

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

.label-row b { color: var(--ink); font-weight: 700; }
.label-row span { font-family: var(--mono); font-size: 0.72rem; color: var(--cyan-2); }

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

.field {
  width: 100%;
  height: 56px;
  border: 1px solid rgba(148, 175, 210, 0.22);
  border-radius: 14px;
  text-align: center;
  font-size: 16px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(4, 10, 20, 0.65);
  outline: none;
  padding: 0 16px 0 64px;
  -webkit-appearance: none;
  appearance: none;
}

.field::placeholder {
  color: #5f708a;
  letter-spacing: 0;
  font-weight: 500;
  font-family: var(--font);
}

.field:focus {
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.12);
}

.field.bad {
  border-color: rgba(255, 107, 107, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.field-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
  font-size: 0.72rem;
  font-weight: 700;
}

.hint, .err {
  text-align: center;
  font-size: 0.76rem;
  margin-bottom: 10px;
}

.hint { color: var(--dim); }
.err { display: none; color: var(--danger); font-weight: 700; }
.err.show { display: block; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--mute);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.chip b {
  font-family: var(--mono);
  color: var(--cyan-2);
  margin-right: 4px;
}

.btn, .line-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  padding: 12px 16px;
}

.btn {
  background: linear-gradient(135deg, #1aa892 0%, #2f7fd6 100%);
  box-shadow: 0 10px 28px rgba(26, 168, 146, 0.28);
}

.btn:active, .line-btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.line-btn {
  max-width: 430px;
  margin: 0 auto;
  background: #06c755;
  box-shadow: 0 12px 28px rgba(6, 199, 85, 0.28);
}

.line-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }

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

.trust span { display: inline-flex; align-items: center; gap: 6px; }

.loading { text-align: center; padding: 22px 0 10px; }

.spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(148, 175, 210, 0.16);
  border-top-color: var(--cyan);
  border-right-color: var(--sky);
  animation: spin 0.85s linear infinite;
}

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

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

.bar-track {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  height: 10px;
  background: rgba(148, 175, 210, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

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

.loading-meta {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.result { text-align: center; padding: 6px 0 0; }
.result h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.result-name { color: var(--mute); font-size: 0.92rem; margin-bottom: 8px; }

.result-code {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(46, 196, 182, 0.12);
  border: 1px solid rgba(46, 196, 182, 0.3);
  color: var(--cyan-2);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.result-lead { font-size: 0.98rem; font-weight: 700; color: #d7e6ff; margin-bottom: 8px; }

.result-sub {
  font-size: 0.86rem;
  color: var(--mute);
  margin: 0 auto 18px;
  line-height: 1.7;
  max-width: 28rem;
}

.note {
  min-height: 1.4em;
  margin-top: 8px;
  color: var(--dim);
  font-size: 0.75rem;
}

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

.risk {
  margin-top: 16px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--dim);
  text-align: left;
  border-left: 2px solid rgba(148, 175, 210, 0.28);
  padding-left: 10px;
}

@media (max-width: 420px) {
  .brand h1 { font-size: 1.45rem; }
  .feature span { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .btn:active, .line-btn:active { transform: none; }
}
