:root {
  color-scheme: light;
  --brand-deep: #004e31;
  --brand: #006940;
  --highlight: #7dc242;
  --tim-gold: #c59b42;
  --ink: #173228;
  --muted: #5d7168;
  --line: #d9e2dc;
  --surface: #ffffff;
  --canvas: #f2f5f2;
  --success: #006940;
  --error: #b42318;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 12%, rgba(125, 194, 66, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(0, 105, 64, 0.045) 0 22%, transparent 22% 100%),
    var(--canvas);
  min-height: 100vh;
}

button, input, select { font: inherit; }

.topbar {
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: white;
  border-bottom: 4px solid var(--highlight);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
}

.brand-logo { width: 46px; height: 46px; display: block; object-fit: contain; }

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; letter-spacing: 0.08em; }
.brand small { margin-top: 1px; font-size: 0.72rem; color: #c9e6d9; }
.product-logo { display: block; width: min(260px, 34vw); height: 54px; object-fit: contain; object-position: right center; }

main {
  width: min(1160px, calc(100% - 40px));
  margin: 54px auto 64px;
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(560px, 1.35fr);
  gap: 72px;
  align-items: start;
}

.intro { padding-top: 54px; position: sticky; top: 24px; }
.eyebrow { margin: 0 0 14px; color: var(--brand); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; }
h1 { margin: 0; color: var(--brand-deep); font-size: clamp(2.1rem, 4vw, 3.55rem); line-height: 1.02; letter-spacing: -0.045em; }
.intro > p:not(.eyebrow) { margin: 24px 0; color: var(--muted); font-size: 1.04rem; line-height: 1.65; max-width: 38rem; }
.serial-example { margin-top: 34px; display: inline-grid; gap: 6px; padding: 16px 20px; border-left: 4px solid var(--highlight); background: rgba(255,255,255,0.72); }
.serial-example span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.serial-example strong { color: var(--brand-deep); font: 700 1.16rem/1.2 "Courier New", monospace; letter-spacing: 0.08em; }

.workspace {
  background: var(--surface);
  border: 1px solid rgba(0, 105, 64, 0.12);
  box-shadow: 0 24px 70px rgba(0, 78, 49, 0.12);
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.step { min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #89969e; font-size: 0.86rem; }
.step b { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #bdc7cd; border-radius: 50%; font-size: 0.74rem; }
.step.active { color: var(--brand-deep); font-weight: 700; background: #f4faef; }
.step.active b { color: var(--brand-deep); background: var(--highlight); border-color: var(--highlight); }

form { padding: 36px 42px 42px; }
fieldset { margin: 0 0 32px; padding: 0; border: 0; }
legend { width: 100%; padding: 0 0 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--brand-deep); font-weight: 800; font-size: 1.06rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.span-2 { grid-column: span 2; }
.field { display: grid; gap: 8px; align-content: start; }
.field > span { font-size: 0.88rem; font-weight: 700; color: #324653; }
.field em { color: #83919a; font-weight: 400; font-style: normal; }
input, select { width: 100%; min-height: 47px; border: 1px solid #bdc9cf; border-radius: 5px; padding: 10px 12px; color: var(--ink); background: white; transition: border-color 150ms, box-shadow 150ms; }
input:focus, select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 105, 64, 0.14); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); }
.serial-field input { font: 700 1.08rem/1 "Courier New", monospace; text-transform: uppercase; letter-spacing: 0.07em; }
.field small:not(.error) { color: var(--muted); font-size: 0.76rem; }
.error { min-height: 0; color: var(--error); font-size: 0.76rem; line-height: 1.35; }
.error:empty { display: none; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 0; color: #425661; font-size: 0.86rem; line-height: 1.5; cursor: pointer; }
.consent input { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.consent-error { display: block; margin: 4px 0 0 30px; }
.alert { margin-top: 20px; padding: 13px 15px; border-left: 4px solid var(--error); background: #fff1f0; color: #81231b; font-size: 0.88rem; }
.primary-button { width: 100%; min-height: 52px; margin-top: 24px; border: 0; border-radius: 5px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--brand); font-weight: 800; cursor: pointer; box-shadow: 0 7px 0 var(--brand-deep); transition: transform 120ms, box-shadow 120ms, background 120ms; }
.primary-button:hover { background: #007b4b; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--brand-deep); }
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.result { padding: 52px 42px 44px; text-align: center; }
.result-status { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.result-status span { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(22, 112, 75, 0.12); }
.result-label { margin: 32px 0 12px; color: var(--muted); font-size: 0.88rem; }
#license-output { display: block; color: var(--brand-deep); font: 800 clamp(1.8rem, 5vw, 2.55rem)/1.2 "Courier New", monospace; letter-spacing: 0.105em; overflow-wrap: anywhere; }
.result dl { margin: 34px 0; border-block: 1px solid var(--line); }
.result dl div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.result dl div + div { border-top: 1px solid var(--line); }
.result dt { color: var(--muted); font-size: 0.82rem; }
.result dd { margin: 0; color: var(--brand-deep); font-weight: 700; }
.result-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.email-status { margin: 22px 0 0; padding: 13px 16px; border-radius: 8px; background: #eef7e9; color: var(--brand-deep); font-size: 0.88rem; font-weight: 700; line-height: 1.45; }
.email-status[data-status="failed"] { background: #fff4df; color: #7a4a00; }
.secondary-button, .text-button, .new-request { min-height: 47px; border-radius: 5px; padding: 10px 16px; cursor: pointer; font-weight: 700; }
.secondary-button { border: 1px solid var(--brand); color: white; background: var(--brand); }
.text-button { border: 1px solid #b9cec2; color: var(--brand-deep); background: white; }
.support-note { margin: 24px auto; color: var(--muted); font-size: 0.82rem; line-height: 1.55; max-width: 30rem; }
.new-request { border: 0; background: transparent; color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }

footer { min-height: 72px; width: min(1160px, calc(100% - 40px)); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #cbd8d1; color: var(--muted); font-size: 0.78rem; }
footer a { color: var(--brand); font-weight: 700; text-decoration: none; }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

[hidden] { display: none !important; }

@media (max-width: 980px) {
  main { grid-template-columns: 1fr; gap: 34px; margin-top: 32px; }
  .intro { position: static; padding-top: 0; }
  .intro > p:not(.eyebrow) { max-width: 48rem; }
}

@media (max-width: 620px) {
  .topbar { min-height: 68px; padding-inline: 20px; }
  .product-logo { width: min(190px, 46vw); height: 44px; }
  main { width: min(100% - 24px, 560px); margin-bottom: 40px; }
  h1 { font-size: 2.3rem; }
  .step { font-size: 0; min-height: 52px; }
  .step b { font-size: 0.74rem; }
  form, .result { padding: 30px 22px 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .result-actions { grid-template-columns: 1fr; }
  footer { width: calc(100% - 32px); flex-direction: column; justify-content: center; gap: 8px; }
}

@media print {
  body { background: white; }
  .topbar, .intro, form, .steps, footer, .result-actions, .new-request { display: none !important; }
  main { display: block; width: 100%; margin: 0; }
  .workspace { border: 0; box-shadow: none; }
  .result { display: block !important; padding-top: 24mm; }
}
