:root {
  --ink: #14202b;
  --muted: #5a6876;
  --line: #dbe3ec;
  --brand: #0f6ab4;
  --brand-dark: #0c548d;
  --brand-tint: #eaf3fb;
  --bg-1: #071521;
  --bg-2: #0e2b45;
  --success: #1c8a5a;
  --warning: #a86a00;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(15, 106, 180, 0.28), transparent 60%),
    radial-gradient(700px 500px at 90% 110%, rgba(18, 140, 126, 0.18), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.page {
  width: min(720px, 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px 6px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(145deg, #1a85d8, var(--brand-dark));
  box-shadow: 0 10px 24px rgba(2, 20, 35, 0.35);
}

.brand-text {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
}

.brand-text span {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: clamp(28px, 5vw, 52px);
  box-shadow:
    0 30px 80px rgba(1, 12, 22, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.6) inset;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.lede {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #33414f;
  font-size: 0.98rem;
}

.steps span {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.82rem;
}

form {
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

label[for="pin"] {
  font-weight: 700;
  font-size: 0.9rem;
}

#pin {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 1.35rem;
  letter-spacing: 0.4em;
  text-align: center;
  color: var(--ink);
  background: #fbfdff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

#pin:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 106, 180, 0.14);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  color: #3c4a58;
  font-size: 0.86rem;
  line-height: 1.5;
}

.check input {
  margin: 3px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

#connect {
  margin-top: 10px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #1480cf, var(--brand));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    opacity 0.15s ease;
}

#connect:hover:not(:disabled) {
  transform: translateY(-1px);
}

#connect:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.privacy {
  margin: 18px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

a {
  color: var(--brand);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

#view-status {
  text-align: center;
  padding: 36px 0;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 4px solid var(--brand-tint);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

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

#view-status p {
  color: var(--muted);
  margin: 0;
}

#view-success,
#view-error {
  text-align: center;
}

.check-icon,
.error-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
}

.check-icon {
  background: #e8f7ef;
  color: var(--success);
}

.error-icon {
  background: #fdecea;
  color: #b42318;
}

#view-success .lede {
  margin-top: 0;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  text-align: left;
  margin: 24px 0 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: #f7f9fc;
  border: 1px solid #edf1f6;
  font-size: 0.9rem;
}

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

dd {
  margin: 0;
  font-weight: 650;
  word-break: break-word;
}

.notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff8e8;
  border-left: 3px solid #f0a500;
  color: #6b4a00;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: left;
}

.notice:empty {
  display: none;
}

.secondary {
  display: block;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.9rem;
}

.ghost {
  margin-top: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.ghost:hover {
  border-color: #b9c6d4;
}

.error-detail {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  color: #5a6876;
  font-size: 0.72rem;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.76rem;
}

footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

@media (max-width: 560px) {
  .card {
    border-radius: 20px;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  dd + dt {
    margin-top: 8px;
  }
}
