:root {
  --ap-green: #9ce074;
  --ap-blue: #00aeef;
  --ap-blue-soft: rgba(0, 174, 239, 0.14);
  --ap-purple: #e6007e;
  --ap-purple-deep: #e6007e;
  --ap-purple-soft: rgba(230, 0, 126, 0.15);
  --bg: #d4eef8;
  --card: #ffffff;
  --cardBorder: rgba(230, 0, 126, 0.16);
  --text: rgba(30, 46, 52, 0.94);
  --muted: rgba(35, 55, 62, 0.72);
  --hint: rgba(35, 55, 62, 0.55);
  --danger: #d92d20;
  --accent: #00aeef;
  --accent2: #e6007e;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 14px 40px rgba(230, 0, 126, 0.1), 0 4px 14px rgba(0, 120, 160, 0.06);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 14px 40px rgba(230, 0, 126, 0.08), 0 2px 8px rgba(20, 45, 55, 0.04);
  --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 44px rgba(230, 0, 126, 0.13), 0 4px 12px rgba(20, 45, 55, 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: #c5e8f5;
  background-image:
    radial-gradient(ellipse 100% 70% at 8% 12%, rgba(156, 224, 116, 0.35), transparent 52%),
    radial-gradient(ellipse 78% 58% at 50% 0%, rgba(230, 0, 126, 0.12), transparent 48%),
    radial-gradient(ellipse 80% 55% at 92% 8%, rgba(0, 174, 239, 0.14), transparent 48%),
    radial-gradient(ellipse 90% 65% at 85% 92%, rgba(156, 224, 116, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 5% 88%, rgba(0, 174, 239, 0.09), transparent 50%),
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(168deg, #e3f6fc 0%, #d4eff9 22%, #c8e8f4 48%, #bddde9 72%, #b3d5e3 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(156, 224, 116, 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: #46cdff;
  background-image:
    radial-gradient(ellipse 95% 70% at 50% -8%, rgba(255, 255, 255, 0.28), transparent 52%),
    radial-gradient(ellipse 62% 44% at 86% 8%, rgba(230, 0, 126, 0.18), transparent 56%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(0, 174, 239, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 55%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(172deg, #74d9ff 0%, #46cdff 28%, #00aeef 58%, #0099d6 82%, #007bb5 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(230, 0, 126, 0.16),
    0 12px 32px rgba(0, 120, 160, 0.16);
}

main.container.t396-page .title,
main.container.t396-page .subtitle {
  text-shadow: 0 1px 2px rgba(20, 45, 55, 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(20, 45, 55, 0.12),
    0 4px 12px rgba(0, 174, 239, 0.06);
}

.t396-brand__logo {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0 auto;
}

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

@media (prefers-reduced-motion: reduce) {
  .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(230, 0, 126, 0.18);
  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(230, 0, 126, 0.05) inset,
    0 14px 40px rgba(230, 0, 126, 0.08),
    0 4px 14px rgba(156, 224, 116, 0.06);
}

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

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

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

.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(230, 0, 126, 0.34);
}

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

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

.card {
  border: 1px solid rgba(156, 224, 116, 0.36);
  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(156, 224, 116, 0.78);
  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(156, 224, 116, 0.5);
}

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

.cardTitle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ap-green), var(--ap-purple));
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(230, 0, 126, 0.18);
}

.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(30, 46, 52, 0.88);
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(230, 0, 126, 0.2);
  background: #ffffff;
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.9375rem;
  min-height: 44px;
  outline: none;
  accent-color: var(--ap-purple);
  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='%23e6007e' 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(35, 55, 62, 0.42);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(230, 0, 126, 0.5);
}

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-purple);
  box-shadow: 0 0 0 3px var(--ap-purple-soft);
}

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

.fileUpload {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(230, 0, 126, 0.2);
  background: #ffffff;
  padding: 8px 10px;
}

.fileUpload[data-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.fileUploadInput {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fileUploadButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(230, 0, 126, 0.22);
  background: rgba(230, 0, 126, 0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.18s var(--ease-out), transform 0.12s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.fileUploadButton:hover {
  background: rgba(230, 0, 126, 0.14);
  box-shadow: 0 2px 8px rgba(230, 0, 126, 0.12);
}

.fileUploadButton:active {
  transform: translateY(1px);
}

.fileUpload[data-disabled="true"] .fileUploadButton {
  pointer-events: none;
}

.fileUploadName {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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(230, 0, 126, 0.18);
  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(230, 0, 126, 0.42);
  background: #ffffff;
}

.radio:has(input:checked) {
  border-color: rgba(230, 0, 126, 0.44);
  background: linear-gradient(180deg, rgba(230, 0, 126, 0.09), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 1px rgba(230, 0, 126, 0.16);
}

.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(30, 46, 52, 0.88);
}

.checkboxRow input {
  width: auto;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 18px;
}

.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 rgba(156, 224, 116, 0.36);
  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(156, 224, 116, 0.78);
}

.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(156, 224, 116, 0.5);
  border-left-color: rgba(156, 224, 116, 0.82);
  box-shadow:
    0 18px 48px rgba(230, 0, 126, 0.16),
    0 2px 10px rgba(156, 224, 116, 0.12);
}

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

.btn {
  appearance: none;
  border: 1px solid rgba(230, 0, 126, 0.22);
  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(230, 0, 126, 0.46);
  box-shadow: 0 4px 14px rgba(230, 0, 126, 0.1);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ap-purple-soft), 0 4px 14px rgba(230, 0, 126, 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, #46cdff 0%, var(--ap-blue) 38%, var(--ap-purple-deep) 100%);
  border: 1px solid rgba(230, 0, 126, 0.28);
  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(230, 0, 126, 0.42);
  background: linear-gradient(145deg, #74d9ff 0%, #00aeef 38%, var(--ap-purple) 100%);
  box-shadow: 0 6px 20px rgba(230, 0, 126, 0.16), 0 2px 8px rgba(0, 120, 160, 0.12);
}

.btn.primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(230, 0, 126, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.4) inset, 0 6px 20px rgba(230, 0, 126, 0.12);
}

/* Keep primary consistent in footer */
.formFooter .btn.primary {
  border-color: rgba(230, 0, 126, 0.32);
}

.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 rgba(156, 224, 116, 0.36);
  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(156, 224, 116, 0.78);
}

.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(0, 174, 239, 0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 224, 116, 0.35);
}

.pageFooterLink:hover {
  color: var(--ap-blue);
  border-bottom-color: rgba(0, 174, 239, 0.45);
}

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