:root {
  --atek-red: #d20a11;
  --atek-red-dark: #a8070c;
  --ink: #171717;
  --muted: #717171;
  --line: #dedede;
  --surface: #ffffff;
  --soft: #f5f5f3;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(210, 10, 17, .08), transparent 24rem),
    #efefec;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
}

button, input { font: inherit; }

button { cursor: pointer; }

.site-header {
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--atek-red);
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}

.brand strong,
.brand small { display: block; }

.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.header-badge {
  padding: 7px 11px;
  color: #595959;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.page-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 82px) 0 70px;
}

.intro { max-width: 760px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 13px; color: var(--atek-red); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.intro h1 { margin: 0; max-width: 700px; font-size: clamp(34px, 5vw, 62px); line-height: .98; letter-spacing: -.055em; }
.intro > p:last-child { max-width: 620px; margin: 20px 0 0; color: #606060; font-size: 16px; line-height: 1.55; }

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, .85fr) minmax(560px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .06);
}

.form-panel { padding: clamp(22px, 3vw, 34px); }
.preview-panel { padding: clamp(22px, 3vw, 34px); position: sticky; top: 18px; }

.panel-heading {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-heading > div { display: flex; align-items: baseline; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.step { color: var(--atek-red); font-size: 11px; font-weight: 800; }
.text-button { padding: 3px; color: #6a6a6a; background: none; border: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

fieldset { margin: 0 0 22px; padding: 0; border: 0; }
legend, .field > span:first-child { margin-bottom: 9px; color: #333; font-size: 12px; font-weight: 800; }
legend { display: block; }

.segmented-control {
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: var(--soft);
  border-radius: 11px;
}

.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 40px; display: grid; place-items: center; border-radius: 8px; color: #626262; font-size: 13px; font-weight: 700; transition: .18s ease; }
.segmented-control input:checked + span { color: var(--ink); background: #fff; box-shadow: 0 2px 9px rgba(0, 0, 0, .09); }
.segmented-control input:focus-visible + span { outline: 2px solid var(--atek-red); outline-offset: 2px; }

.field-grid { display: grid; gap: 17px; }
.field { display: block; }
.field > span:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.field em { color: #8c8c8c; font-size: 10px; font-style: normal; font-weight: 400; }
.field input {
  width: 100%;
  height: 47px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 9px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--atek-red); box-shadow: 0 0 0 3px rgba(210, 10, 17, .1); }
.field input[aria-invalid="true"] { border-color: var(--atek-red); }
.field small { display: block; margin-top: 7px; color: #8a8a8a; font-size: 10px; line-height: 1.35; }

.email-input, .phone-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #d4d4d4;
  border-radius: 9px;
  overflow: hidden;
}
.phone-input { grid-template-columns: auto minmax(0, 1fr); }
.email-input:focus-within, .phone-input:focus-within { border-color: var(--atek-red); box-shadow: 0 0 0 3px rgba(210, 10, 17, .1); }
.email-input input, .phone-input input { border: 0; border-radius: 0; box-shadow: none !important; }
.email-input strong, .phone-input strong { padding: 0 13px; color: #656565; font-size: 12px; white-space: nowrap; }
.phone-input strong { padding-right: 0; }

.primary-button, .secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
}
.primary-button { color: #fff; background: var(--atek-red); }
.primary-button:hover { background: var(--atek-red-dark); }
.secondary-button { color: #333; background: #fff; border-color: #d4d4d4; }
#signatureForm > .primary-button { width: 100%; margin-top: 24px; }

.status-dot { display: inline-flex; align-items: center; gap: 7px; color: #6a6a6a; font-size: 11px; }
.status-dot::before { width: 7px; height: 7px; content: ""; background: #3ba55d; border-radius: 50%; box-shadow: 0 0 0 3px rgba(59, 165, 93, .12); }

.preview-stage {
  min-height: 370px;
  padding: clamp(18px, 4vw, 42px);
  display: grid;
  place-items: center;
  overflow: auto;
  background-color: #f4f4f1;
  background-image: linear-gradient(rgba(0, 0, 0, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .025) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid #e2e2df;
  border-radius: 14px;
}

.signature-preview { min-width: 440px; padding: 24px; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .08); }
.action-row { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.copy-message { min-height: 18px; margin: 9px 0 0; color: #18713b; font-size: 11px; text-align: center; }
.installation-note { margin-top: 22px; padding: 16px 18px; color: #5c5c5c; background: #f7f7f5; border-left: 3px solid var(--atek-red); font-size: 11px; line-height: 1.5; }
.installation-note strong { color: #242424; }
.installation-note p { margin: 5px 0 0; }

.site-footer {
  min-height: 70px;
  padding: 20px clamp(20px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #777;
  background: #191919;
  font-size: 10px;
}

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
}

@media (max-width: 650px) {
  .site-header { min-height: 66px; padding-inline: 16px; }
  .header-badge { display: none; }
  .page-shell { width: min(100% - 24px, 680px); padding-top: 34px; }
  .intro h1 { font-size: 38px; }
  .panel { border-radius: 14px; }
  .preview-stage { min-height: 320px; padding: 14px; justify-content: start; }
  .signature-preview { transform-origin: left center; }
  .action-row { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
