:root {
  --ap-green: #8cc63f;
  --ap-blue: #3860ac;
  --ap-blue-soft: rgba(56, 96, 172, 0.14);
  --bg: #d8e6c8;
  --card: #ffffff;
  --cardBorder: rgba(56, 96, 172, 0.14);
  --text: rgba(22, 40, 32, 0.94);
  --muted: rgba(30, 50, 45, 0.72);
  --hint: rgba(30, 50, 45, 0.55);
  --danger: #d92d20;
  --accent: #3860ac;
  --accent2: #2f5490;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 14px 40px rgba(56, 96, 172, 0.1), 0 4px 14px rgba(45, 74, 24, 0.06);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 14px 40px rgba(56, 96, 172, 0.08), 0 2px 8px rgba(15, 40, 20, 0.04);
  --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 44px rgba(56, 96, 172, 0.12), 0 4px 12px rgba(15, 40, 20, 0.06);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #c8d8b6;
  background-image:
    radial-gradient(ellipse 100% 70% at 8% 12%, rgba(140, 198, 63, 0.35), transparent 52%),
    radial-gradient(ellipse 80% 55% at 92% 8%, rgba(56, 96, 172, 0.14), transparent 48%),
    radial-gradient(ellipse 90% 65% at 85% 92%, rgba(140, 198, 63, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 5% 88%, rgba(56, 96, 172, 0.09), transparent 50%),
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(168deg, #e6efd8 0%, #dbe6cc 22%, #cfddbf 48%, #c5d4b4 72%, #bac9a8 100%),
    repeating-linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.05) 0 2px,
      transparent 2px 14px
    );
  padding: 16px 12px 36px;
}

@media (min-width: 900px) {
  body {
    background-attachment: fixed;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    background-attachment: scroll;
  }
}

::selection {
  background: rgba(140, 198, 63, 0.38);
  color: var(--text);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

/* Вся анкета в «рамке» как шапка: зелёный artboard, внутри белые блоки. */
main.container.t396-page {
  padding: 22px 18px 48px;
  border-radius: var(--radius-lg);
  background-color: #78b030;
  background-image:
    radial-gradient(ellipse 95% 70% at 50% -8%, rgba(255, 255, 255, 0.28), transparent 52%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(56, 96, 172, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 55%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(172deg, #a3d655 0%, #8cc63f 28%, #7ab832 58%, #6da82c 82%, #5f9428 100%),
    repeating-linear-gradient(
      35deg,
      rgba(255, 255, 255, 0.055) 0 1px,
      transparent 1px 10px
    );
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04) inset,
    0 28px 64px rgba(56, 96, 172, 0.2),
    0 12px 32px rgba(45, 74, 24, 0.16);
}

main.container.t396-page .title,
main.container.t396-page .subtitle {
  text-shadow: 0 1px 2px rgba(15, 40, 20, 0.12);
}

main.container.t396-page .title {
  color: rgba(255, 255, 255, 0.98);
}

.header {
  margin-bottom: 22px;
  padding-bottom: 4px;
}

/* Логотип: белая плашка + градиентный текст (внешняя зелень — у main.t396-page). */
.t396-brand {
  border-radius: 18px;
  background: transparent;
  padding: 0 0 16px;
  margin-bottom: 6px;
  box-shadow: none;
  border: none;
}

.t396-brand__inner {
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #fafdfb 100%);
  padding: 34px 20px;
  text-align: center;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 14px 36px rgba(15, 40, 20, 0.12),
    0 4px 12px rgba(56, 96, 172, 0.06);
}

.t396-brand__word {
  margin: 0;
  display: inline-block;
  padding: 0.08em 0.12em;
  font-size: clamp(58px, 12.5vw, 96px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
  white-space: nowrap;
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(90deg, var(--ap-green), var(--ap-blue), var(--ap-green), var(--ap-blue), var(--ap-green));
  background-size: 400% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: apBrandGradientFlow 10s linear infinite;
}

@keyframes apBrandGradientFlow {
  from {
    background-position: 0% center;
  }
  to {
    background-position: 400% center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t396-brand__word {
    animation: none;
    background-position: 0% center;
    color: var(--ap-blue);
    -webkit-text-fill-color: currentColor;
    background: none;
  }

  .card {
    transition: none;
  }

  .card:hover {
    box-shadow: var(--shadow-card);
    border-color: var(--cardBorder);
  }
}

.title {
  margin: 0 0 10px 0;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.titleBreak {
  display: block;
}

.subtitle {
  margin: 0;
  max-width: 62ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}

.notice {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 96, 172, 0.16);
  border-radius: var(--radius-md);
  padding: 22px 20px 18px;
  margin: 16px 0 24px;
  background: linear-gradient(180deg, rgba(245, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.99) 40%, #ffffff 100%);
  box-shadow:
    0 0 0 1px rgba(56, 96, 172, 0.05) inset,
    0 14px 40px rgba(56, 96, 172, 0.08),
    0 4px 14px rgba(140, 198, 63, 0.06);
}

.notice::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--ap-green) 0%, #6dad2e 35%, var(--ap-blue) 100%);
}

.notice > p:first-of-type {
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(56, 96, 172, 0.28);
  font-size: clamp(14px, 2.8vw, 16px);
  line-height: 1.4;
  color: var(--ap-blue);
}

.notice > p:first-of-type strong {
  font-weight: 850;
  letter-spacing: 0.02em;
  color: #2d4d6e;
}

.notice p {
  margin: 6px 0;
  color: var(--muted);
}

.noticeList {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.noticeList li {
  margin: 6px 0;
  padding-left: 2px;
}

.noticeList li::marker {
  color: var(--ap-green);
}

.successScreen {
  margin: 14px 0;
}

.successCard {
  border: 1px solid var(--cardBorder);
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 55%);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  margin: 0;
  border-left: 4px solid rgba(56, 96, 172, 0.32);
}

.successTitle {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ap-blue);
}

.successText {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.card {
  border: 1px solid var(--cardBorder);
  background: linear-gradient(180deg, #ffffff 0%, #fafcfb 100%);
  border-radius: var(--radius-md);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-card);
  margin: 16px 0;
  border-left: 4px solid rgba(56, 96, 172, 0.3);
  transition: box-shadow 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(56, 96, 172, 0.2);
}

.cardTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(56, 96, 172, 0.1);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ap-blue);
}

.cardTitle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ap-green), #6dad2e);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(140, 198, 63, 0.25);
}

.field {
  margin-top: 14px;
}

.field:first-of-type {
  margin-top: 0;
}

label {
  display: block;
  font-weight: 650;
  font-size: 0.875rem;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
  color: rgba(22, 40, 32, 0.88);
}

.req {
  color: var(--danger);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 96, 172, 0.18);
  background: #ffffff;
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.9375rem;
  min-height: 44px;
  outline: none;
  accent-color: var(--ap-green);
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233860ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: rgba(30, 50, 45, 0.42);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 96, 172, 0.48);
}

input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  box-shadow: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--ap-blue);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hint {
  margin: 7px 0 0;
  color: var(--hint);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 0.8125rem;
  line-height: 1.4;
  min-height: 1.2em;
  font-weight: 550;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 12px;
  align-items: start;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 12px;
  align-items: start;
}

/* В сетке отступы задаёт gap — иначе :first-of-type только у 1-й колонки и 2–3 съезжают вниз. */
.grid2 > .field,
.grid3 > .field {
  margin-top: 0;
}

.dateRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.datePart {
  width: 80px;
  text-align: center;
}

.dateYear {
  width: 110px;
  text-align: center;
}

.dateSep {
  color: var(--hint);
  font-weight: 700;
  user-select: none;
}

@media (min-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.radioRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 4px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 12px 5px 9px;
  border: 1px solid rgba(56, 96, 172, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.25;
  transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.radio:hover {
  border-color: rgba(140, 198, 63, 0.45);
  background: #ffffff;
}

.radio:has(input:checked) {
  border-color: rgba(56, 96, 172, 0.38);
  background: linear-gradient(180deg, rgba(140, 198, 63, 0.1), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 1px rgba(140, 198, 63, 0.18);
}

.radio input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.checkboxRow {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 600;
  margin: 0;
  line-height: 1.45;
  color: rgba(22, 40, 32, 0.88);
}

.checkboxRow input {
  width: auto;
  margin-top: 2px;
}

.formFooter {
  margin-top: 0;
  transform: translateY(var(--footer-y, 0px));
  opacity: var(--footer-o, 1);
  transition: none;
  will-change: transform, opacity;
}

.footerInner {
  max-width: 980px;
  margin: 0 auto;
}

.footerCard {
  border: 1px solid var(--cardBorder);
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border-radius: var(--radius-md);
  padding: 16px 16px 16px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid rgba(56, 96, 172, 0.3);
}

.footerStatus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 0 6px;
}

.footerConsent {
  margin: 0;
}

.footerError {
  margin-top: 8px;
}

.footerActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.footerSentinel {
  height: 1px;
}

/* After user reached the bottom once, footer becomes sticky */
.formFooter.sticky {
  position: sticky;
  bottom: 16px;
  z-index: 20;
}

.formFooter.sticky .footerCard {
  background: #ffffff;
  border-color: rgba(56, 96, 172, 0.2);
  border-left-color: rgba(56, 96, 172, 0.32);
  box-shadow:
    0 18px 48px rgba(56, 96, 172, 0.16),
    0 2px 10px rgba(140, 198, 63, 0.12);
}

.formFooter[aria-hidden="true"] {
  pointer-events: none;
}

.btn {
  appearance: none;
  border: 1px solid rgba(56, 96, 172, 0.2);
  background: #ffffff;
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9375rem;
  transition: transform 0.15s var(--ease-out), border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(140, 198, 63, 0.5);
  box-shadow: 0 4px 14px rgba(56, 96, 172, 0.08);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ap-blue-soft), 0 4px 14px rgba(56, 96, 172, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary:disabled {
  opacity: 0.58;
  filter: saturate(0.65);
}

.btn.primary {
  background: linear-gradient(145deg, #7eb832 0%, var(--ap-green) 38%, #5a9a2a 100%);
  border: 1px solid rgba(45, 90, 30, 0.25);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  min-width: 132px;
  font-weight: 750;
}

.btn.primary:hover {
  border-color: rgba(45, 90, 30, 0.35);
  background: linear-gradient(145deg, #88c238 0%, #95cd47 42%, #6aad32 100%);
  box-shadow: 0 6px 20px rgba(56, 96, 172, 0.15), 0 2px 8px rgba(45, 74, 24, 0.12);
}

.btn.primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4) inset, 0 6px 20px rgba(56, 96, 172, 0.12);
}

/* Keep primary consistent in footer */
.formFooter .btn.primary {
  border-color: rgba(45, 90, 30, 0.28);
}

.btn.subtle {
  background: rgba(15, 23, 42, 0.03);
}

.invalid input,
.invalid select,
.invalid textarea {
  border-color: rgba(217, 45, 32, 0.50);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.10);
}

.pageFooter {
  margin-top: 16px;
}

.pageFooterInner {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--cardBorder);
  background: linear-gradient(180deg, #ffffff 0%, #fafcfb 100%);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid rgba(56, 96, 172, 0.3);
}

.pageFooterBrand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.pageFooterLogo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  opacity: 0.95;
}

.pageFooterMeta {
  text-align: right;
}

.pageFooterText {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 650;
}

.pageFooterSubtext {
  margin: 4px 0 0;
  color: var(--hint);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.pageFooterLink {
  color: rgba(56, 96, 172, 0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(140, 198, 63, 0.35);
}

.pageFooterLink:hover {
  color: var(--ap-blue);
  border-bottom-color: rgba(56, 96, 172, 0.45);
}

@media (max-width: 640px) {
  .pageFooterInner {
    flex-direction: column;
    align-items: flex-start;
  }
  .pageFooterMeta {
    text-align: left;
  }
}
