:root {
  color-scheme: dark;
  --bg: #07101b;
  --bg-deep: #040a11;
  --surface: rgba(15, 27, 42, 0.9);
  --surface-strong: #111f30;
  --surface-soft: rgba(23, 39, 58, 0.72);
  --border: rgba(139, 177, 218, 0.18);
  --border-strong: rgba(111, 181, 255, 0.4);
  --text: #f2f7fb;
  --text-soft: #b7c3d0;
  --text-muted: #8190a0;
  --blue: #6fb5ff;
  --blue-strong: #4398f5;
  --green: #75d9ac;
  --green-soft: rgba(117, 217, 172, 0.12);
  --amber: #ffc56f;
  --danger: #ff9c92;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Segoe UI Variable Display", "Aptos Display", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(111, 181, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 181, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 8% 0%, rgba(53, 108, 170, 0.28), transparent 32rem),
    radial-gradient(circle at 96% 85%, rgba(52, 122, 94, 0.18), transparent 30rem),
    linear-gradient(145deg, var(--bg) 0%, #050c14 70%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one {
  top: -12rem;
  left: 8%;
  background: var(--blue);
}

.ambient-two {
  right: -12rem;
  bottom: -12rem;
  background: var(--green);
}

.site-header,
.page-shell,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  border: 1px solid rgba(111, 181, 255, 0.28);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(28, 95, 162, 0.24);
}

.brand span {
  display: grid;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trust-pill,
.no-renewal-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(117, 217, 172, 0.3);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  padding: 6px 13px;
  text-transform: uppercase;
  white-space: nowrap;
}

.page-shell {
  padding: 42px 0 72px;
}

.state-card,
.login-card,
.catalog-card,
.guide-card,
.inventory-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(20, 35, 52, 0.95), rgba(8, 17, 28, 0.95));
  box-shadow: var(--shadow);
}

.state-card {
  width: min(720px, 100%);
  margin: 9vh auto 0;
  padding: clamp(32px, 6vw, 68px);
}

.state-card h1,
.login-intro h1,
.portal-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.state-card h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.state-card > p:not(.eyebrow) {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: 1.12rem;
}

.loading-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 28px;
  border: 3px solid rgba(111, 181, 255, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow-warning {
  color: var(--amber);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: clamp(32px, 6vw, 78px);
  align-items: center;
  min-height: calc(100vh - 220px);
}

.hero-copy {
  max-width: 720px;
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
}

.promise-grid article {
  display: flex;
  min-height: 138px;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(17, 31, 48, 0.55);
}

.promise-icon,
.steps > li > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #07111c;
  font-weight: 850;
}

.promise-grid strong,
.steps strong,
.not-yet-panel strong,
.safety-box strong {
  display: block;
  line-height: 1.3;
}

.promise-grid p,
.steps p,
.not-yet-panel p,
.safety-box p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.login-card {
  display: grid;
  gap: 24px;
  padding: clamp(26px, 4vw, 42px);
}

.login-card h2,
.catalog-card h2,
.guide-card h2,
.inventory-card h2,
.secure-dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
}

.login-card > div > p:not(.eyebrow),
.section-copy {
  margin: 10px 0 0;
  color: var(--text-soft);
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: #09131f;
  color: var(--text);
  padding: 12px 14px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(111, 181, 255, 0.16);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-weight: 750;
  padding: 11px 22px;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.button-primary {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  box-shadow: 0 12px 30px rgba(49, 140, 236, 0.24);
  color: #06111e;
}

.button-secondary {
  border-color: var(--border-strong);
  background: rgba(111, 181, 255, 0.1);
}

.button-quiet {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.security-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.form-error,
.inline-alert {
  border: 1px solid rgba(255, 156, 146, 0.32);
  border-radius: 12px;
  background: rgba(255, 156, 146, 0.08);
  color: var(--danger);
  padding: 12px 14px;
}

.portal-layout {
  display: grid;
  gap: 26px;
}

.portal-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.portal-hero h1 {
  font-size: clamp(2.6rem, 6vw, 5.5rem);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(2, 1fr);
  gap: 14px;
}

.summary-card {
  display: grid;
  min-height: 144px;
  align-content: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.summary-card span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.summary-card strong {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.summary-card small {
  margin-top: 5px;
  color: var(--green);
}

.summary-identity {
  border-color: rgba(117, 217, 172, 0.24);
  background:
    linear-gradient(135deg, rgba(117, 217, 172, 0.1), transparent 70%),
    var(--surface-soft);
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.catalog-card,
.guide-card {
  padding: clamp(24px, 4vw, 40px);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.product-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.4fr);
  gap: 20px;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 181, 255, 0.14), transparent 48%),
    rgba(11, 23, 37, 0.86);
  padding: 24px;
}

.product-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.product-card .term {
  margin: 5px 0 0;
  color: var(--text-soft);
}

.unit-price {
  margin: 18px 0 0;
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 750;
}

.product-total {
  display: grid;
  gap: 8px;
}

.product-total label {
  margin: 0;
}

.total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
}

.total-line strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.availability-note {
  margin: 4px 0 0;
  color: var(--amber);
  font-size: 0.88rem;
}

.product-order-button {
  width: 100%;
  margin-top: 8px;
}

.order-panel {
  margin-bottom: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 12%, rgba(117, 217, 172, 0.12), transparent 36%),
    linear-gradient(140deg, rgba(111, 181, 255, 0.1), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}

.order-status-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.order-status-heading h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.035em;
}

.order-state-pill {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 9px 13px;
  text-transform: uppercase;
}

.order-state-pill[data-state="fulfilled"] {
  border-color: rgba(117, 217, 172, 0.32);
  background: var(--green-soft);
  color: var(--green);
}

.order-state-pill[data-state="expired"],
.order-state-pill[data-state="failed"],
.order-state-pill[data-state="support"] {
  border-color: rgba(255, 156, 146, 0.32);
  background: rgba(255, 156, 146, 0.08);
  color: var(--red);
}

.order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.order-summary div {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(8, 17, 28, 0.55);
  padding: 15px;
}

.order-summary dt {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.order-summary dd {
  margin: 6px 0 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 750;
}

.order-truth {
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--blue-soft);
  color: var(--text-soft);
  padding: 14px 16px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.not-yet-panel {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid rgba(255, 197, 111, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 197, 111, 0.07);
  padding: 18px;
}

.status-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(255, 197, 111, 0.1);
}

.steps {
  display: grid;
  gap: 20px;
  margin: 30px 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 14px;
}

.safety-box {
  border: 1px solid rgba(117, 217, 172, 0.24);
  border-radius: var(--radius-md);
  background: var(--green-soft);
  padding: 18px;
}

.inventory-card {
  padding: clamp(24px, 4vw, 40px);
}

.inventory-heading {
  align-items: center;
}

.inventory-heading .section-copy {
  max-width: 680px;
}

.inventory-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.inventory-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 17, 28, 0.62);
  padding: 18px;
}

.inventory-item[data-state="available"] {
  border-color: rgba(117, 217, 172, 0.28);
  background:
    linear-gradient(110deg, rgba(117, 217, 172, 0.08), transparent 55%),
    rgba(8, 17, 28, 0.68);
}

.inventory-select {
  width: 22px;
  min-height: 22px;
  min-width: 22px;
  accent-color: var(--blue);
}

.inventory-copy {
  min-width: 0;
}

.inventory-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.inventory-code {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--green);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.92rem;
}

.inventory-meta {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.inventory-actions {
  display: flex;
  justify-content: end;
}

.inventory-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-soft);
  padding: 28px;
  text-align: center;
}

.secure-dialog {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  width: min(620px, calc(100% - 32px));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  outline: none;
  background:
    radial-gradient(circle at 100% 100%, rgba(117, 217, 172, 0.12), transparent 45%),
    #0d1927;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  color: var(--text);
  padding: clamp(24px, 5vw, 42px);
}

.secure-dialog:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.secure-dialog::backdrop {
  background: rgba(2, 7, 13, 0.82);
  backdrop-filter: blur(8px);
}

.secure-dialog form,
.secure-dialog > div {
  display: grid;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.dialog-actions .button-primary {
  margin-top: 0;
}

.revealed-code {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(117, 217, 172, 0.3);
  border-radius: var(--radius-md);
  background: rgba(117, 217, 172, 0.08);
  color: var(--green);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 750;
  padding: 18px;
  text-align: center;
}

.revealed-product {
  margin: 0;
  color: var(--text-soft);
  text-align: center;
}

.export-warning {
  border: 1px solid rgba(255, 197, 111, 0.32);
  border-radius: var(--radius-md);
  background: rgba(255, 197, 111, 0.08);
  color: var(--amber);
  padding: 16px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 24px 0 34px;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .login-layout,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .login-layout {
    min-height: auto;
  }

  .promise-grid,
  .summary-grid,
  .order-summary {
    grid-template-columns: 1fr;
  }

  .promise-grid article {
    min-height: auto;
  }

  .portal-hero {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header,
  .page-shell,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    min-height: 80px;
  }

  .trust-pill {
    display: none;
  }

  .page-shell {
    padding-top: 24px;
  }

  .state-card {
    margin-top: 3vh;
    border-radius: 22px;
  }

  .product-card {
    grid-template-columns: 1fr;
  }

  .inventory-heading,
  .inventory-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .inventory-select {
    width: 22px;
  }

  .inventory-actions {
    justify-content: stretch;
  }

  .inventory-actions .button,
  .inventory-heading .button {
    width: 100%;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .order-status-heading {
    flex-direction: column;
  }

  .order-actions,
  .order-actions .button {
    width: 100%;
  }

  .portal-actions,
  .portal-actions .button {
    width: 100%;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .site-header,
  .page-shell,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .secure-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    padding: 22px 18px;
  }

  .dialog-actions,
  .dialog-actions .button,
  .inventory-actions,
  .inventory-actions .button {
    width: 100%;
  }

  .button {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
