/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1516;
  --bg2: #192122;
  --bg3: #242b2d;
  --border: #3b494c;
  --accent: #00daf3;
  --accent-hover: #00c4d8;
  --text: #dce4e5;
  --muted: #bac9cc;
  --green: #22c55e;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
main.container { flex: 1; padding-top: 2rem; padding-bottom: 4rem; }

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-size: 1.2rem; font-weight: 700; color: var(--text); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
}

/* ── Hero ── */
.hero { text-align: center; padding: 3.5rem 0 2rem; }
.hero h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.5px; }
.subtitle { color: var(--muted); margin-top: .5rem; font-size: 1.1rem; }

/* ── Features ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}
.feature {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.feature .icon { font-size: 1.8rem; }
.feature h3 { margin: .5rem 0 .25rem; font-size: 1rem; }
.feature p { color: var(--muted); font-size: .875rem; }

/* ── Plans ── */
.plans h2, .faq h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  text-align: center;
}
.plan-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-card:hover { border-color: var(--accent); }
.plan-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,106,247,.25);
  background: var(--bg3);
}
.plan-card.popular { border-color: var(--accent); }
.badge {
  position: absolute; top: -12px;
  background: var(--accent); color: #fff;
  font-size: .75rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
}
.plan-name { color: var(--muted); font-size: .875rem; margin-top: .25rem; }
.plan-price { font-size: 2rem; font-weight: 800; margin: .5rem 0 .25rem; }
.plan-per { color: var(--muted); font-size: .8rem; }

/* ── Email input ── */
.email-group { margin-bottom: 1.5rem; }
.email-group label { display: block; font-weight: 600; margin-bottom: .4rem; }
.email-group input {
  width: 100%; max-width: 400px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .65rem 1rem;
  color: var(--text); font-size: 1rem;
  transition: border-color .15s;
}
.email-group input:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: .8rem; margin-top: .4rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .6rem 1.25rem;
  border-radius: 8px; font-size: 1rem; font-weight: 600;
  border: none; cursor: pointer; transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.btn-lg { padding: .85rem 2rem; font-size: 1.1rem; border-radius: 10px; }
.btn-sm { padding: .3rem .75rem; font-size: .85rem; }

/* ── FAQ ── */
.faq { margin-top: 3rem; }
details {
  border: 1px solid var(--border);
  border-radius: 8px; padding: .85rem 1rem; margin-bottom: .5rem;
  background: var(--bg2);
}
details[open] { padding-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; user-select: none; }
summary::marker { display: none; }
summary::before { content: "▶  "; color: var(--muted); font-size: .75rem; }
details[open] summary::before { content: "▼  "; }
details p { margin-top: .5rem; color: var(--muted); font-size: .9rem; }

/* ── Card (pay / success) ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.card.centered { max-width: 520px; margin: 2rem auto; text-align: center; }
.card h2 { margin-bottom: 1.25rem; }

/* ── Order summary ── */
.order-summary {
  background: var(--bg3); border-radius: 8px; padding: 1rem 1.25rem;
  margin-bottom: 1.5rem; text-align: left;
}
.order-row { display: flex; justify-content: space-between; padding: .35rem 0; }
.order-row.total {
  border-top: 1px solid var(--border); margin-top: .35rem; padding-top: .6rem;
  font-size: 1.1rem;
}
.pay-note { color: var(--muted); font-size: .875rem; margin-bottom: 1.25rem; }

/* ── Payment methods ── */
.payment-methods {
  display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.5rem;
}
.method-option {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .6rem 1rem; cursor: pointer; font-size: .9rem;
  transition: border-color .15s;
}
.method-option:has(input:checked) { border-color: var(--accent); }
.method-option input { accent-color: var(--accent); }

/* ── Status icon ── */
.status-icon {
  font-size: 3.5rem; margin-bottom: .75rem; display: block;
}
.status-icon.success { color: var(--green); }
.status-icon.pending { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ── Progress bar ── */
.progress-bar {
  background: var(--bg3); border-radius: 20px; height: 6px;
  margin: 1.5rem 0; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent); border-radius: 20px;
  width: 0%; transition: width .5s ease;
}

/* ── VLESS block ── */
.vless-block {
  margin: 1.5rem 0; text-align: left;
}
.vless-block label { font-weight: 600; display: block; margin-bottom: .4rem; }
.vless-link-wrap {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: .6rem .85rem;
}
.vless-link-wrap code {
  flex: 1; font-size: .75rem; word-break: break-all;
  color: var(--accent); font-family: "SF Mono", "Fira Code", monospace;
}

/* ── Instructions ── */
.instructions {
  background: var(--bg3); border-radius: 8px; padding: 1rem 1.25rem;
  text-align: left; margin: 1.25rem 0;
}
.instructions h3 { font-size: .95rem; margin-bottom: .75rem; }
.instructions ol { padding-left: 1.25rem; }
.instructions li { color: var(--muted); font-size: .875rem; margin-bottom: .35rem; }
.instructions a { color: var(--accent); }

/* ── Client info table (renew page) ── */
.client-info { margin: 1rem 0 1.5rem; }
.info-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.info-table tr + tr td { border-top: 1px solid var(--border); }
.info-table td { padding: .55rem .4rem; }
.info-label { color: var(--muted); white-space: nowrap; padding-right: 1rem; width: 40%; }
.badge-ok  { background: rgba(80,200,120,.15); color: #50c878; border-radius: 4px; padding: 2px 8px; font-size: .8rem; }
.badge-err { background: rgba(255,80,80,.15); color: #ff6060; border-radius: 4px; padding: 2px 8px; font-size: .8rem; }

/* ── Plan card selection ring (used by JS) ── */
[data-plan-id].ring-2 {
  box-shadow: 0 0 0 2px #00e5ff;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.75rem; }
  .card { padding: 1.5rem; }
  .payment-methods { flex-direction: column; }
}
