:root {
  --navy: #223354;
  --blue: #2970ff;
  --cyan: #00c8ff;
  --bg: #eef2f8;
  --card: #ffffff;
  --panel: #f7f9fc;
  --text: #1a2640;
  --muted: #56627a;
  --line: #dbe2ee;
  --link: #1f5fe0;
  --code-bg: #f3f6fb;
  --notice-bg: #fff6e5;
  --notice-line: #f0c46b;
  --notice-text: #5c4210;
  --error-bg: #fdecec;
  --error-line: #f1a7a7;
  --error-text: #8a1c1c;
  --focus: #2970ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1424;
    --card: #15203a;
    --panel: #111b32;
    --text: #e8eef9;
    --muted: #a3b0c8;
    --line: #26355a;
    --link: #6cc6ff;
    --code-bg: #0f182e;
    --notice-bg: #2a2412;
    --notice-line: #7a6326;
    --notice-text: #f1dfb2;
    --error-bg: #3a1618;
    --error-line: #7d2f33;
    --error-text: #ffc9c9;
    --focus: #5ad8ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 4vw, 48px) 16px 24px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: var(--link);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- card */

.card {
  width: 100%;
  max-width: 1080px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 48px) clamp(22px, 3.5vw, 40px);
  box-shadow: 0 10px 30px rgba(20, 35, 70, 0.08);
}

.card-narrow {
  max-width: 520px;
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.brand picture {
  display: block;
  width: 260px;
  max-width: 75%;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 auto 24px;
  max-width: 560px;
  text-align: center;
  color: var(--muted);
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------- Windows / Mac layout */

.jump {
  margin: -8px 0 20px;
  text-align: center;
  font-size: 15px;
}

.platforms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.mac {
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

/* Wide windows: Windows and Mac side by side */
@media (min-width: 900px) {
  .jump {
    display: none;
  }

  .platforms {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  .platform {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
  }

  .mac {
    margin-top: 0;
    border-top: 1px solid var(--line);
  }
}

.section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-intro {
  margin: -4px 0 0;
  color: var(--muted);
}

/* ------------------------------------------------------------- buttons */

.download,
.button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
  color: #ffffff;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(41, 112, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.download:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(41, 112, 255, 0.45);
}

.download:active,
.button:active {
  transform: translateY(0);
}

.button {
  font-size: 19px;
  font-weight: 700;
  padding: 15px 20px;
}

.download-label {
  font-size: 20px;
  font-weight: 700;
}

.download-meta {
  font-size: 14px;
  opacity: 0.92;
}

.mac-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 8px;
}

.download-small {
  padding: 12px 10px;
}

.download-small .download-label {
  font-size: 17px;
}

.download-small .download-meta {
  font-size: 13px;
}

.button-small {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.button-small:hover {
  border-color: var(--blue);
}

/* --------------------------------------------------------------- steps */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 28px 0 0;
  padding: 0;
}

.mac .steps {
  margin-top: 20px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 52px;
}

.steps li:last-child {
  padding-bottom: 4px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .steps li::before {
    background: var(--blue);
  }
}

.steps h3 {
  margin: 4px 0 2px;
  font-size: 18px;
  line-height: 1.3;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.steps p + p,
.steps .config + p {
  margin-top: 8px;
}

.steps strong {
  color: var(--text);
}

.hint {
  font-size: 15px;
}

.config {
  display: block;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px dashed var(--blue);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
  cursor: text;
}

kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ PIN form */

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
}

.pin-input {
  width: 100%;
  padding: 14px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(28px, 8vw, 36px);
  letter-spacing: 0.3em;
  text-align: center;
}

.pin-input::placeholder {
  color: var(--line);
}

.pin-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(41, 112, 255, 0.2);
}

.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--error-line);
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 15px;
}

/* --------------------------------------------------------------- admin */

.code-new {
  margin: 0 0 20px;
  padding: 18px;
  border: 2px solid var(--blue);
  border-radius: 14px;
  background: var(--code-bg);
  text-align: center;
}

.code-new-label,
.code-new-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.code-big {
  margin: 4px 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.admin-title {
  margin-top: 28px;
}

.codes {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.codes th,
.codes td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.codes th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.codes td:last-child {
  text-align: right;
}

.codes form {
  margin: 0;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------------------------------- notice/footer */

.notice {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--notice-line);
  border-radius: 10px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 15px;
}

.notice p {
  margin: 0;
}

.contact {
  margin: 20px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .download,
  .button {
    transition: none;
  }
}

/* Windows / Mac headings with icons */
.platform-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.2;
}

.platform-icon {
  flex: none;
  width: 40px;
  height: 40px;
}

.mac .platform-title + .section-intro {
  margin-top: -6px;
}

.platform-title picture {
  display: block;
  flex: none;
}

.platform-title picture .platform-icon {
  display: block;
}

/* Admin: authenticator setup */
.setup {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 15px;
}

.setup summary {
  cursor: pointer;
  font-weight: 600;
}

.setup p {
  margin: 10px 0 0;
}

/* Admin sign-in */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.login-form label {
  font-size: 15px;
  font-weight: 600;
}

.field {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--text);
  font: inherit;
}

.field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(41, 112, 255, 0.2);
}

.login-form .button {
  margin-top: 6px;
}

.admin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.admin-footer form {
  margin: 0;
}
