:root {
  color-scheme: light;
  --ink: #14213a;
  --muted: #61708a;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --line: #dce3ed;
  --navy: #0d2d5b;
  --blue: #1464d2;
  --blue-dark: #0d4fae;
  --green: #16795b;
  --green-soft: #e7f5ef;
  --red: #b42a38;
  --red-soft: #fcebee;
  --shadow: 0 18px 50px rgba(20, 33, 58, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input, select { font: inherit; }

.site-header {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(220, 227, 237, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 30px rgba(20, 33, 58, 0.06);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: white; background: linear-gradient(145deg, var(--blue), var(--navy)); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 0.1rem; color: var(--muted); font-size: 0.72rem; }
nav { display: flex; align-items: center; gap: 1rem; }
nav a, .link-button { border: 0; padding: 0; color: var(--muted); background: transparent; text-decoration: none; cursor: pointer; }
nav a:hover, .link-button:hover { color: var(--blue); }
.nav-form { display: inline; }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.hero { padding: 6rem 0 4rem; max-width: 880px; }
.hero__eyebrow, .eyebrow { margin: 0 0 0.65rem; color: var(--blue); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.hero h1, .auth-card h1, .admin-heading h1 { margin: 0; max-width: 760px; font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 0.98; letter-spacing: -0.055em; }
.hero > p { max-width: 720px; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.15rem; line-height: 1.65; }
.hero__security { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem; padding: 0.65rem 0.85rem; border: 1px solid #cde7dc; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 0.88rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22, 121, 91, 0.12); }

.downloads, .steps, .panel { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.downloads { padding: clamp(1.2rem, 4vw, 2.5rem); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }
.section-heading h2, .steps h2, .panel h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.035em; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.5; }
.release-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.release-card { min-height: 330px; display: flex; flex-direction: column; padding: 1.4rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, #fff, #f7f9fc); }
.release-card__top { display: flex; justify-content: space-between; align-items: center; }
.architecture { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; color: white; background: var(--navy); font-size: 1.4rem; font-weight: 800; }
.availability { padding: 0.35rem 0.6rem; border-radius: 999px; color: var(--muted); background: #edf1f6; font-size: 0.76rem; font-weight: 700; }
.availability--ready { color: var(--green); background: var(--green-soft); }
.release-card h3 { margin: 1.5rem 0 0.5rem; font-size: 1.35rem; }
.release-card p { flex: 1; margin: 0; color: var(--muted); line-height: 1.55; }
.release-card small { margin-top: 0.65rem; color: var(--muted); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; text-decoration: none; font-weight: 750; cursor: pointer; }
.button:hover { border-color: #b9c6d8; }
.button--primary { border-color: var(--blue); color: white; background: var(--blue); }
.button--primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button--disabled { color: #7b8799; background: #eef2f6; cursor: not-allowed; }
.button--danger { border-color: #efc3ca; color: var(--red); background: var(--red-soft); }
.button--small { min-height: 34px; padding: 0.4rem 0.65rem; font-size: 0.8rem; }

.steps { margin-top: 1rem; padding: clamp(1.2rem, 4vw, 2.5rem); }
.steps ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 0.8rem; align-items: flex-start; padding: 1rem; border-radius: 14px; background: var(--canvas); line-height: 1.5; }
.steps li strong { color: var(--blue); font-size: 1.35rem; }
code { font-family: "Cascadia Mono", Consolas, monospace; }

.auth-shell { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 4rem 0; }
.auth-card { width: min(460px, 100%); padding: 2rem; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.3rem; }
.auth-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.form-stack { display: grid; gap: 1rem; margin-top: 1.25rem; }
.form-stack label { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.form-stack input, .form-stack select { width: 100%; min-height: 46px; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; outline: none; }
.form-stack input:focus, .form-stack select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 100, 210, 0.12); }

.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 4rem 0 2rem; }
.admin-heading h1 { font-size: clamp(2.3rem, 5vw, 4.3rem); }
.admin-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.admin-identity { padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 0.85rem; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1rem; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: 1rem; align-items: start; }
.panel { padding: 1.4rem; }
.settings-summary p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.settings-note { margin-top: 1.25rem; padding: 0.9rem; border: 1px solid #cde7dc; border-radius: 12px; color: var(--green); background: var(--green-soft); line-height: 1.5; }
.form-divider { height: 1px; margin: 0.25rem 0; background: var(--line); }
.form-stack label span small, .field-hint { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.panel--code { background: linear-gradient(145deg, #0d2d5b, #124b92); color: white; }
.panel--code .eyebrow, .panel--code p { color: #c8dcfa; }
.generated-code, .empty-state { display: block; margin: 1rem 0; padding: 1rem; border: 1px dashed rgba(255, 255, 255, 0.35); border-radius: 12px; overflow-wrap: anywhere; background: rgba(255, 255, 255, 0.08); font-size: 1rem; }
.empty-state { border-color: var(--line); color: var(--muted); background: var(--canvas); }
.panel--code .empty-state { border-color: rgba(255, 255, 255, 0.3); color: #c8dcfa; background: rgba(255, 255, 255, 0.08); }
.code-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.code-meta div { padding: 0.7rem; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.code-meta dt { color: #c8dcfa; font-size: 0.72rem; }
.code-meta dd { margin: 0.25rem 0 0; overflow-wrap: anywhere; font-size: 0.82rem; }
.devices { margin-top: 1rem; }
.section-heading--compact { align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 0.65rem; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 0.86rem; }
th { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
td small { display: block; max-width: 260px; margin-top: 0.2rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.device-state { display: inline-flex; padding: 0.3rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 750; }
.device-state--active { color: var(--green); background: var(--green-soft); }
.device-state--revoked { color: var(--red); background: var(--red-soft); }
.muted { color: var(--muted); }

.flash-stack { display: grid; gap: 0.5rem; margin-top: 1rem; }
.flash { padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.flash--error { border-color: #efc3ca; color: var(--red); background: var(--red-soft); }
.flash--success { border-color: #cde7dc; color: var(--green); background: var(--green-soft); }

footer { width: min(1180px, calc(100% - 2rem)); margin: 3rem auto 0; padding: 1.5rem 0 2rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 760px) {
  .site-header, nav, .admin-heading, .section-heading, footer { align-items: flex-start; flex-direction: column; }
  nav { gap: 0.7rem; }
  .hero { padding-top: 4rem; }
  .release-grid, .steps ol, .admin-grid, .settings-grid { grid-template-columns: 1fr; }
  .release-card { min-height: 290px; }
  .code-meta { grid-template-columns: 1fr; }
}
