/* ui.css + tokens.css linked explicitly in HTML (no @import cascade). */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg-page); color: var(--text); }
button { cursor: pointer; font: inherit; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__brand { text-decoration: none; }
.topbar__brand:hover { text-decoration: none; }
.topbar__link {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--blue-600);
}

.main {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 72px;
}

.card-wrap { width: min(100%, 560px); }

.card-header { margin-bottom: 22px; }
.card-header__title {
  margin: 0 0 6px;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
.card-header__sub {
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--leading);
  color: var(--muted);
}

.plan-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.plan-picker-note {
  margin: 0 0 18px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--muted);
}
.plan-radio { display: none; }
.plan-option__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}
.plan-radio:checked + .plan-option__box {
  border-color: var(--blue-600);
  background: var(--blue-50);
}
.plan-option__name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
}
.plan-option__price {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.plan-radio:checked + .plan-option__box .plan-option__name { color: var(--blue-800); }
.plan-radio:checked + .plan-option__box .plan-option__price { color: var(--blue-800); }

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

.field { margin-bottom: 16px; }
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.req { color: var(--blue-600); }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: var(--input-h);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-base);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
input:focus-visible {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: var(--focus);
}
input.is-error { border-color: var(--danger); }

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-mid);
}
.ghost:hover { background: var(--surface-2); }

.hint {
  margin: 5px 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
.hint.error { color: var(--danger); }

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: 600;
  background: var(--danger-bg);
  color: var(--danger);
}
.alert[hidden] { display: none; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--ok-bg); color: var(--ok); }

.submit {
  width: 100%;
  height: var(--btn-h-lg);
  border: 1px solid var(--blue-600);
  border-radius: var(--radius-sm);
  background: var(--blue-600);
  color: var(--white);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.15s, opacity 0.15s;
}
.submit:hover:not(:disabled) {
  background: var(--blue-800);
  border-color: var(--blue-800);
}
.submit:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.submit:disabled { opacity: var(--disabled-opacity); cursor: not-allowed; }

.state-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.state-card h2 {
  margin: 0 0 10px;
  font-size: var(--text-xl);
  font-weight: 700;
}
.state-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: var(--leading);
}
.state-card .submit {
  text-decoration: none;
  display: inline-flex;
  width: auto;
  padding: 0 28px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 560px) {
  .plan-picker { grid-template-columns: 1fr; }
  .card { padding: 22px 16px; }
  .main {
    padding: 24px 12px calc(40px + env(safe-area-inset-bottom, 0px));
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
    min-height: 48px;
  }
  .btn--primary {
    min-height: 48px;
    width: 100%;
  }
}

.cf-turnstile-slot {
  margin: 12px 0 16px;
}

/* Honeypot — off-screen; keep in DOM for bots */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
