:root {
  --bg: #061016;
  --panel: rgba(18, 35, 45, 0.88);
  --panel-strong: #10242f;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6fbff;
  --muted: #b9c8d6;
  --blue: #00d4ff;
  --blue-2: #178bff;
  --green: #35e79f;
  --danger: #ff6b7a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(23, 139, 255, 0.18), transparent 26rem),
    linear-gradient(145deg, #061016, #02070b 70%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

a { color: var(--blue); }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(3, 10, 14, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand img { width: 94px; height: auto; border-radius: 14px; }
.secure-pill, .status-pill {
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 999px;
  padding: .65rem 1rem;
  background: rgba(0, 212, 255, 0.08);
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .75rem;
}

.onboarding-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.hero-card, .wizard-card, .card, .install-shell, .login-card, .success-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(22, 45, 58, .92), rgba(9, 18, 26, .88));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.3rem, 5vw, 3rem);
  margin-bottom: 1.25rem;
}

.hero-card h1, .wizard-card h2, .install-shell h1, .login-card h1, .success-card h1, .admin-main h1 {
  font-size: clamp(2.2rem, 8vw, 5.4rem);
  line-height: .88;
  margin: .2rem 0 1rem;
  letter-spacing: -0.06em;
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  line-height: 1.7;
  max-width: 760px;
}

.hero-bolt {
  width: clamp(110px, 18vw, 210px);
  filter: drop-shadow(0 0 28px rgba(0, 212, 255, .45));
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

.hero-points span {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: .7rem .95rem;
  color: #d9f7ff;
}

.wizard-card { padding: clamp(1rem, 4vw, 2rem); }
.wizard-head {
  display: grid;
  grid-template-columns: 1fr minmax(210px, 320px);
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.eyebrow {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: .34em;
  text-transform: uppercase;
  font-size: .78rem;
  margin: 0 0 .6rem;
}

.muted { color: var(--muted); line-height: 1.65; }

.progress-wrap span { color: var(--muted); font-weight: 800; }
.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .55rem;
  background: rgba(255,255,255,.08);
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
  transition: width .32s ease;
}

.step-tabs {
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
}

.step-tabs button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.045);
  border-radius: 999px;
  padding: .72rem 1rem;
  white-space: nowrap;
  cursor: pointer;
}

.step-tabs button.active {
  color: #001018;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 900;
}

.form-step { display: none; animation: rise .32s ease both; }
.form-step.active { display: block; }
.form-step h3 {
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  margin: .2rem 0 1.2rem;
}

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label, fieldset {
  display: block;
  color: #dceaf4;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
}

input, select, textarea {
  width: 100%;
  margin-top: .5rem;
  color: var(--text);
  background: rgba(3, 11, 17, .72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: .95rem 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, .14);
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem;
  background: rgba(255,255,255,.04);
}

.choice-card legend { color: var(--blue); padding: 0 .4rem; }
.choice-card label, .checkline {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  font-weight: 700;
  color: var(--muted);
}

.choice-card input, .checkline input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  margin-top: .05rem;
}

.state-panel {
  border: 1px solid rgba(0, 212, 255, .28);
  border-radius: 22px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 212, 255, .08);
}

.state-panel.no-tax { border-color: rgba(53, 231, 159, .38); background: rgba(53, 231, 159, .08); }
.state-panel strong { color: var(--text); font-size: 1.1rem; }
.state-panel span { color: var(--green); font-weight: 800; }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.upload-box {
  min-height: 132px;
  border: 1px dashed rgba(0, 212, 255, .42);
  border-radius: 24px;
  padding: 1rem;
  background: rgba(0, 212, 255, .055);
  cursor: pointer;
}

.upload-box input { margin-top: 1rem; padding: .75rem; }
.upload-box.has-file::after {
  content: "Selected: " attr(data-file);
  display: block;
  margin-top: .6rem;
  color: var(--green);
  font-size: .9rem;
}

.review-box {
  border-radius: 24px;
  padding: 1rem;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.primary-btn, .secondary-btn, .small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .95rem 1.25rem;
  text-decoration: none;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: .02em;
}

.primary-btn {
  color: #001018;
  background: linear-gradient(135deg, var(--blue), #3de8ff);
  box-shadow: 0 14px 34px rgba(0, 212, 255, .22);
}

.secondary-btn, .small-btn {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}

.submit-btn { display: none; }
.notice {
  border-radius: 18px;
  padding: 1rem;
  margin: 1rem 0;
  font-weight: 800;
}
.notice.success { color: var(--green); background: rgba(53,231,159,.11); border: 1px solid rgba(53,231,159,.35); }
.notice.error { color: #ffd8df; background: rgba(255,107,122,.13); border: 1px solid rgba(255,107,122,.34); }
.notice.compact {
  color: #d9f7ff;
  background: rgba(0, 212, 255, .08);
  border: 1px solid rgba(0, 212, 255, .28);
  margin-top: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.section-title-row h3 { margin-bottom: 0; }

.info-btn {
  border: 1px solid rgba(0, 212, 255, .4);
  border-radius: 999px;
  padding: .7rem 1rem;
  color: var(--blue);
  background: rgba(0, 212, 255, .08);
  cursor: pointer;
  font-weight: 950;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 4, 8, .72);
  backdrop-filter: blur(16px);
}

.modal-backdrop[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal-card {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(0, 212, 255, .24);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(20, 45, 58, .98), rgba(5, 14, 21, .98));
  box-shadow: 0 32px 90px rgba(0,0,0,.55);
  padding: clamp(1.2rem, 5vw, 2rem);
}

.modal-card h2 {
  font-size: clamp(1.8rem, 6vw, 3.1rem);
  line-height: .95;
  letter-spacing: -.04em;
  margin: 0 0 1rem;
}

.modal-card p,
.modal-card li {
  color: var(--muted);
  line-height: 1.6;
}

.modal-card ul {
  padding-left: 1.2rem;
  margin-bottom: 1.4rem;
}

.modal-close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255,255,255,.07);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.footer { padding: 2rem; color: var(--muted); text-align: center; }

.install-body, .admin-login-body, .success-shell {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.install-shell, .login-card, .success-card {
  width: min(760px, 100%);
  padding: clamp(1.2rem, 5vw, 2.5rem);
}

.install-logo, .login-card img { width: 170px; max-width: 60%; margin-bottom: 1rem; }

.admin-body {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.4rem;
  background: rgba(2, 10, 15, .88);
  border-right: 1px solid var(--line);
}

.admin-sidebar img { width: 190px; max-width: 100%; margin-bottom: 1.5rem; }
.admin-sidebar a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  border-radius: 16px;
  padding: .9rem 1rem;
  margin-bottom: .4rem;
  font-weight: 800;
}
.admin-sidebar a.active, .admin-sidebar a:hover { color: var(--text); background: rgba(0, 212, 255, .12); }

.admin-main { padding: clamp(1rem, 4vw, 3rem); min-width: 0; }
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.card { padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1rem; }
.stat span { color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; }
.stat strong { display: block; font-size: clamp(2rem, 5vw, 4rem); margin-top: .5rem; }
.filter-row {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 22px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.admin-table th { color: var(--blue); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  color: var(--muted);
}

.record-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
}
.record-actions form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
.record-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .85rem;
  background: rgba(255,255,255,.035);
  overflow-wrap: anywhere;
}
.record-grid span { display: block; color: var(--muted); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .35rem; }
.record-grid strong { font-weight: 800; }

.file-list {
  display: grid;
  gap: .7rem;
}
.file-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,.04);
}

.success-card { text-align: center; }
.success-bolt { width: 110px; filter: drop-shadow(0 0 28px rgba(0, 212, 255, .5)); }
.checkmark {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin: 1rem auto;
  border-radius: 50%;
  background: var(--green);
  color: #001018;
  font-size: 3rem;
  font-weight: 1000;
  box-shadow: 0 0 40px rgba(53, 231, 159, .35);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero-card, .wizard-head, .grid.two, .grid.three, .grid.four, .upload-grid, .record-grid {
    grid-template-columns: 1fr;
  }
  .hero-bolt { justify-self: center; }
  .secure-pill { display: none; }
  .admin-body { display: block; }
  .admin-sidebar {
    position: relative;
    height: auto;
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    align-items: center;
  }
  .admin-sidebar img { width: 130px; margin: 0 1rem 0 0; }
  .admin-sidebar a { white-space: nowrap; margin: 0; }
  .filter-row { grid-template-columns: 1fr; }
  .admin-top { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; }
  .brand { align-items: flex-start; font-size: .85rem; }
  .brand img { width: 78px; }
  .onboarding-shell { width: min(100% - 1rem, 1180px); margin-top: .8rem; }
  .hero-card, .wizard-card, .card, .install-shell, .login-card, .success-card { border-radius: 24px; }
  .wizard-actions { position: sticky; bottom: 0; z-index: 15; background: rgba(3, 10, 14, .86); backdrop-filter: blur(18px); margin: 0 -1rem -1rem; padding: 1rem; }
  .primary-btn, .secondary-btn { width: 100%; }
  .choice-card label, .checkline { font-size: .95rem; }
}
