
:root {
  color-scheme: dark;
  --bg: #07110f;
  --panel: rgba(13, 29, 25, 0.82);
  --line: rgba(161, 224, 199, 0.16);
  --line-strong: rgba(161, 224, 199, 0.28);
  --text: #eef8f3;
  --muted: #9bb4a9;
  --accent: #6ce6ae;
  --warning: #ffc56f;
  --danger: #ff7c7c;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(24, 119, 82, 0.18), transparent 34rem),
    linear-gradient(145deg, #07110f 0%, #081813 55%, #07110f 100%);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ambient {
  position: fixed; width: 34rem; height: 34rem; border-radius: 50%;
  filter: blur(110px); opacity: .09; pointer-events: none;
}
.ambient-one { top: 8rem; right: -16rem; background: #6ce6ae; }
.ambient-two { bottom: -20rem; left: -14rem; background: #1c6e54; }
.topbar {
  width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-actions, .user-menu { display: flex; align-items: center; gap: 14px; }
.user-menu {
  padding-right: 14px; border-right: 1px solid var(--line);
  color: #cfe2d9; font-size: .76rem;
}
.user-menu[hidden] { display: none; }
.user-menu button {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); background: rgba(255, 255, 255, .03); cursor: pointer;
}
.user-menu button:hover { border-color: var(--line-strong); color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(108, 230, 174, .45); border-radius: 13px;
  color: #06110d; background: linear-gradient(135deg, #a4f2cc, #3fcb8c);
  font-weight: 900; box-shadow: 0 10px 30px rgba(38, 190, 124, .18);
}
.brand strong { display: block; letter-spacing: -.02em; font-size: 1.08rem; }
.brand small {
  display: block; margin-top: 2px; color: var(--muted);
  font-size: .72rem; letter-spacing: .05em;
}
.connection-state {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--muted); font-size: .82rem;
}
.connection-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #60736b;
  box-shadow: 0 0 0 5px rgba(96, 115, 107, .1);
}
.connection-state[data-tone="ok"] .connection-dot {
  background: var(--accent); box-shadow: 0 0 0 5px rgba(108, 230, 174, .12);
}
.connection-state[data-tone="error"] .connection-dot {
  background: var(--danger); box-shadow: 0 0 0 5px rgba(255, 124, 124, .12);
}
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto 50px; }
.shell[hidden] { display: none; }
.auth-shell {
  width: min(520px, calc(100% - 40px)); min-height: calc(100vh - 155px);
  margin: 0 auto; display: grid; place-items: center; padding: 42px 0 70px;
}
.auth-shell[hidden] { display: none; }
.auth-panel { width: 100%; padding: 34px; }
.auth-panel h1 {
  margin: 0; font-size: clamp(2rem, 7vw, 3.35rem); line-height: 1.02;
  letter-spacing: -.045em;
}
.auth-panel > p:not(.section-kicker) {
  margin: 20px 0 0; color: var(--muted); line-height: 1.65;
}
.auth-panel > small { display: block; margin-top: 18px; color: #6e857b; line-height: 1.5; }
.hero {
  padding: 64px 0 48px; display: grid; grid-template-columns: 1.4fr .85fr;
  gap: 60px; align-items: end;
}
.eyebrow, .section-kicker {
  margin: 0 0 10px; color: var(--accent); text-transform: uppercase;
  letter-spacing: .16em; font-size: .7rem; font-weight: 800;
}
.hero h1 {
  margin: 0; max-width: 760px; font-size: clamp(2.35rem, 6vw, 4.75rem);
  line-height: .98; letter-spacing: -.055em; font-weight: 750;
}
.hero h1 span { color: #9eb3aa; }
.hero-copy {
  max-width: 650px; margin: 24px 0 0; color: var(--muted);
  line-height: 1.7; font-size: 1rem;
}
.flow {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.flow li {
  min-height: 76px; padding: 15px; display: flex; flex-direction: column;
  justify-content: space-between; border: 1px solid var(--line); border-radius: 16px;
  color: #dcebe4; background: rgba(9, 24, 19, .56); font-size: .83rem;
}
.flow li span {
  color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
}
.workspace-grid {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 18px; align-items: stretch;
}
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.billing-panel {
  margin: 0 0 18px; padding: 28px;
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 34px; align-items: start;
}
.billing-panel[hidden], .billing-form[hidden] { display: none; }
.billing-description {
  max-width: 620px; margin: 18px 0 0; color: var(--muted); line-height: 1.65;
}
.billing-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin: 22px 0;
}
.billing-metrics div {
  min-width: 0; padding: 13px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(255, 255, 255, .025);
}
.billing-metrics dt {
  color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
}
.billing-metrics dd { margin: 7px 0 0; font-weight: 800; overflow-wrap: anywhere; }
.billing-form {
  padding: 22px; border: 1px solid var(--line); border-radius: 18px;
  background: rgba(4, 15, 12, .42);
}
.billing-form-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  margin-bottom: 8px;
}
.billing-form-heading h3 { margin: 0; font-size: 1.1rem; }
.billing-location-row { grid-template-columns: 1fr .72fr .9fr; }
.privacy-note {
  margin: 6px 0 18px; color: #789187; font-size: .75rem; line-height: 1.55;
}
.billing-summary > .notice { margin-top: 14px; }
.scan-panel, .current-panel { padding: 28px; }
.panel-heading, .history-heading {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.panel h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.secure-note {
  padding: 7px 10px; border: 1px solid rgba(108, 230, 174, .2);
  border-radius: 999px; color: #bdebd3; background: rgba(34, 120, 83, .13);
  font-size: .68rem; white-space: nowrap;
}
form { margin-top: 27px; }
.field-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.field { display: grid; gap: 9px; margin-bottom: 17px; }
.field > span { color: #d9e9e1; font-size: .79rem; font-weight: 700; }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
.field small { color: #789085; font-size: .69rem; line-height: 1.45; }
input, select {
  width: 100%; height: 48px; border: 1px solid var(--line-strong);
  border-radius: 13px; outline: none; padding: 0 14px; color: var(--text);
  background: rgba(5, 15, 12, .68);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #5f746b; }
input:focus, select:focus {
  border-color: rgba(108, 230, 174, .72);
  box-shadow: 0 0 0 4px rgba(108, 230, 174, .08);
  background: rgba(7, 20, 16, .9);
}
.primary-action, .secondary-action, .pagination button, .icon-action {
  border: 0; border-radius: 13px; cursor: pointer;
  transition: transform .18s, opacity .18s, border-color .18s, background .18s;
}
.primary-action {
  width: 100%; min-height: 50px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  color: #04100b; background: linear-gradient(135deg, #8ef0c0, #3ac888);
  font-weight: 850; box-shadow: 0 16px 38px rgba(48, 193, 128, .17);
}
.primary-action:hover:not(:disabled), .secondary-action:hover:not(:disabled) {
  transform: translateY(-1px);
}
button:disabled { cursor: not-allowed; opacity: .42; }
.notice {
  margin: 4px 0 15px; padding: 12px 14px; border-radius: 12px;
  color: #bdd2c8; background: rgba(116, 142, 130, .1);
  font-size: .78rem; line-height: 1.5;
}
.notice[data-tone="error"] { color: #ffd1d1; background: rgba(255, 124, 124, .1); }
.notice[data-tone="success"] { color: #c9f6df; background: rgba(108, 230, 174, .1); }
.current-panel {
  display: flex; flex-direction: column; min-height: 100%;
  background: linear-gradient(160deg, rgba(17, 47, 38, .92), rgba(10, 25, 21, .92));
}
.current-panel[hidden] { display: none; }
.status-badge {
  padding: 7px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800;
  background: rgba(114, 183, 255, .12); color: #a9d3ff;
}
.status-badge[data-status="completed"], .status-badge[data-status="active"] {
  background: rgba(108, 230, 174, .12); color: #b8f2d3;
}
.status-badge[data-status="failed"], .status-badge[data-status="not_provisioned"],
.status-badge[data-status="expired"] {
  background: rgba(255, 124, 124, .12); color: #ffc2c2;
}
.status-badge[data-status="running"], .status-badge[data-status="pending"],
.status-badge[data-status="invited"] {
  background: rgba(255, 197, 111, .12); color: #ffdaa2;
}
.current-target {
  margin: 27px 0 14px; color: #d9e9e1; line-height: 1.45; overflow-wrap: anywhere;
}
.progress-track {
  height: 4px; margin-bottom: 26px; overflow: hidden;
  border-radius: 999px; background: rgba(255, 255, 255, .06);
}
.progress-track span {
  display: block; width: 20%; height: 100%; border-radius: inherit;
  background: var(--accent); transition: width .45s ease;
}
.progress-track span[data-status="running"] { width: 64%; }
.progress-track span[data-status="completed"] { width: 100%; }
.progress-track span[data-status="failed"] { width: 100%; background: var(--danger); }
.score-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px;
}
.score-grid div {
  min-height: 76px; padding: 13px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(2, 11, 8, .24);
}
.score-grid dt { color: var(--muted); font-size: .66rem; }
.score-grid dd {
  margin: 9px 0 0; font-weight: 800; font-size: 1.04rem; overflow-wrap: anywhere;
}
.job-error {
  margin: 0 0 14px; color: #ffc4c4; font-size: .75rem; line-height: 1.5;
}
.secondary-action {
  margin-top: auto; min-height: 46px; padding: 0 16px;
  border: 1px solid rgba(108, 230, 174, .28);
  color: #c9f4dd; background: rgba(108, 230, 174, .07); font-weight: 800;
}
.history-panel { margin-top: 18px; padding: 28px; }
.history-controls { display: flex; gap: 9px; }
.history-controls select { min-width: 170px; height: 40px; font-size: .76rem; }
.icon-action {
  width: 40px; height: 40px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); font-size: 1rem;
}
.icon-action:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }
.history-columns, .history-item {
  display: grid; grid-template-columns: minmax(260px, 2fr) .8fr .8fr .7fr;
  gap: 14px; align-items: center;
}
.history-columns {
  padding: 24px 16px 10px; color: #70887d; text-transform: uppercase;
  letter-spacing: .09em; font-size: .61rem;
}
.history-item { min-height: 72px; padding: 13px 16px; border-top: 1px solid var(--line); }
.history-target strong {
  display: block; max-width: 100%; overflow: hidden; color: #dcebe4;
  text-overflow: ellipsis; white-space: nowrap; font-size: .82rem;
}
.history-target small {
  display: block; margin-top: 5px; color: #728a7f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .63rem;
}
.history-status {
  width: fit-content; padding: 6px 9px; border-radius: 999px;
  color: #a9d3ff; background: rgba(114, 183, 255, .1);
  font-size: .67rem; font-weight: 750;
}
.history-status[data-status="completed"] {
  color: #b8f2d3; background: rgba(108, 230, 174, .1);
}
.history-status[data-status="failed"] {
  color: #ffc2c2; background: rgba(255, 124, 124, .1);
}
.history-status[data-status="running"] {
  color: #ffdaa2; background: rgba(255, 197, 111, .1);
}
.history-risk { color: #cbded5; font-size: .78rem; }
.download-action {
  width: fit-content; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 10px; color: #bfe9d3; background: transparent;
  cursor: pointer; font-size: .69rem; font-weight: 750;
}
.download-action:hover {
  border-color: rgba(108, 230, 174, .44); background: rgba(108, 230, 174, .06);
}
.pending-copy { color: #6f857b; font-size: .7rem; }
.empty-state { padding: 48px 20px 35px; text-align: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state > span { display: block; margin-bottom: 12px; color: var(--accent); font-size: 2rem; }
.empty-state strong { color: #dcebe4; }
.empty-state p { margin: 8px 0 0; font-size: .78rem; }
.pagination {
  padding-top: 19px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
}
.pagination button {
  padding: 9px 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025); font-size: .72rem;
}
.pagination span { color: #728a7f; font-size: .69rem; }
footer {
  width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 35px;
  display: flex; justify-content: space-between; color: #587067; font-size: .68rem;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 45px; }
  .flow { max-width: 560px; }
  .billing-panel { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .current-panel { min-height: 420px; }
  .history-columns, .history-item {
    grid-template-columns: minmax(180px, 1.7fr) .8fr .7fr .7fr;
  }
}
@media (max-width: 640px) {
  .topbar, .shell, footer { width: min(100% - 24px, 1180px); }
  .topbar { padding-top: 18px; }
  .brand small, .connection-state span:last-child, .user-menu > span { display: none; }
  .topbar-actions { gap: 8px; }
  .user-menu { padding-right: 8px; }
  .auth-shell { width: min(100% - 24px, 520px); min-height: calc(100vh - 130px); }
  .auth-panel { padding: 24px; border-radius: 18px; }
  .hero { padding: 40px 0 33px; }
  .hero h1 { font-size: clamp(2.25rem, 12vw, 3.5rem); }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li { min-height: 68px; }
  .billing-panel, .scan-panel, .current-panel, .history-panel { padding: 20px; border-radius: 18px; }
  .panel-heading { align-items: center; }
  .secure-note { display: none; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .billing-metrics { grid-template-columns: 1fr 1fr; }
  .billing-location-row { grid-template-columns: 1fr; }
  .history-heading { align-items: flex-end; }
  .history-controls select { min-width: 136px; }
  .history-columns { display: none; }
  .history-list { margin-top: 18px; }
  .history-item { grid-template-columns: 1fr auto; gap: 12px; padding: 15px 3px; }
  .history-target { grid-column: 1 / -1; }
  .history-risk { justify-self: end; }
  .download-action, .pending-copy {
    grid-column: 1 / -1; width: 100%; text-align: center;
  }
  footer { display: grid; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
