:root {
  color-scheme: dark;
  --bg: #03080d;
  --panel: #07121b;
  --panel-2: #0a1822;
  --line: #17323e;
  --text: #f5f8fa;
  --muted: #8fa6b2;
  --cyan: #17e6ff;
  --cyan-soft: #0a8fa8;
  --gold: #f6b91f;
  --gold-2: #ffd96b;
  --purple: #a853ff;
  --danger: #ff6b72;
  --success: #59edb3;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 10%, rgba(23, 230, 255, .08), transparent 28rem),
    radial-gradient(circle at 78% 42%, rgba(168, 83, 255, .05), transparent 24rem),
    var(--bg);
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin-top: 0; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.skip-link {
  position: fixed; z-index: 20; left: 16px; top: 12px; transform: translateY(-160%);
  padding: 10px 14px; border-radius: 8px; color: #031015; background: var(--cyan);
}
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.muted { color: var(--muted); }
.eyebrow, .step-label {
  margin-bottom: 8px; color: var(--cyan); font-size: .73rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
}

.site-header {
  position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; padding: 12px max(22px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line); background: rgba(3, 8, 13, .9); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: .78rem; font-weight: 850; line-height: 1.2; letter-spacing: .16em; }
.brand b { color: var(--gold); font-weight: inherit; }
.brand-mark {
  display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--gold);
  border-radius: 50%; color: var(--gold); font-size: .7rem; letter-spacing: -.03em; box-shadow: 0 0 18px rgba(246, 185, 31, .12);
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.agent-chip, .lang-link, .admin-lock {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem;
}
.lang-link { color: var(--text); text-decoration: none; }
.lang-link:hover { border-color: var(--cyan); color: var(--cyan); }

.hero { padding-block: 70px 42px; text-align: center; }
.hero h1 { margin-bottom: 12px; font-size: clamp(2.35rem, 6vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 2vw, 1.16rem); }
.flow { display: flex; align-items: center; justify-content: center; max-width: 520px; margin: 30px auto 0; }
.flow span { display: flex; align-items: center; gap: 8px; color: #c7d4da; font-size: .84rem; font-weight: 700; }
.flow b { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--cyan-soft); border-radius: 50%; color: var(--cyan); }
.flow span:first-child b { border-color: var(--gold); color: var(--gold); }
.flow i { width: 64px; height: 1px; margin: 0 12px; background: linear-gradient(90deg, var(--gold), var(--cyan-soft)); }

.packages, .system, .details { padding-block: 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin-bottom: 24px; }
.section-heading h2, .work-rule h2, .terms h2 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.035em; line-height: 1.08; }
.section-heading > p { max-width: 520px; margin-bottom: 2px; color: var(--muted); }
.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.package-card {
  position: relative; display: flex; min-height: 226px; flex-direction: column; align-items: flex-start;
  padding: 26px; border: 1px solid #6e5615; border-radius: var(--radius); color: var(--text); text-align: left;
  background: linear-gradient(145deg, rgba(246, 185, 31, .09), rgba(7, 18, 27, .94) 45%);
  cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.package-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 14px 40px rgba(0, 0, 0, .28); }
.package-card.is-selected { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(246, 185, 31, .22), 0 0 30px rgba(246, 185, 31, .13); }
.package-name { color: var(--gold-2); font-size: .72rem; font-weight: 850; letter-spacing: .14em; }
.package-price { margin: 12px 0 3px; color: var(--gold); font-size: 2.7rem; line-height: 1; letter-spacing: -.045em; }
.package-count { color: #d7e0e4; }
.package-action { margin-top: auto; color: var(--gold); font-size: .8rem; font-weight: 800; }
.package-card.is-selected .package-action::before { content: "✓ "; }
.package-badge { position: absolute; right: 16px; top: -13px; padding: 6px 10px; border: 1px solid var(--gold); border-radius: 999px; color: #161004; background: var(--gold); font-size: .65rem; font-weight: 900; letter-spacing: .09em; }
.lead-mix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lead-mix span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; background: rgba(7, 18, 27, .76); }
.lead-mix b { color: var(--cyan); }
.estimate-note { margin: 12px 0 0; color: #708995; font-size: .75rem; }

.system-graphic {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 80px 1.15fr 80px 1fr;
  align-items: center; min-height: 420px; padding: 36px; border: 1px solid #16404d; border-radius: 24px;
  background:
    linear-gradient(rgba(23, 230, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 230, 255, .025) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(23, 230, 255, .12), transparent 35%),
    linear-gradient(160deg, #06141e, #03090e);
  background-size: 34px 34px, 34px 34px, auto, auto;
  box-shadow: inset 0 0 70px rgba(23, 230, 255, .025);
}
.source-row { display: grid; gap: 12px; }
.system-node { position: relative; z-index: 1; border: 1px solid var(--cyan-soft); border-radius: 16px; background: rgba(5, 18, 27, .94); box-shadow: inset 0 0 22px rgba(23, 230, 255, .05), 0 0 24px rgba(23, 230, 255, .05); }
.source-node { display: flex; align-items: center; gap: 13px; padding: 18px; }
.system-node b, .system-node small { display: block; }
.system-node small { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.node-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid var(--cyan-soft); border-radius: 10px; color: var(--cyan); font-size: 1.3rem; }
.flow-line { position: relative; height: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.flow-line::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--cyan); }
.flow-line.purple { background: linear-gradient(90deg, var(--cyan), var(--purple)); box-shadow: 0 0 12px var(--purple); }
.copper-node { padding: 30px 24px; text-align: center; border-width: 2px; box-shadow: 0 0 34px rgba(23, 230, 255, .13); }
.copper-node img { width: 180px; max-height: 48px; margin: 0 auto 10px; object-fit: contain; }
.copper-wordmark { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--cyan); font-size: 1.15rem; letter-spacing: .08em; }
.copper-wordmark span { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid currentColor; border-radius: 9px; font-size: .75rem; }
.cora-node {
  display: grid; width: 100%; max-width: 220px; aspect-ratio: 1; justify-self: center; place-items: center;
  padding: 0; text-align: center; border: 0; background: transparent url("assets/cora-orb.webp") center / contain no-repeat; box-shadow: none;
}
.cora-node div { position: absolute; inset: 0; display: grid; align-items: end; padding: 0 15% 20%; }
.cora-node b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cora-node small { margin: 0; color: #f2ddff; font-size: .64rem; line-height: 1.25; text-shadow: 0 1px 8px #1d0037, 0 0 10px #7e20d5; }
.cora-orbit { display: none; }
.output-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.output-row article { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 18, 27, .86); }
.output-row b, .output-row small { display: block; }
.output-row b { color: var(--cyan); font-size: .8rem; }
.output-row small { margin-top: 3px; color: var(--muted); }
.included-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.included-grid article { position: relative; min-height: 170px; padding: 20px 18px 18px 68px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(11, 28, 39, .85), rgba(5, 12, 18, .86)); }
.included-grid h3 { margin: 0 0 6px; font-size: .94rem; }
.included-grid p { margin: 0; color: var(--muted); font-size: .79rem; }
.feature-icon { position: absolute; left: 17px; top: 18px; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--cyan-soft); border-radius: 10px; color: var(--cyan); font-size: .8rem; font-weight: 800; }
.feature-icon.purple { border-color: var(--purple); color: #d59aff; }

.work-rule { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-block: 22px 48px; padding: 28px 32px; border: 1px solid var(--gold); border-radius: var(--radius); background: linear-gradient(90deg, rgba(246, 185, 31, .1), rgba(7, 18, 27, .85)); }
.work-rule-icon { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid var(--gold); border-radius: 15px; color: var(--gold); font-size: 1.8rem; }
.work-rule .step-label { color: var(--gold); }
.work-rule p:last-child { max-width: 850px; margin: 9px 0 0; color: #bdcbd1; }

.details-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, .8fr); gap: 16px; align-items: start; }
#onboarding-form, .next-card, .terms, .admin-auth, .table-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7, 18, 27, .86); }
#onboarding-form { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid label, .admin-auth label { color: #d5e1e6; font-size: .78rem; font-weight: 700; }
input, select {
  width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #294654; border-radius: 9px;
  color: var(--text); background: #061018; outline: 0;
}
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(23, 230, 255, .1); }
.agreements { min-width: 0; margin: 22px 0 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); }
.agreements legend { padding: 0; color: var(--text); font-size: 1rem; font-weight: 800; }
.agreements .step-label { display: inline; margin-right: 8px; }
.check-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; margin-top: 13px; color: #b6c6cd; font-size: .78rem; cursor: pointer; }
.check-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--cyan); }
.form-submit { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
#package-summary { color: var(--muted); font-size: .8rem; }
#submit-button, .button {
  flex: 0 0 auto; padding: 13px 18px; border: 1px solid var(--gold); border-radius: 10px; color: #130e02;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); font-weight: 900; cursor: pointer; box-shadow: 0 8px 24px rgba(246, 185, 31, .12);
}
#submit-button:hover, .button:hover { filter: brightness(1.07); }
#submit-button:disabled, .button:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .55; }
.button-secondary { color: var(--cyan); border-color: var(--cyan-soft); background: transparent; box-shadow: none; }
.form-status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--success); font-weight: 800; }
#onboarding-form[data-complete] { border-color: var(--success); }
.next-card { padding: 24px; }
.next-card h3 { margin-bottom: 18px; font-size: 1.35rem; }
.next-card ol { margin: 0; padding: 0; list-style: none; counter-reset: next; }
.next-card li { position: relative; padding: 0 0 18px 38px; counter-increment: next; }
.next-card li::before { content: counter(next); position: absolute; left: 0; top: 0; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--cyan-soft); border-radius: 50%; color: var(--cyan); font-size: .7rem; font-weight: 850; }
.next-card li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 27px; bottom: 2px; width: 1px; background: var(--line); }
.next-card b, .next-card span { display: block; }
.next-card b { font-size: .84rem; }
.next-card span { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.terms { margin-block: 18px 60px; padding: 22px 24px; }
.terms h2 { margin-bottom: 12px; font-size: 1rem; }
.terms p { margin: 7px 0 0; color: #77909b; font-size: .72rem; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px max(22px, calc((100vw - 1160px) / 2)); border-top: 1px solid var(--line); color: #617985; font-size: .72rem; letter-spacing: .04em; }

/* Post-submit next steps */
.confirmation-page { display: flex; min-height: 100vh; flex-direction: column; }
.confirmation-main { flex: 1; padding-block: 76px 72px; }
.confirmation-hero { max-width: 820px; margin-bottom: 34px; text-align: center; }
.confirmation-hero h1 { margin-bottom: 14px; font-size: clamp(2.35rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -.052em; }
.confirmation-hero .hero-copy { max-width: 650px; }
.saved-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 10px 14px; border: 1px solid rgba(89, 237, 179, .42); border-radius: 999px; color: var(--success); background: rgba(89, 237, 179, .06); font-size: .82rem; font-weight: 800; }
.saved-note span { color: #a8bbc4; font-weight: 600; }
.payment-panel { display: grid; justify-items: center; gap: 12px; margin-top: 18px; }
.payment-panel p { margin: 0; color: var(--muted); font-size: .85rem; }
.payment-panel .button { display: inline-block; text-decoration: none; }
.payment-panel .button[hidden] { display: none; }
.confirmation-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 18px; align-items: start; }
.confirmation-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7, 18, 27, .9); }
.steps-panel { padding: 30px; border-color: #16404d; }
.confirmation-heading { margin-bottom: 24px; }
.confirmation-heading h2 { margin-bottom: 7px; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.confirmation-heading p { margin-bottom: 0; color: var(--muted); }
.confirmation-steps { margin: 0; padding: 0; list-style: none; counter-reset: confirmation-step; }
.confirmation-steps li { position: relative; min-height: 92px; padding: 2px 0 26px 58px; counter-increment: confirmation-step; }
.confirmation-steps li:last-child { min-height: 0; padding-bottom: 0; }
.confirmation-steps li::before { content: counter(confirmation-step); position: absolute; left: 0; top: 0; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--cyan-soft); border-radius: 50%; color: var(--cyan); background: #061018; font-size: .78rem; font-weight: 900; }
.confirmation-steps li:nth-child(2)::before { border-color: var(--gold); color: var(--gold); }
.confirmation-steps li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 40px; bottom: 6px; width: 1px; background: var(--line); }
.confirmation-steps h3 { margin-bottom: 5px; font-size: 1rem; }
.confirmation-steps p { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: .86rem; }
.confirmation-steps strong { color: #dce8ed; }
.cora-name { color: #d59aff; font-style: normal; }
.reminder-panel { overflow: hidden; }
.reminder-head { padding: 24px; border-bottom: 1px solid var(--line); }
.reminder-head .step-label { color: var(--gold); }
.reminder-head h2 { margin-bottom: 7px; font-size: 1.35rem; }
.reminder-head p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.reminder-list { margin: 0; padding: 8px 24px 20px; list-style: none; }
.reminder-list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: #c7d5db; font-size: .84rem; }
.reminder-list li:last-child { border-bottom: 0; }
.work-statement { margin: 0 24px 24px; padding: 15px 16px; border: 1px solid #6e5615; border-radius: 11px; color: var(--gold-2); background: rgba(246, 185, 31, .06); font-size: .88rem; font-weight: 850; }

/* Secure retrieval page */
.admin-page { min-height: 100vh; }
.admin-shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 50px 0; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.admin-heading h1 { margin-bottom: 6px; font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.045em; }
.admin-actions { display: flex; gap: 10px; }
.admin-auth { max-width: 700px; margin-bottom: 18px; padding: 22px; }
.admin-auth h2 { margin-bottom: 5px; }
.admin-auth p { color: var(--muted); }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.token-row input { margin: 0; }
.table-card { overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 245px); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .76rem; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; color: var(--cyan); background: #081722; text-align: left; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
td { max-width: 250px; overflow: hidden; padding: 12px 14px; border-top: 1px solid var(--line); color: #c8d6db; text-overflow: ellipsis; }
tbody tr:hover td { background: rgba(23, 230, 255, .03); }
.empty-state { padding: 48px; color: var(--muted); text-align: center; }

@media (max-width: 880px) {
  .package-grid, .included-grid { grid-template-columns: 1fr 1fr; }
  .package-card:last-child { grid-column: 1 / -1; }
  .system-graphic { grid-template-columns: 1fr 40px 1.15fr 40px 1fr; padding: 26px 20px; }
  .details-layout { grid-template-columns: 1fr; }
  .next-card { order: 2; }
  .confirmation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell, .admin-shell { width: min(100% - 24px, 1160px); }
  .site-header { min-height: 64px; padding: 10px 12px; }
  .brand-name { display: none; }
  .agent-chip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 48px 0 28px; }
  .hero h1 { font-size: 2.5rem; }
  .confirmation-main { padding-block: 50px 48px; }
  .confirmation-hero { margin-bottom: 26px; }
  .confirmation-hero h1 { font-size: 2.45rem; }
  .saved-note { display: flex; align-items: flex-start; flex-direction: column; gap: 1px; border-radius: 12px; text-align: left; }
  .steps-panel { padding: 22px 19px; }
  .confirmation-steps li { padding-left: 50px; }
  .flow i { width: 24px; margin-inline: 7px; }
  .flow span { gap: 5px; font-size: .72rem; }
  .packages, .system, .details { padding-block: 34px; }
  .section-heading, .admin-heading { display: block; }
  .section-heading > p { margin-top: 10px; }
  .package-grid, .included-grid, .form-grid { grid-template-columns: 1fr; }
  .package-card, .package-card:last-child { grid-column: auto; min-height: 190px; padding: 22px; }
  .system-graphic { display: flex; min-height: 0; flex-direction: column; gap: 12px; padding: 20px; }
  .source-row, .system-node, .output-row { width: 100%; }
  .flow-line { width: 2px; height: 34px; }
  .flow-line::after { right: -4px; top: auto; bottom: -7px; border-left-color: transparent; border-top-color: var(--cyan); }
  .output-row { grid-template-columns: 1fr; margin-top: 2px; }
  .included-grid article { min-height: 135px; }
  .work-rule { grid-template-columns: 1fr; padding: 22px; }
  #onboarding-form, .next-card { padding: 19px; }
  .form-submit { align-items: stretch; flex-direction: column; }
  #submit-button { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .admin-actions { margin-top: 18px; }
  .token-row { grid-template-columns: 1fr; }
  .table-scroll { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
