/* =========================================================================
   AsyncSig — design system
   Direction (ТЗ §10): editorial minimalism, institutional, analytical.
   Palette (ТЗ §10.2): deep navy / warm ivory / graphite / light-gray rules /
   muted gold accent reserved for Free Test.
   ========================================================================= */

:root {
  --navy:        #18233b;   /* primary */
  --navy-soft:   #2a3654;
  --ivory:       #f6f4ef;   /* warm background */
  --paper:       #fcfbf8;   /* slightly lighter card surface */
  --graphite:    #383d47;   /* body text */
  --graphite-mut:#6c707a;   /* muted text */
  --rule:        #e3e0d8;   /* dividers */
  --gold:        #ab823c;   /* muted gold — Free Test only */
  --gold-dark:   #946f2f;

  --maxw: 1120px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--graphite);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Eyebrow / section label ---- */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
}
.eyebrow .num { color: var(--navy); }
.eyebrow .sep { color: var(--graphite-mut); margin: 0 .5em; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  padding: 16px 30px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
/* Gold = primary conversion = Free Test (ТЗ §3 visual priority) */
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }

/* Outline = secondary (Memo Pack 5 must not compete with Free Test) */
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; }

.btn-block { width: 100%; text-align: center; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--ivory);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: .01em;
}
.nav { display: flex; align-items: center; gap: 34px; }
.nav a:not(.btn) {
  font-size: 15px;
  color: var(--graphite);
  text-decoration: none;
}
.nav a:not(.btn):hover { color: var(--navy); }
.nav .btn { font-size: 15px; padding: 11px 20px; }
.nav-links { display: flex; gap: 34px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
}

/* =========================================================================
   Hero (Block 1)
   ========================================================================= */
.hero { padding: 72px 0 84px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: 56px;
  line-height: 1.08;
  margin: 18px 0 24px;
  letter-spacing: -0.01em;
}
.hero .sub {
  font-size: 18px;
  color: var(--graphite);
  max-width: 30em;
  margin: 0 0 32px;
}
.hero .note {
  font-size: 14px;
  color: var(--graphite-mut);
  margin-top: 18px;
}
.hero-figure { display: flex; justify-content: center; }
.hero-figure svg { width: 100%; max-width: 480px; height: auto; }

/* =========================================================================
   Section scaffolding
   ========================================================================= */
.section { padding: 80px 0; }
.section--paper { background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section h2 {
  font-size: 38px;
  line-height: 1.15;
  margin: 14px 0 0;
  max-width: 18em;
}
.section .lead-head { margin-bottom: 48px; }

/* ---- Problem + memo (Block 2) ---- */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: start;
}
.problem-list { list-style: none; margin: 0; padding: 0; }
.problem-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.problem-list li:first-child { padding-top: 0; }
.problem-list .ico { color: var(--navy); }
.problem-list .ico svg { width: 38px; height: 38px; }
.problem-list p { margin: 0; color: var(--graphite); }

/* Memo preview card — must read like a real deliverable, not a dashboard */
.memo {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 30px 14px;
}
.memo__title {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--navy);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 6px;
}
.memo__row {
  display: grid;
  grid-template-columns: 26px 150px 1fr;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}
.memo__row:last-child { border-bottom: 0; }
.memo__row .ico { color: var(--navy); }
.memo__row .ico svg { width: 22px; height: 22px; }
.memo__label { color: var(--navy); font-weight: 600; font-size: 14px; }
.memo__lines { display: flex; flex-direction: column; gap: 7px; }
.memo__lines span { display: block; height: 6px; border-radius: 3px; background: var(--rule); }
.memo__lines span:nth-child(2) { width: 78%; }

/* =========================================================================
   How it works + Pricing (Block 3)
   ========================================================================= */
.center-head { text-align: center; }
.center-head h2 { margin-left: auto; margin-right: auto; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin: 48px 0 0;
}
.step { text-align: center; }
.step .num { font-family: var(--sans); font-weight: 700; color: var(--navy); font-size: 15px; letter-spacing: .08em; }
.step .ico { color: var(--navy); margin: 18px 0 16px; }
.step .ico svg { width: 40px; height: 40px; }
.step p { margin: 0; font-size: 15px; color: var(--graphite); }

.pricing-head { text-align: center; margin: 72px 0 36px; }
.pricing-head h2 { margin: 10px auto 0; }

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 26px;
  justify-content: center;
}
.plan {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 30px 30px 30px;
  display: flex;
  flex-direction: column;
}
/* Free Test gets the visual weight (ТЗ §3 visual priority) */
.plan--primary { border-color: var(--gold); box-shadow: 0 1px 0 var(--gold); }
.plan h3 { text-align: center; font-size: 24px; margin: 0 0 22px; }
.plan ul { list-style: none; margin: 0 0 26px; padding: 0; flex: 1; }
.plan li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; font-size: 15px; color: var(--graphite);
}
.plan li .check { color: var(--gold); flex: 0 0 auto; }
.plan--secondary li .check { color: var(--navy); }

/* =========================================================================
   Trust + FAQ + final CTA (Block 4)
   ========================================================================= */
.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  padding: 44px 0;
  border-bottom: 1px solid var(--rule);
}
.trust .item { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.trust .ico { color: var(--navy); }
.trust .ico svg { width: 28px; height: 28px; }
.trust p { margin: 0; font-size: 14px; color: var(--graphite); line-height: 1.45; }

.faq { margin-top: 56px; }
.faq h2 { font-size: 34px; margin: 0 0 14px; }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--navy);
  padding: 22px 40px 22px 0;
  cursor: pointer;
  position: relative;
}
.faq__q::after {
  content: "+";
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--graphite-mut);
}
.faq__item.open .faq__q::after { content: "\2013"; } /* en-dash when open */
.faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  color: var(--graphite);
}
.faq__a p { margin: 0 0 22px; max-width: 60em; }
.faq__item.open .faq__a { max-height: 360px; }

.final-cta { text-align: center; padding: 70px 0 64px; }
.final-cta p {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--navy);
  margin: 0 0 28px;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--ivory);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 14px;
}
.site-footer .brand { font-family: var(--serif); font-weight: 600; color: var(--navy); font-size: 17px; }
.site-footer .links { display: flex; gap: 26px; }
.site-footer a { color: var(--graphite); text-decoration: none; }
.site-footer a:hover { color: var(--navy); }

/* =========================================================================
   Forms (request.php / submit.php)
   ========================================================================= */
.form-wrap { max-width: 640px; margin: 0 auto; padding: 64px 0 96px; }
.form-wrap h1 { font-size: 38px; margin: 0 0 10px; }
.form-wrap .intro { color: var(--graphite); margin: 0 0 36px; max-width: 36em; }

.field { margin-bottom: 22px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.field .req { color: var(--gold); }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--graphite);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}
.field .hint { font-size: 13px; color: var(--graphite-mut); margin-top: 6px; }

.field--file input[type="file"] { font-size: 14px; }

.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 8px 0 28px; }
.consent input { margin-top: 4px; }
.consent label { font-weight: 400; font-size: 14px; color: var(--graphite); }

.role-toggle { display: flex; gap: 12px; margin-bottom: 30px; }
.role-toggle label {
  flex: 1;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  background: var(--paper);
}
.role-toggle input { position: absolute; opacity: 0; }
.role-toggle input:checked + label { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 1px var(--gold) inset; }

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 24px;
}
.alert--error { background: #fbeeee; border: 1px solid #e3c5c5; color: #8a3a3a; }
.alert--info  { background: #f0f2f7; border: 1px solid var(--rule); color: var(--navy); }

.errors { list-style: none; margin: 0; padding: 0; }
.errors li { margin-bottom: 4px; }

/* Confirmation state (ТЗ §5) */
.confirm { max-width: 560px; margin: 0 auto; padding: 96px 0; text-align: center; }
.confirm .ico { color: var(--navy); margin-bottom: 24px; }
.confirm .ico svg { width: 56px; height: 56px; }
.confirm h1 { font-size: 34px; margin: 0 0 14px; }
.confirm p { color: var(--graphite); font-size: 17px; margin: 0 auto 28px; max-width: 30em; }

/* Static legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 64px 0 96px; }
.legal h1 { font-size: 40px; margin: 0 0 8px; }
.legal .updated { color: var(--graphite-mut); font-size: 14px; margin-bottom: 36px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal p { margin: 0 0 14px; }

/* =========================================================================
   Responsive — single column on mobile (ТЗ §10.1)
   ========================================================================= */
@media (max-width: 860px) {
  .container { padding: 0 22px; }
  .nav { position: relative; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    flex-direction: column;
    gap: 18px;
    background: var(--ivory);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 18px 22px;
    min-width: 200px;
    z-index: 20;
  }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 40px; }
  .hero-figure { order: -1; }
  .problem-grid { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .plans { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr 1fr; gap: 28px; }
  .section h2 { font-size: 30px; }
  .site-footer .container { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
