:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --border: #d1d5db;
  --input-bg: #ffffff;
  --accent: #2563eb;
  --button: #111111;
  --button-text: #ffffff;
  --summary-bg: #dcdddd;
  --summary-text: #111111;
  --timer-bg: #ecfdf3;
  --timer-text: #111111;
  --error: #dc2626;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

#app.loading { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--text) 15%, transparent);
  border-top-color: var(--text);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.main { background: var(--bg); padding: 16px 32px 48px; display: flex; justify-content: flex-end; }
.main-inner { width: 100%; max-width: 640px; margin-right: 40px; }
.aside { background: var(--summary-bg); color: var(--summary-text); padding: 24px 32px; }
.aside-inner { max-width: 520px; margin-left: 40px; position: sticky; top: 24px; }

.topbar { display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 0 12px; }
.logo { display: block; max-width: 100%; object-fit: contain; }
.brand-name { font-size: 28px; font-weight: 600; letter-spacing: .01em; text-decoration: none; }
.lang-switch {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg);
  padding: 6px 8px; font-size: 13px; cursor: pointer;
}

.timer {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--timer-bg); color: var(--timer-text);
  border-radius: var(--radius); padding: 14px 18px; margin: 4px auto 24px; max-width: 460px;
  font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.timer svg { flex: none; }
.timer .time { font-variant-numeric: tabular-nums; }

h2 { font-size: 22px; font-weight: 500; margin: 28px 0 14px; }
.aside h2 { margin-top: 12px; }

/* ---------- Fields ---------- */
.row { display: grid; gap: 14px; margin-bottom: 14px; }
.row.two { grid-template-columns: 1fr 1fr; }
.field { position: relative; }
.field input, .field select {
  width: 100%; height: 56px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--input-bg); outline: none; transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.field select { padding-top: 16px; cursor: pointer; }
.field.select::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg);
  pointer-events: none;
}
.field .label-top {
  position: absolute; left: 17px; top: 8px; font-size: 12px; color: var(--muted); pointer-events: none;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
.field.invalid input, .field.invalid select { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.field .err { color: var(--error); font-size: 13px; margin-top: 4px; }

.phone { display: flex; align-items: center; }
.phone input { padding-right: 130px; }
.phone .dial {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 22px 6px 6px; border-radius: 6px;
}
.phone .dial img { width: 32px; height: 22px; object-fit: cover; border-radius: 2px; }
.phone .dial select {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; height: auto; padding: 0;
}
.phone .dial::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg);
}

.check { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 10px 0; user-select: none; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.check.dark input { accent-color: var(--text); }

/* ---------- Shipping / protection ---------- */
.options { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.option {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.option:last-child { border-bottom: 0; }
.option.selected { background: color-mix(in srgb, var(--accent) 6%, var(--input-bg)); box-shadow: inset 0 0 0 1px var(--accent); }
.option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.option .grow { flex: 1; min-width: 0; }
.option .name { font-size: 16px; }
.option .desc { color: var(--muted); font-size: 14px; }
.option .price { font-weight: 600; font-size: 16px; }

.protection {
  display: flex; gap: 18px; margin-top: 30px; padding: 24px; position: relative; cursor: pointer;
  border: 1px solid var(--text); border-radius: var(--radius); background: var(--input-bg);
}
.protection .icon { flex: none; width: 56px; height: 56px; display: grid; place-items: center; }
.protection .icon img { width: 100%; height: 100%; object-fit: contain; }
.protection .title { font-weight: 700; font-size: 17px; margin-bottom: 4px; padding-right: 30px; }
.protection .desc { color: var(--muted); }
.protection .price { font-weight: 700; margin-top: 12px; }
.protection input {
  position: absolute; right: 18px; top: 18px; width: 24px; height: 24px; margin: 0;
  accent-color: var(--text); cursor: pointer;
}

/* ---------- Payment ---------- */
.secure { color: var(--muted); font-size: 14px; margin: -8px 0 12px; }
.payment-box { border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 20px; background: var(--input-bg); }
.payment-box .ph { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.test-mode {
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: var(--radius); padding: 14px 16px; font-size: 14px;
}
.test-mode strong { display: block; margin-bottom: 2px; }
.whop-payment #whop-payment { min-height: 80px; }
.whop-payment #whop-branding { margin-top: 8px; }

.terms-notice { text-align: center; color: var(--muted); font-size: 14px; margin: 22px 0 18px; }

.btn {
  width: 100%; height: 64px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--button); color: var(--button-text); font-size: 18px; font-weight: 500;
  transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .65; cursor: default; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); height: 52px; font-size: 16px; }

.form-error {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); text-align: center; font-size: 15px; font-weight: 500;
  color: var(--error); background: color-mix(in srgb, var(--error) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
}
.form-error .link {
  border: 0; background: none; padding: 0; margin-left: 6px; font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600;
}
.field .err::before { content: '⚠ '; }
.field .err { font-weight: 500; }

.pay-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 24px 0 8px; margin-top: 28px; border-top: 1px solid var(--border); }
.pay-icon { width: 46px; height: 29px; display: block; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 14px; color: var(--muted); padding: 10px 0 0; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Summary ---------- */
.continue { display: flex; justify-content: flex-end; }
.continue a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 17px; }
.line { display: flex; gap: 16px; align-items: flex-start; margin: 16px 0 22px; }
.thumb {
  position: relative; flex: none; width: 80px; height: 80px; border-radius: var(--radius);
  background: #f3f4f6; box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.thumb .qty {
  position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: color-mix(in srgb, var(--summary-text) 75%, transparent); color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
}
.line .info { flex: 1; min-width: 0; }
.line .title { font-size: 16px; }
.line .opt { color: color-mix(in srgb, var(--summary-text) 70%, transparent); font-size: 14px; }
.line .amount { text-align: right; white-space: nowrap; font-size: 16px; }
.line .amount s { display: block; font-size: 13px; opacity: .6; }

.discount { display: flex; gap: 12px; margin: 8px 0 6px; }
.discount .field { flex: 1; }
.discount input { background: #fff; }
.discount button {
  flex: none; padding: 0 22px; height: 56px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--button); color: var(--button-text); font-weight: 600; font-size: 16px;
}
.discount button:disabled { opacity: .5; cursor: default; }
.discount-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--summary-text) 10%, transparent); margin-top: 6px;
}
.discount-tag button { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.discount-err { color: var(--error); font-size: 13px; margin-top: 4px; }

.totals { margin-top: 18px; }
.totals .t { display: flex; justify-content: space-between; padding: 5px 0; font-size: 16px; }
.totals .grand { margin-top: 12px; font-size: 22px; font-weight: 500; align-items: baseline; }
.totals .grand small { font-size: 13px; opacity: .6; margin-right: 8px; font-weight: 600; }

.mobile-summary { display: none; }

/* ---------- Thank you ---------- */
.thanks { max-width: 560px; margin: 60px auto; padding: 0 16px; text-align: center; }
.thanks .check-circle {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  display: grid; place-items: center;
}
.thanks h1 { font-size: 26px; font-weight: 600; margin: 0 0 10px; }
.thanks p { color: var(--muted); }
.thanks .btn { margin-top: 24px; max-width: 320px; height: 52px; font-size: 16px; }
.notice { text-align: center; padding: 80px 16px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 999px) {
  .layout { grid-template-columns: 1fr; }
  .aside { display: none; }
  .main { padding: 12px 16px 40px; justify-content: center; }
  .main-inner { margin: 0 auto; }
  .mobile-summary {
    display: block; background: var(--summary-bg); color: var(--summary-text);
    margin: 0 -16px 16px; padding: 0 16px;
    border-top: 1px solid color-mix(in srgb, var(--summary-text) 12%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--summary-text) 12%, transparent);
  }
  .mobile-summary > button {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    background: none; border: 0; padding: 16px 0; cursor: pointer; font-size: 15px; color: inherit;
  }
  .mobile-summary > button b { font-size: 17px; }
  .mobile-summary .body { padding-bottom: 16px; }
  .mobile-summary:not(.open) .body { display: none; }
  .timer { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .row.two { grid-template-columns: 1fr; }
  .lang-switch { position: static; transform: none; margin-left: auto; }
  .topbar { justify-content: space-between; gap: 12px; }
  .brand-name { font-size: 22px; }
  h2 { font-size: 20px; }
  .protection { padding: 18px; gap: 12px; }
}
