:root {
  color-scheme: dark;
  --bg: #090d12;
  --bg-soft: #0e141c;
  --panel: #121a24;
  --panel-2: #172230;
  --line: #263445;
  --line-soft: #1c2836;
  --text: #edf4fb;
  --muted: #8fa1b5;
  --accent: #4aa3ff;
  --accent-soft: #183f66;
  --green: #43d19e;
  --amber: #f4ba62;
  --red: #f2747e;
  --radius: 14px;
  --shadow: 0 24px 80px rgb(0 0 0 / 28%);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; font-size: 15px; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.public-body {
  background:
    radial-gradient(circle at 12% 12%, rgb(35 102 166 / 20%), transparent 34rem),
    radial-gradient(circle at 88% 85%, rgb(34 130 113 / 12%), transparent 32rem),
    var(--bg);
}

.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 2.35rem; height: 2.35rem;
  border: 1px solid #55708d; border-radius: 10px;
  background: linear-gradient(145deg, #223a54, #111b27); color: #9dd0ff;
  font-size: 1.05rem; font-weight: 800; box-shadow: inset 0 1px rgb(255 255 255 / 12%);
}
.brand strong, .brand small { display: block; letter-spacing: .13em; }
.brand strong { font-size: .9rem; }
.brand small { margin-top: .12rem; color: var(--muted); font-size: .58rem; }

.public-header, .public-footer {
  display: flex; align-items: center; justify-content: space-between;
  width: min(1180px, calc(100% - 3rem)); margin: 0 auto;
}
.public-header { height: 86px; border-bottom: 1px solid rgb(255 255 255 / 7%); }
.public-main { width: min(1180px, calc(100% - 3rem)); margin: 0 auto; }
.public-footer { min-height: 74px; color: var(--muted); border-top: 1px solid rgb(255 255 255 / 7%); font-size: .82rem; }
.public-footer a { color: #b8dbfc; text-decoration: none; }

.public-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 5rem; align-items: center; min-height: calc(100vh - 160px); padding: 5rem 0; }
.eyebrow { display: block; color: #7fbfff; font-size: .68rem; font-weight: 700; letter-spacing: .18em; }
.hero-copy h1 { margin: 1.2rem 0 1.4rem; font-size: clamp(2.8rem, 6vw, 5.6rem); line-height: .97; letter-spacing: -.055em; }
.hero-copy h1 em { color: #84c4ff; font-style: normal; }
.hero-copy > p { max-width: 650px; color: #a8b6c7; font-size: 1.16rem; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero-panel { padding: 2rem; border: 1px solid #2d4055; border-radius: 22px; background: linear-gradient(155deg, rgb(28 42 57 / 96%), rgb(13 20 29 / 96%)); box-shadow: var(--shadow), inset 0 1px rgb(255 255 255 / 8%); }
.panel-kicker { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .16em; }
.hero-panel h2 { margin: .7rem 0 1.5rem; font-size: 1.55rem; }
.price { display: flex; align-items: baseline; gap: .7rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.price strong { font-size: 3.2rem; letter-spacing: -.06em; }
.price span { color: var(--muted); }
.feature-list { display: grid; gap: .9rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.feature-list li { position: relative; padding-left: 1.55rem; color: #c9d5e2; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.support-page { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 4rem; align-items: center; min-height: calc(100vh - 160px); padding: 4rem 0; }
.support-copy h1 { margin: 1rem 0 1.2rem; font-size: clamp(2.6rem, 5vw, 4.8rem); line-height: 1; letter-spacing: -.05em; }
.support-copy > p { max-width: 680px; color: #a8b6c7; font-size: 1.08rem; line-height: 1.7; }
.support-page .definition-list a { color: #b8dbfc; text-decoration: none; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .65rem 1rem;
  border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #16202c;
  font-weight: 650; text-decoration: none; cursor: pointer; transition: border-color .16s, background .16s, transform .16s;
}
.button:hover { border-color: #476480; background: #1b2a3a; }
.button:active { transform: translateY(1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .side-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button.primary { border-color: #4595df; background: linear-gradient(180deg, #3187d8, #2167a8); box-shadow: inset 0 1px rgb(255 255 255 / 15%); }
.button.danger { border-color: #6d343d; background: #3e2027; color: #ffc0c6; }
.button.ghost { background: transparent; }
.button.full { width: 100%; }
.button.small { min-height: 34px; padding: .45rem .75rem; font-size: .78rem; }
.state-pill, .environment-chip, .status-link, .badge { display: inline-flex; align-items: center; gap: .48rem; border-radius: 999px; font-weight: 750; letter-spacing: .08em; }
.state-pill { padding: .58rem .8rem; border: 1px solid var(--line); background: #101820; font-size: .66rem; }
.state-pill span, .environment-chip span, .status-link span { width: .46rem; height: .46rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(67 209 158 / 10%); }

.admin-grid { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 1.35rem 1rem; border-right: 1px solid var(--line-soft); background: #0b1118; }
.sidebar .brand { padding: .3rem .35rem 1.25rem; }
.environment-chip { align-self: flex-start; margin: .25rem .35rem 1.2rem; padding: .38rem .55rem; color: #9ab0c6; background: #101923; border: 1px solid #202e3c; font-size: .58rem; }
.side-nav { display: grid; gap: .25rem; }
.side-nav a { padding: .7rem .8rem; border-radius: 8px; color: #a7b6c6; text-decoration: none; font-size: .87rem; font-weight: 600; }
.side-nav a:hover { color: var(--text); background: #141f2a; }
.sidebar-foot { display: grid; gap: .5rem; margin-top: auto; padding: 1rem .35rem .15rem; border-top: 1px solid var(--line-soft); }
.sidebar-foot small { color: var(--muted); }
.sidebar-foot > span { overflow: hidden; margin-bottom: .35rem; color: #c8d6e4; text-overflow: ellipsis; font-size: .78rem; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; height: 76px; padding: 0 clamp(1rem, 3vw, 2.8rem); border-bottom: 1px solid var(--line-soft); background: rgb(9 13 18 / 90%); backdrop-filter: blur(16px); }
.topbar strong { display: block; margin-top: .2rem; font-size: 1.08rem; }
.status-link { padding: .5rem .65rem; color: #9ddabd; text-decoration: none; font-size: .62rem; }
.content { width: min(1500px, 100%); padding: clamp(1.2rem, 3vw, 2.8rem); }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: .2rem 0 0; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.page-heading p { max-width: 720px; margin: .45rem 0 0; color: var(--muted); line-height: 1.55; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.metric, .card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, #111923, #0e151e); box-shadow: inset 0 1px rgb(255 255 255 / 3%); }
.metric { padding: 1.15rem; }
.metric span { color: var(--muted); font-size: .73rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.metric strong { display: block; margin-top: .5rem; font-size: 2rem; letter-spacing: -.04em; }
.metric small { color: #72869a; }
.card { min-width: 0; padding: 1.2rem; }
.card h2, .card h3 { margin: 0 0 1rem; }
.card h2 { font-size: 1.08rem; }
.card h3 { font-size: .95rem; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 1rem; }
.muted { color: var(--muted); }
.compact { font-size: .8rem; line-height: 1.55; }
.notice { margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid #315a7d; border-radius: 10px; background: #10263a; color: #badeff; }
.notice.success { border-color: #29604d; background: #102b23; color: #a8e8ce; }
.notice.warning { border-color: #6a522b; background: #2d2415; color: #f5d49e; }
.notice.danger { border-color: #6e3038; background: #321a20; color: #ffc1c7; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #0e151e; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem .85rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { color: #8295a9; background: #111a24; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: #c7d4e1; font-size: .81rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #111c27; }
.mono { font-family: "Cascadia Mono", "Consolas", monospace; font-size: .76rem; }
.badge { padding: .3rem .5rem; border: 1px solid var(--line); background: #151f2a; color: #aab9c8; font-size: .58rem; }
.badge.active, .badge.completed, .badge.sent { border-color: #2b5d4b; color: #95dfbf; background: #10281f; }
.badge.pending { border-color: #5b4a2d; color: #efc77f; background: #282013; }
.badge.revoked, .badge.failed, .badge.chargeback { border-color: #66313a; color: #f2a1aa; background: #2b181d; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .4rem; }
.field.span-2 { grid-column: span 2; }
.field label { color: #aab9c8; font-size: .74rem; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: .65rem .72rem; border: 1px solid #2b3b4c; border-radius: 8px;
  color: var(--text); background: #0b121a;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #5e7185; }
.field-help { color: #71859a; font-size: .7rem; line-height: 1.45; }
.field-error, .validation-summary-errors { color: #ff9ca6; font-size: .76rem; }
.validation-summary-valid { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1rem; }
.inline-form { display: inline-flex; gap: .5rem; }
.secret-box { display: grid; gap: .55rem; padding: 1rem; border: 1px solid #635126; border-radius: 10px; background: #29220f; }
.secret-box code { user-select: all; overflow-wrap: anywhere; color: #ffe2a7; font-size: .95rem; }

.login-shell { display: grid; place-items: center; min-height: calc(100vh - 160px); padding: 3rem 0; }
.login-card { width: min(440px, 100%); padding: 2rem; border: 1px solid #2b3e52; border-radius: 18px; background: rgb(17 26 36 / 94%); box-shadow: var(--shadow); }
.login-card h1 { margin: .6rem 0 .45rem; font-size: 1.9rem; }
.login-card > p { margin: 0 0 1.5rem; color: var(--muted); }
.login-card .form-grid { grid-template-columns: 1fr; }

.checkout-shell, .legal-shell { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.checkout-heading { max-width: 780px; margin-bottom: 2rem; }
.checkout-heading h1 { margin: .75rem 0 1rem; font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -.05em; }
.checkout-heading p { color: #a8b6c7; font-size: 1.04rem; line-height: 1.65; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 1.2rem; align-items: start; }
.checkout-form, .order-summary { padding: clamp(1.2rem, 3vw, 2rem); }
.order-summary { position: sticky; top: 1rem; }
.order-summary h2 { margin: .65rem 0 1.2rem; font-size: 1.45rem; }
.order-summary .definition-list { margin-top: 1.5rem; }
.order-summary .definition-list dd { max-width: 62%; }
.order-summary .definition-list a { color: #b8dbfc; text-decoration: none; }
.consents { display: grid; gap: .8rem; margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.consents legend { padding: 0 .35rem; color: #b9c9d9; font-size: .78rem; font-weight: 700; }
.check-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: .7rem; align-items: start; color: #bdcad7; font-size: .8rem; line-height: 1.5; }
.check-row input { width: 17px; height: 17px; margin: .17rem 0 0; accent-color: var(--accent); }
.check-row a { color: #8bc8ff; }
.checkout-submit { margin-top: .4rem; }
.checkout-submit:disabled { cursor: not-allowed; opacity: .46; filter: grayscale(.35); }
.payment-return { width: min(560px, 100%); }
.legal-shell { width: min(920px, 100%); margin: 0 auto; }
.legal-document { color: #c8d5e2; line-height: 1.72; overflow-wrap: anywhere; }
.legal-document h2 { margin: 2rem 0 .7rem; color: var(--text); font-size: 1.22rem; }
.legal-document h2:first-child { margin-top: 0; }
.legal-document p { margin: .55rem 0; }
.legal-document ol, .legal-document ul { display: grid; gap: .5rem; margin: .6rem 0; padding-left: 1.45rem; }

.definition-list { display: grid; gap: .8rem; margin: 0; }
.definition-list > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line-soft); }
.definition-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; text-align: right; }
.empty { padding: 2rem; color: var(--muted); text-align: center; }

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid.three { grid-template-columns: 1fr; }
  .public-hero { gap: 2.5rem; }
}

@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .side-nav { display: flex; width: 100%; min-width: 0; overflow-x: auto; padding-bottom: .4rem; }
  .side-nav a { white-space: nowrap; }
  .sidebar-foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin-top: .65rem; padding-top: .75rem; }
  .sidebar-foot small, .sidebar-foot > span { grid-column: 1; }
  .sidebar-foot > span { margin-bottom: 0; }
  .sidebar-foot form { grid-column: 2; grid-row: 1 / span 2; }
  .sidebar-foot .button { width: auto; min-height: 34px; padding: .45rem .75rem; }
  .topbar { top: 0; }
  .public-hero, .support-page, .card-grid, .form-grid, .checkout-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .order-summary { position: static; }
  .public-hero { min-height: auto; padding: 3rem 0; }
  .public-header, .public-main, .public-footer { width: min(100% - 2rem, 1180px); }
  .page-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .metrics { grid-template-columns: 1fr; }
  .topbar { height: 68px; }
  .status-link { display: none; }
  .public-header .button { padding-inline: .7rem; }
  .hero-copy h1 { font-size: 2.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
