/* ─── Checkout page styles ─── */
:root {
  --co-bg: #0a0a0f;
  --co-surface: #111827;
  --co-border: #1f2937;
  --co-text: #e5e7eb;
  --co-text-muted: #9ca3af;
  --co-accent: #818cf8;
  --co-accent-hover: #6366f1;
  --co-radius: 12px;
  --co-max-w: 480px;
  --co-font: "Pretendard Variable", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: var(--co-font);
  background: var(--co-bg);
  color: var(--co-text);
  line-height: 1.6;
  min-height: 100dvh;
}

/* ─── Topbar ─── */
.checkout-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--co-border);
}

.brand-link {
  text-decoration: none;
  color: var(--co-text);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon img {
  width: 24px;
  height: 24px;
  display: block;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* ─── Layout ─── */
.checkout-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.checkout-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 20px 64px;
}

.checkout-card {
  width: 100%;
  max-width: var(--co-max-w);
  background: var(--co-surface);
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius);
  padding: 32px;
}

/* ─── Summary ─── */
.checkout-summary h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.checkout-lead {
  color: var(--co-text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.checkout-cycle-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.checkout-cycle-option {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--co-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.checkout-cycle-option input {
  margin: 0;
}

.checkout-cycle-option span {
  color: var(--co-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.checkout-cycle-option strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.checkout-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.checkout-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--co-accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.checkout-price-note {
  font-size: 14px;
  color: var(--co-text-muted);
}

.checkout-includes {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.checkout-includes li {
  font-size: 13px;
  color: var(--co-text-muted);
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.15);
  border-radius: 6px;
  padding: 4px 10px;
}

/* ─── Compare Table ─── */
.checkout-compare {
  margin-top: 16px;
  margin-bottom: 24px;
}

.checkout-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.checkout-plan-table th,
.checkout-plan-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--co-border);
  text-align: center;
  white-space: nowrap;
}

.checkout-plan-table th:first-child,
.checkout-plan-table td:first-child {
  width: 100%;
  text-align: left;
  white-space: normal;
}

.checkout-plan-table thead th {
  color: var(--co-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checkout-plan-table tbody tr:last-child td {
  border-bottom: 0;
}

.cmp-check {
  color: #34d399; /* success green */
  font-weight: 700;
}

.cmp-dash {
  color: var(--co-text-muted);
}

.compare-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--co-text-muted);
}

.compare-note strong {
  color: var(--co-text);
}

/* ─── Payment methods ─── */
.method-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.method-grid:empty {
  display: none;
}

/* ─── Form ─── */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--co-text-muted);
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  font-family: var(--co-font);
  font-size: 15px;
  padding: 10px 12px;
  background: var(--co-bg);
  border: 1px solid var(--co-border);
  border-radius: 8px;
  color: var(--co-text);
  transition: border-color 0.15s;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--co-accent);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

.checkout-form input::placeholder,
.checkout-form textarea::placeholder {
  color: #4b5563;
}

/* Note field has no custom styles */

.checkout-form button[type="submit"] {
  font-family: var(--co-font);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  background: var(--co-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.checkout-form button[type="submit"]:hover {
  background: var(--co-accent-hover);
}

.checkout-form button[type="submit"]:active {
  transform: scale(0.98);
}

.form-remark {
  font-size: 12px;
  color: var(--co-text-muted);
  text-align: center;
}

.checkout-note {
  font-size: 12px;
  color: var(--co-text-muted);
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--co-border);
}

/* ─── Status panel ─── */
.status-panel {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.status-panel.hidden {
  display: none;
}

.status-panel.success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

.status-panel.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

/* ─── Footer ─── */
.checkout-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid var(--co-border);
}

.checkout-footer a {
  font-size: 14px;
  color: var(--co-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.checkout-footer a:hover {
  color: var(--co-accent);
}

/* ─── Responsive ─── */
@media (max-width: 540px) {
  .checkout-main {
    padding: 24px 12px 48px;
  }

  .checkout-card {
    padding: 24px 18px;
  }

  .checkout-cycle-picker {
    grid-template-columns: 1fr;
  }
}

/* ─── Dark mode already default, light override ─── */
@media (prefers-color-scheme: light) {
  :root {
    --co-bg: #f9fafb;
    --co-surface: #ffffff;
    --co-border: #e5e7eb;
    --co-text: #111827;
    --co-text-muted: #6b7280;
  }

  .checkout-price {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .checkout-form input,
  .checkout-form select,
  .checkout-form textarea {
    background: #f3f4f6;
  }
}
