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

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #888888;
  --line: #e5e5e5;
  --danger: #c0392b;
  --ok: #1a1a1a;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

a { color: inherit; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap.narrow { max-width: 640px; }

main {
  flex: 1 0 auto;
  padding-bottom: 48px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.header-link:hover { color: var(--fg); }

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* Email field with inline button */
.input-with-btn {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color 0.2s ease;
}

.input-with-btn:focus-within { border-color: var(--fg); }

.input-with-btn input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
  color: var(--fg);
}

.input-with-btn input:focus { outline: none; }

.input-inline-btn {
  border: none;
  border-left: 1px solid var(--line);
  background: var(--bg);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s ease;
}

.input-inline-btn:hover:not(:disabled) { background: #f5f5f5; }
.input-inline-btn:disabled { color: var(--muted); cursor: not-allowed; }

/* Code confirmation */
.code-flow {
  max-width: 420px;
  margin: 0 auto 16px;
}

.code-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.code-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 20px;
  letter-spacing: 0.3em;
  text-align: center;
  font-family: monospace;
  background: var(--bg);
  color: var(--fg);
}

.code-row input:focus { outline: none; border-color: var(--fg); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.link-btn:hover:not(:disabled) { color: var(--fg); }
.link-btn:disabled { color: #ccc; cursor: not-allowed; text-decoration: none; }

.email-verified-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg);
  max-width: 420px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: #fafafa;
}

/* Success panel */
.success-panel {
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-size: 28px;
  line-height: 56px;
  margin: 0 auto 20px;
}

.success-panel h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.success-message {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 64px;
}

.hero h1 {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 460px;
  margin: 0 auto;
}

/* Plans */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.plan {
  border: 1px solid var(--line);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
  position: relative;
}

.plan:hover { border-color: var(--fg); }

.plan.active {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.plan-name {
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 700;
}

.plan-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  min-height: 32px;
}

.plan.active .plan-desc { color: rgba(255,255,255,0.7); }

.plan-price {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 15px;
  font-weight: 400;
  opacity: 0.6;
}

.plan-per {
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  font-size: 13px;
  line-height: 1.8;
}

.plan-features li::before {
  content: "—";
  margin-right: 8px;
  opacity: 0.5;
}

.plan.active .plan-features li::before { opacity: 0.7; }

/* Section label */
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 16px;
  text-align: center;
}

/* Duration */
.duration {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 48px;
  border: 1px solid var(--line);
  padding: 4px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.dur {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: inherit;
}

.dur:hover { background: #f5f5f5; }

.dur.active { background: var(--fg); color: var(--bg); }

/* Form */
.field {
  max-width: 420px;
  margin: 0 auto 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--fg);
}

.field input[type="text"]:focus,
.field input[type="email"]:focus {
  outline: none;
  border-color: var(--fg);
}

.checkbox-row {
  max-width: 420px;
  margin: 0 auto 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-row input { margin-top: 3px; }

.checkbox-row a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Summary */
.summary {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  max-width: 420px;
  margin: 0 auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 14px;
}

.summary-row.total {
  font-size: 20px;
  font-weight: 600;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.summary-row .label { color: var(--muted); }
.summary-row.total .label { color: var(--fg); }

.error-msg {
  max-width: 420px;
  margin: 0 auto 16px;
  font-size: 13px;
  color: var(--danger);
  display: none;
}

.error-msg.show { display: block; }

.hint-msg {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 20px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.secondary {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
}

/* Footer */
footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
}

footer a:hover { color: var(--fg); }

/* Profile page */
.profile-card {
  border: 1px solid var(--line);
  padding: 28px;
  margin-bottom: 20px;
}

.profile-card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: var(--muted); }
.profile-row .value { font-weight: 500; }

.progress-outer {
  height: 6px;
  background: #f0f0f0;
  margin-top: 10px;
  margin-bottom: 6px;
}

.progress-inner {
  height: 100%;
  background: var(--fg);
}

.progress-caption {
  font-size: 12px;
  color: var(--muted);
}

.sub-url-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sub-url-box input {
  flex: 1;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 13px;
  font-family: monospace;
  background: #fafafa;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.badge.on { color: var(--ok); border-color: var(--fg); }

.mock-banner {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.links-list {
  margin-top: 12px;
}

.link-item {
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  border: 1px solid var(--line);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fafafa;
}

.state-msg {
  text-align: center;
  color: var(--muted);
  padding: 80px 0;
}

/* Mobile */
@media (max-width: 720px) {
  .plans { grid-template-columns: 1fr; }
  .hero { margin-bottom: 48px; }
  header { margin-bottom: 48px; }
  .dur { font-size: 13px; padding: 10px 4px; }
  footer { flex-direction: column; gap: 12px; }
  footer a { margin-left: 0; margin-right: 16px; }
}
