:root {
  --bg: #0a0a0c;
  --surface: #141418;
  --surface-hover: #1c1c22;
  --border: #2a2a32;
  --text: #f5f5f7;
  --muted: #9ca3af;
  --accent: #f97316;
  --accent-dim: #ea580c;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 16px;
}

.brand {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-hidden {
  display: none;
}

.tariff-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tariff-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.tariff-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.tariff-btn.active {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
}

.tariff-btn .meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.period-btn {
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}

.period-btn:hover,
.period-btn.active {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.08);
}

.period-btn .price {
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

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

.field input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  margin-top: 10px;
  padding: 10px;
}

.summary {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.summary strong {
  color: var(--accent);
}

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 8px;
}

.loader {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.link-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  margin: 12px 0;
}

.instructions {
  color: var(--muted);
  font-size: 0.88rem;
}

.instructions ol {
  padding-left: 20px;
  margin-top: 8px;
}

.instructions li {
  margin-bottom: 6px;
}

.status-ok {
  color: var(--success);
  font-weight: 600;
}

.status-wait {
  color: var(--accent);
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 24px;
}

.footer-note a {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 400px) {
  .period-grid {
    grid-template-columns: 1fr;
  }
}
