/* Public landing page, laid out after the Figma file «Місця Турботи» (Desktop_BW, Mobille_BW).
   Fonts are served from this site: the CSP allows only 'self'. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-cyrillic.45ea393f38e4.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-latin.c154477b9aff.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Ovo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ovo-latin.358e7405d83e.woff2") format("woff2");
  unicode-range: U+0000-00FF;
}

:root {
  color-scheme: light;
  /* Colors from the «Colors» frame. */
  --accent-green: #165a31;
  --bg-green: #0e3f21;
  --bg-dark-green: #111f05;
  --bg-beige: #f6e8df;
  --bg-sage: #ccd4bf;
  --gold: #b9954e;
  --gold-40: rgb(185 149 78 / 40%);
  --text: #44413c;
  --text-40: rgb(68 65 60 / 40%);
  --input-bg: rgb(255 255 255 / 50%);
  /* Button tints from the design, as solid colors: a gradient over a color cannot be
     animated, and the hover then flickers. */
  --beige-gold: #dec7a5; /* Gold 40% over beige. */
  --green-gold: #526133; /* Gold 40% over the dark green hero. */
  --green-pressed: #285035; /* Text Black 40% over accent green. */
  /* Soft, layered shadows tinted with the design's dark green. */
  --shadow-card:
    0 1px 2px rgb(17 31 5 / 6%),
    0 12px 28px -10px rgb(17 31 5 / 18%),
    0 36px 72px -28px rgb(17 31 5 / 28%);
  --shadow-button: 0 8px 18px -8px rgb(22 90 49 / 60%);
  --shadow-button-hover: 0 12px 24px -10px rgb(22 90 49 / 70%);
  --error: #ee1717;

  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Ovo", Georgia, serif;

  /* Side padding: 70px on desktop, 30px on mobile. */
  --gutter: clamp(1.875rem, 1.1rem + 3.3vw, 4.375rem);
  /* Backgrounds run edge to edge; content stays within 1360px (1500px frame minus 70px sides). */
  --pad-x: max(var(--gutter), calc((100% - 1360px) / 2));
  --section-y: clamp(2.5rem, 2rem + 1.7vw, 3.75rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* A page that comes back with form errors opens straight at the form, without a slide. */
html:has(form[data-reset-url]) {
  scroll-behavior: auto;
}

/* What shows past the end of the page (iOS Safari under its bottom bar, overscroll)
   is the root background: make it the footer's dark green, so the footer seems to
   run to the bottom edge. The body keeps the page beige. */
html:has(body.landing-page) {
  background: var(--bg-dark-green);
}

/* iOS 26 Safari tints its top and bottom bars with the body background, not the
   root one. While the footer is on screen (landing-motion.js sets the class), the
   body takes the footer green, so the bar under the footer matches it; elsewhere it
   stays beige like the top of the page. */
body.landing-page.is-at-end {
  background: var(--bg-dark-green);
}

body.landing-page {
  /* Short pages still fill the window, so the footer sits at the bottom edge. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg-beige);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.375;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--bg-beige);
  color: var(--accent-green);
  font-weight: 700;
  border: 2px solid var(--accent-green);
  border-radius: 4px;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.landing {
  flex: 1 0 auto;
  overflow-x: clip;
  /* Its own beige: the body colour below is only seen in the Safari bars and past
     the page edges. */
  background: var(--bg-beige);
}

/* ---------- Buttons («Buttons» frame) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 14px 14px 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  font: 700 0.875rem/1.125rem var(--font-sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn img {
  flex: none;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--gold);
}

.btn--primary {
  background: var(--accent-green);
  color: var(--bg-beige);
  box-shadow: var(--shadow-button);
}

.btn--primary:hover,
.btn--primary:active {
  background-color: var(--green-pressed);
}

/* The form's main button lifts slightly on hover and settles when pressed. */
.landing-card .btn--primary:hover {
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.landing-card .btn--primary:active {
  box-shadow: var(--shadow-button);
  transform: none;
}

.btn--primary:disabled {
  color: rgb(255 255 255 / 50%);
  cursor: not-allowed;
}

.btn--light {
  min-height: 52px;
  background: var(--bg-beige);
  color: var(--accent-green);
  font-size: 1.125rem;
  line-height: 1.5rem;
}

.btn--light:hover {
  background-color: var(--beige-gold);
}

.btn--light:active {
  background-color: var(--beige-gold);
}

.btn--quiet {
  padding: 14px 20px;
  background: var(--bg-beige);
  color: var(--text);
}

.btn--quiet:hover {
  background-color: var(--beige-gold);
}

.btn--block {
  width: 100%;
}

/* ---------- Navigation ---------- */

.landing-nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 90px;
  padding: 10px max(40px, calc((100% - 1420px) / 2));
}

.landing-logo {
  color: var(--accent-green);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.75rem;
  text-decoration: none;
  text-transform: uppercase;
}

.landing-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-menu {
  display: none;
  position: relative;
}

.landing-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  list-style: none;
  cursor: pointer;
  border-radius: 4px;
}

.landing-menu summary::-webkit-details-marker {
  display: none;
}

.landing-menu__panel {
  position: absolute;
  right: -10px;
  top: calc(100% + 8px);
  display: grid;
  min-width: 15rem;
  padding: 8px;
  background: var(--bg-beige);
  border: 1px solid var(--gold-40);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgb(17 31 5 / 18%);
}

.landing-menu__panel a {
  padding: 12px 14px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.landing-menu__panel a:last-child {
  color: var(--accent-green);
}

.landing-menu__panel a:hover {
  background: var(--gold-40);
}

/* The panel grows out of the menu button and its links rise in one after another;
   closing plays it back (landing-motion.js adds .is-closing first). */
.landing-menu__panel {
  transform-origin: top right;
}

@media (prefers-reduced-motion: no-preference) {
  .landing-menu[open] .landing-menu__panel {
    animation: landing-menu-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .landing-menu[open] .landing-menu__panel a {
    animation: landing-menu-link 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .landing-menu[open] .landing-menu__panel a:nth-child(2) {
    animation-delay: 0.06s;
  }

  .landing-menu.is-closing .landing-menu__panel {
    animation: landing-menu-out 0.2s cubic-bezier(0.4, 0, 1, 1) both;
  }

  .landing-menu.is-closing .landing-menu__panel a {
    animation: none;
  }
}

@keyframes landing-menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.92);
  }
}

@keyframes landing-menu-out {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
  }
}

@keyframes landing-menu-link {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- Hero ---------- */

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0;
  min-height: 360px;
  padding: 60px var(--pad-x);
  overflow: hidden;
  background: var(--bg-green);
  color: var(--bg-beige);
}

.landing-hero__eyebrow {
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.875rem;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 380px;
  margin-top: 36px;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
}

.landing-hero__offer {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.landing-hero__lead {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.landing-hero__offer .btn {
  margin-top: 32px;
}

/* Desktop hero button is drawn with the gold tint (Figma 1:171). */
.landing-hero__cta {
  background-color: var(--beige-gold);
}

/* Arrow drawn in the text color, so it changes together with the label. */
.btn__arrow {
  flex: none;
  width: 24px;
  height: 24px;
  background: currentColor;
  mask: url("img/arrow-green.35ebc7ed16a5.svg") center / 24px 24px no-repeat;
}

/* Hover and pressed: the gold tint over the dark green; light text stays readable. */
.landing-hero__cta:hover,
.landing-hero__cta:active {
  background-color: var(--green-gold);
  color: var(--bg-beige);
}

.landing-hero__leaves {
  position: absolute;
  top: -90px;
  right: max(60px, calc((100% - 1380px) / 2));
  width: 226px;
  height: auto;
  pointer-events: none;
}

.landing-hero__leaves-mobile {
  display: none;
}

/* ---------- Photo «Підтримка має адресу» ---------- */

.landing-photo {
  position: relative;
  /* Desktop and tablet: the block takes the photo's own height, so the photo is
     always whole and full width, never cropped. */
  overflow: hidden;
  background: #8c8c8c;
}

.landing-photo__image {
  width: 100%;
  height: auto;
  transform-origin: 50% 0%;
}

.landing-photo__caption {
  position: absolute;
  top: 0;
  /* Scales with the photo, as in the design: 466 of 1280 wide, 38 from the right. */
  right: 2.97%;
  width: 36.4%;
  margin: 0;
}

.landing-photo__leaf {
  position: absolute;
  left: 39.5%;
  top: 80%;
  width: 36.6%;
}

/* ---------- Steps «Як це працює» ---------- */

.landing-steps {
  padding: var(--section-y) var(--pad-x) 0;
}

.landing-steps h2,
.landing-form h2,
.landing-about h2 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 3.75rem;
}

.landing-steps__list {
  display: grid;
  grid-template-columns: 373fr 394fr 373fr;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--gold);
}

.landing-steps__list li {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 250px;
  padding: 28px 16px 40px 37px;
}

.landing-steps__list li:first-child {
  padding-left: 16px;
}

.landing-steps__list li + li {
  border-left: 1px solid var(--gold);
}

.landing-steps__number {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 5.625rem;
  font-weight: 400;
  line-height: 6.25rem;
}

.landing-steps__text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.875rem;
}

/* ---------- Form «Ми є для Вас» ---------- */

.landing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: start;
  column-gap: 2rem;
  padding: 57px var(--pad-x) 72px;
  background: var(--bg-sage) url("img/form-bg.a713fe8feec0.jpg") center / cover no-repeat;
}

.landing-form__intro {
  max-width: 420px;
  padding-top: 92px;
}

.landing-form__lead + .landing-form__lead {
  margin-top: 16px;
}

.landing-card {
  margin-right: 37px;
}

.landing-form__lead {
  max-width: 355px;
  margin-top: 24px;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.landing-card {
  scroll-margin-top: 16px;
  padding: 36px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 20px;
  background: var(--bg-beige);
  box-shadow: var(--shadow-card);
}

.landing-card__title {
  margin-bottom: 24px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.875rem;
}

.landing-card form {
  display: grid;
  gap: 24px;
}

.landing-card form .btn {
  margin-top: 12px;
}

.landing-card__note {
  margin-top: 24px;
  font-size: 0.875rem;
  line-height: 1.125rem;
}

.landing-card__meta {
  margin-top: 8px;
  color: var(--text-40);
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.landing-alert {
  padding: 12px 16px;
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-size: 0.875rem;
}

.landing-alert ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Inputs («Inputs» frame): inactive, focused, filled, error, disabled. */

.field {
  /* Block layout (not grid): a negative margin can then pull the error line into the gap. */
  display: flow-root;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  display: block;
  margin-bottom: 4px;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid var(--gold-40);
  border-radius: 4px;
  color: var(--text);
  font: 400 0.875rem/1.125rem var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--text-40);
  opacity: 1;
}

.field select {
  appearance: none;
  padding-right: 44px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23b9954e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      right 16px center / 12px 8px no-repeat,
    var(--input-bg);
}

.field input:hover,
.field select:hover {
  border-color: var(--gold);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
  /* Gold edge plus a soft glow around the field being filled. */
  box-shadow:
    inset 0 0 0 1px var(--gold),
    0 0 0 4px rgb(185 149 78 / 16%);
  caret-color: var(--gold);
}

.field input:disabled,
.field select:disabled {
  background-color: var(--gold-40);
  cursor: not-allowed;
}

.field__help {
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.field__error,
.check .field__error {
  color: var(--error);
  font-size: 0.75rem;
  line-height: 1.125rem;
}

/* The error line sits in the 24px gap under the field, so showing errors does not
   make the card taller. Only a rare two-line error adds one extra line. */
.field > .field__error {
  margin-top: 4px;
  margin-bottom: -22px;
}

.field__error ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.is-invalid .field__label {
  color: var(--error);
}

.is-invalid input:not([type="checkbox"], [type="radio"]),
.is-invalid select {
  border-color: var(--error);
}

.is-invalid input:not([type="checkbox"], [type="radio"]):focus,
.is-invalid select:focus {
  box-shadow: inset 0 0 0 1px var(--error);
}

/* Radio choice (call or Telegram), shown only when Telegram is enabled. */

.field--choices > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.field--choices label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  line-height: 1.125rem;
  cursor: pointer;
}

.field--choices input[type="radio"] {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 2px;
  padding: 0;
  background: transparent;
  border: 1.5px solid var(--gold-40);
  border-radius: 50%;
}

.field--choices input[type="radio"]:checked {
  border-color: var(--gold);
  background: radial-gradient(circle, var(--gold) 0 4.5px, transparent 5px);
}

/* Checkboxes: icon «ic_Check box» (Default and Active). */

.check {
  display: grid;
  gap: 8px;
}

.landing-card form .check + .check {
  margin-top: -12px;
}

.check__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.check__row label {
  padding-top: 3px;
  font-size: 0.875rem;
  line-height: 1.125rem;
  cursor: pointer;
}

/* Checkbox «ic_Check box» drawn in CSS: a 16px rounded box inside a 24px area. When
   ticked, the box fills gold, the tick grows from the centre and the box gives a small
   bounce. */
.check input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 4px;
  border: 1.5px solid var(--gold-40);
  border-radius: 3px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 4 16 16'%3E%3Cpath d='M8.5 12.2 11 14.5l4.5-4.8' fill='none' stroke='%23f6e8df' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 0 0 no-repeat transparent;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    background-size 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.check input[type="checkbox"]:hover {
  border-color: var(--gold);
}

.check input[type="checkbox"]:checked {
  border-color: var(--gold);
  background-color: var(--gold);
  background-size: 16px 16px;
  animation: check-pop 0.32s ease-out;
}

/* Same shape in the error red (empty required box after a submit). */
.check.is-invalid input[type="checkbox"]:not(:checked) {
  border: 2px solid var(--error);
}

@keyframes check-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(0.82);
  }

  70% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .check input[type="checkbox"],
  .check input[type="checkbox"]:checked {
    transition: none;
    animation: none;
  }
}

.check.is-invalid label {
  color: var(--error);
}

.check .field__error {
  padding-left: 36px;
}

.check__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 15px;
  font-size: 0;
}

.check__links a {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: underline;
  text-underline-position: from-font;
}

.check__links a:hover {
  color: var(--accent-green);
}

/* ---------- «Від людини до людини» ---------- */

.landing-about {
  display: grid;
  grid-template-columns: minmax(0, 382px) minmax(0, 677px);
  justify-content: space-between;
  align-items: center;
  column-gap: 82px;
  padding: var(--section-y) var(--pad-x);
}

.landing-about__body {
  position: relative;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 82px;
  border-left: 1px solid var(--gold);
}

.landing-about__logo {
  width: 396px;
}

.landing-about__body p,
.landing-donor__text p {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.landing-about__body p {
  margin-top: 20px;
}

/* ---------- Donor ---------- */

.landing-donor {
  display: grid;
  grid-template-columns: minmax(0, 382px) minmax(0, 677px);
  justify-content: space-between;
  align-items: center;
  column-gap: 82px;
  padding: var(--section-y) var(--pad-x);
  background: var(--bg-dark-green);
  color: var(--bg-beige);
}

/* Opened long text: the logo / title keeps its place (landing-motion.js sets its
   offset). */
.landing-about.is-expanded {
  align-items: start;
}

/* «Читати далі» on the beige about block: green instead of gold. */
.landing-about .landing-more {
  align-self: flex-start;
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.landing-about .landing-more:hover {
  background: var(--accent-green);
  color: var(--bg-beige);
}

.landing-about .landing-more:focus-visible {
  outline-color: var(--accent-green);
}

.landing-donor__logo {
  display: block;
  height: 135px;
  overflow: hidden;
}

.landing-donor__logo img {
  width: 340px;
  margin-top: -13px;
}

.landing-donor__text {
  min-height: 135px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 82px;
  border-left: 1px solid var(--gold);
}

.landing-donor__text p + p,
.landing-more-text p {
  margin-top: 1em;
}

/* «Читати далі» under a long donor text (landing-motion.js shows it). */
.landing-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 20px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.landing-more::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-more[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}

.landing-more:hover {
  background: var(--gold);
  color: var(--bg-dark-green);
}

.landing-more:focus-visible {
  outline: 2px solid var(--bg-beige);
  outline-offset: 3px;
}

/* ---------- Footer links ---------- */

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  /* Room for the iPhone home indicator when the page runs edge to edge. */
  padding: 20px var(--pad-x) calc(24px + env(safe-area-inset-bottom, 0px));
  /* «BG_Dark Green» from the design, the colour of the bottom (Caritas) block. */
  background: var(--bg-dark-green);
  font-size: 0.875rem;
  line-height: 1.125rem;
}

/* Right under the Caritas block: one dark band, split by a faint gold line. */
.landing:has(.landing-donor) + .landing-footer {
  box-shadow: inset 0 1px 0 rgb(185 149 78 / 25%);
}

.landing-footer a {
  color: rgb(246 232 223 / 72%);
  text-underline-position: from-font;
  transition: color 0.15s ease;
}

.landing-footer a:hover {
  color: var(--gold);
}

/* ---------- Info note (working hours, alternative contact) ---------- */

.info-note {
  display: flex;
  /* Icon centred against the label and text, whatever their height. */
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--gold-40);
  border-radius: 12px;
  background: rgb(255 255 255 / 45%);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.375rem;
}

.info-note__icon {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  place-items: center;
  background: var(--gold);
  color: var(--bg-beige);
}

.info-note__text {
  min-width: 0;
}

.info-note__label {
  display: block;
  margin: 0 0 2px;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1rem;
  text-transform: uppercase;
}

/* On the dark green success block. */
.info-note--dark {
  max-width: 560px;
  margin: 24px 0 0;
  border-color: rgb(185 149 78 / 45%);
  background: rgb(246 232 223 / 8%);
  color: var(--bg-beige);
}

.info-note--dark .info-note__icon {
  color: var(--bg-green);
}

/* Session warning for signed-in staff who open a public page. */
.session-warning {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: #fff4d6;
  border-bottom: 2px solid var(--gold);
  color: #4a3200;
  text-align: center;
}

/* ---------- Privacy page («Політика конфіденційності») ---------- */

.privacy-content {
  max-width: calc(860px + 2 * var(--gutter));
  margin: 0 auto;
  /* The PDF link is in the footer; the contacts end the page with the usual gap. */
  padding: var(--section-y) var(--gutter);
}

.privacy-intro h2,
.privacy-consent h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.875rem;
}

.privacy-intro p {
  margin-top: 12px;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.privacy-consent {
  margin-top: 40px;
}

/* The consent text and the project story sit in the same light card. */
.privacy-consent,
.project-card {
  padding: 36px;
  border: 1px solid var(--gold-40);
  border-radius: 20px;
  background: rgb(255 255 255 / 55%);
}

.privacy-consent__version {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.privacy-consent__body {
  margin-top: 20px;
  font-size: 1rem;
  line-height: 1.6;
}

.privacy-consent__body p {
  margin: 0 0 12px;
}

.privacy-consent__body p:last-child {
  margin-bottom: 0;
}

.privacy-consent__body strong {
  color: var(--accent-green);
}

.privacy-consent__body ul,
.privacy-consent__body ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.privacy-consent__body a {
  color: var(--accent-green);
}

/* Formatting chosen in the consent editor (only these classes survive sanitising). */
.consent-rich-text .consent-text-small { font-size: 0.875rem; }
.consent-rich-text .consent-text-normal { font-size: 1rem; }
.consent-rich-text .consent-text-large { font-size: 1.25rem; }
.consent-rich-text .consent-text-x-large { font-size: 1.5rem; }
.consent-rich-text .consent-align-left { text-align: left; }
.consent-rich-text .consent-align-center { text-align: center; }
.consent-rich-text .consent-align-right { text-align: right; }

.privacy-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.privacy-contact {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-green);
  color: var(--bg-beige);
}

.privacy-contact h2 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1rem;
  text-transform: uppercase;
}

.privacy-contact p {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}

.privacy-contact a {
  color: inherit;
  text-underline-position: from-font;
}

.privacy-content a[href^="tel:"] {
  white-space: nowrap;
}

.privacy-contact a:hover {
  color: var(--gold);
}

/* ---------- Project page («Про проєкт») ---------- */

.project-content {
  max-width: calc(860px + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--section-y) var(--gutter) 72px;
}

.project-content p {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.project-content p + p {
  margin-top: 1.1em;
}

/* ---------- Banner pages (success, privacy, errors) ---------- */

.landing-banner {
  /* A compact header for helper pages: the landing hero's two columns (title left,
     text and button right), smaller. */
  align-items: center;
  min-height: 0;
  padding-top: 48px;
  padding-bottom: 56px;
}

.landing-banner__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 50%;
  place-items: center;
  background: var(--gold);
  color: var(--bg-green);
  box-shadow: 0 0 0 8px rgb(185 149 78 / 18%);
}

.landing-banner__icon svg {
  width: 24px;
  height: 24px;
}

.landing-hero.landing-banner h1 {
  max-width: none;
  margin-top: 10px;
  font-size: 3.25rem;
  line-height: 1.1;
}

.landing-banner .landing-hero__title {
  position: relative;
  z-index: 1;
  padding-right: 32px;
}

.landing-banner .landing-hero__lead {
  font-size: 1.125rem;
  line-height: 1.6;
}


.landing-banner .btn {
  margin-top: 28px;
}

/* The tall leaves would overflow a compact banner: show them smaller. */
.landing-banner .landing-hero__leaves {
  top: -60px;
  width: 170px;
}

.landing-steps__list li.is-done .landing-steps__number {
  position: relative;
}

/* The first step is already done: a small gold check beside its number. */
.landing-steps__list li.is-done .landing-steps__number::after {
  content: "";
  position: absolute;
  top: 18px;
  margin-left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6e8df' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19 7'/%3E%3C/svg%3E")
      center / 16px 16px no-repeat,
    var(--gold);
}

.landing-steps__note {
  margin: 0;
  padding: 28px 16px 48px;
  border-top: 1px solid var(--gold-40);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  .landing-hero h1 {
    font-size: clamp(3.75rem, 2rem + 4vw, 5rem);
  }

  /* Two-column banner: the long title word must fit half the width. */
  .landing-hero.landing-banner h1 {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
  }

  .landing-hero__leaves {
    right: 16px;
    opacity: 0.55;
  }

  .landing-steps h2,
  .landing-form h2,
  .landing-about h2 {
    font-size: 2.5rem;
    line-height: 3rem;
  }

  .landing-about,
  .landing-donor {
    column-gap: 40px;
  }

  .landing-about__body,
  .landing-donor__text {
    padding-left: 40px;
  }

  .landing-about__logo {
    width: min(396px, 100%);
  }
}

/* ---------- Small tablet (768–1023px) ---------- */

@media (min-width: 768px) and (max-width: 1023px) {
  /* The right column is too narrow here: the leaves would cover the offer text. */
  .landing-hero__leaves {
    display: none;
  }

  .landing-steps__text {
    font-size: 1.25rem;
    line-height: 1.625rem;
  }

  /* Intro above the form, as on phones: side by side the intro is squeezed under the card. */
  .landing-form {
    display: block;
  }

  .landing-form__intro {
    max-width: 560px;
    padding-top: 0;
  }

  .landing-card {
    max-width: 560px;
    margin: 36px 0 0;
  }

  /* Narrow right columns: a smaller body size keeps the lines readable. */
  .landing-about__body p,
  .landing-donor__text p {
    font-size: 1.125rem;
    line-height: 1.625rem;
  }
}

/* ---------- Very wide screens ---------- */

@media (min-width: 1500px) {
  /* The photo stays full width, but the caption keeps the design size and lines up
     with the page content instead of growing with the screen. */
  .landing-photo__caption {
    right: calc((100% - 1424px) / 2);
    width: 546px;
  }
}

/* ---------- Mobile (Mobille_BW, 390px) ---------- */

@media (max-width: 767px) {
  .landing-nav {
    min-height: 80px;
    padding: 10px 20px 10px 24px;
  }

  .landing-nav__links {
    display: none;
  }

  /* A single link (success page) stays visible on phones. */
  .landing-nav__links.landing-nav__links--always {
    display: flex;
  }

  .landing-nav__links--always .btn {
    padding: 10px 14px;
  }

  .landing-banner {
    min-height: 0;
    padding: 32px 30px 110px;
  }

  /* «Конфіденційності» and «Звернення» are long words: they must fit one line. */
  .landing-hero.landing-banner h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.5rem);
  }

  .landing-nav__links--always .btn {
    white-space: nowrap;
  }

  /* Narrowest phones: the logo already leads home and the hero has a «На головну»
     button, so the header link steps aside instead of wrapping. */
  @media (max-width: 359px) {
    .landing-nav__links.landing-nav__links--always {
      display: none;
    }
  }

  .landing-banner__icon {
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
  }

  .landing-banner .landing-hero__lead {
    font-size: 1rem;
  }

  .landing-banner .btn {
    margin-top: 24px;
  }

  .project-content p {
    font-size: 1.0625rem;
    line-height: 1.6rem;
  }

  .privacy-consent {
    margin-top: 32px;
  }

  .privacy-consent,
  .project-card {
    padding: 24px;
  }

  .landing-steps__list li.is-done .landing-steps__number::after {
    top: 14px;
    width: 24px;
    height: 24px;
    background-size: 14px 14px, auto;
  }

  .landing-steps__note {
    margin-top: 12px;
    padding: 24px 16px 8px;
  }

  .landing-menu {
    display: block;
  }

  .landing-hero {
    display: block;
    min-height: 530px;
    padding: 40px 30px 90px;
  }

  .landing-hero__eyebrow {
    font-size: 1.125rem;
    line-height: 1.375rem;
  }

  .landing-hero h1 {
    max-width: 330px;
    margin-top: 24px;
    font-size: 3.75rem;
    line-height: 1;
  }

  .landing-hero__offer {
    max-width: 295px;
    margin-top: 32px;
  }

  .landing-hero__lead {
    font-size: 1rem;
    line-height: 1.375rem;
  }

  .landing-hero__offer .btn {
    margin-top: 40px;
  }

  /* Narrow phones (320–359px): the button label stays on one line. */
  @media (max-width: 359px) {
    .landing-hero__offer .btn {
      padding-left: 16px;
      padding-right: 12px;
      font-size: 1rem;
    }
  }

  /* Mobile hero button is the plain default state (Figma 19:1970). */
  .landing-hero__cta {
    background-color: var(--bg-beige);
  }

  .landing-hero__cta:hover,
  .landing-hero__cta:active {
    background-color: var(--beige-gold);
    color: var(--accent-green);
  }

  .landing-hero__leaves {
    display: none;
  }

  .landing-hero__leaves-mobile {
    position: absolute;
    /* Placed from the left like the button (Figma: x 196 of 390), so on phones wider
       than the design the branch stays tucked under the button's end. */
    left: 196px;
    bottom: -7px;
    display: block;
    width: 167px;
    height: 242px;
    overflow: hidden;
    pointer-events: none;
  }

  .landing-hero__leaves-mobile img {
    position: absolute;
    top: -87px;
    left: 0;
    width: 166px;
    max-width: none;
  }

  /* Phone: a fixed 390 × 530 frame of the photo until a vertical photo is made. */
  .landing-photo {
    height: 530px;
  }

  .landing-photo__image {
    height: 100%;
    object-fit: cover;
    /* Mobile frame shows the house and the sky (Figma 19:1990). */
    object-position: 72% 25%;
  }

  .landing-photo__caption {
    top: 38px;
    right: 4px;
    width: 327px;
    max-width: calc(100% - 8px);
  }

  .landing-steps {
    padding: 40px 20px 50px;
  }

  .landing-steps h2,
  .landing-form h2,
  .landing-about h2 {
    font-size: 1.75rem;
    line-height: 2.125rem;
  }

  .landing-steps h2 {
    padding-left: 10px;
  }

  .landing-steps__list {
    grid-template-columns: 1fr;
    margin-top: 16px;
    border-top: 0;
  }

  .landing-steps__list li,
  .landing-steps__list li:first-child {
    min-height: 0;
    padding: 16px 16px 28px;
  }

  .landing-steps__list li:first-child {
    padding-top: 28px;
  }

  .landing-steps__list li + li {
    border-left: 0;
    border-top: 1px solid var(--gold);
    margin-top: 12px;
    padding: 28px 16px 16px;
  }

  .landing-steps__number {
    font-size: 4.625rem;
    line-height: 5.25rem;
  }

  .landing-steps__text {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }

  .landing-form {
    display: block;
    padding: 40px 16px 50px;
    background-position: 0 0;
    background-size: 1491px auto;
  }

  .landing-form__intro {
    padding-top: 0;
  }

  .landing-card form .btn {
    margin-top: 8px;
  }

  .check__links {
    margin-top: 8px;
  }

  .landing-form__intro {
    padding: 0 14px;
  }

  .landing-form__lead {
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.375rem;
  }

  .landing-card {
    margin: 36px 0 0;
    padding: 24px;
  }

  .landing-card__title {
    font-size: 1.125rem;
    line-height: 1.5rem;
    margin-bottom: 28px;
  }

  .landing-about,
  .landing-donor {
    display: block;
    padding: 40px 30px;
  }

  .landing-about__body {
    display: block;
    min-height: 0;
    margin-top: 16px;
    padding-left: 0;
    border-left: 0;
  }

  .landing-about__logo {
    width: 264px;
  }

  /* The gold line sits once, between the logo and the text. */
  .landing-about__body > p:first-of-type {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gold);
  }

  .landing-about__body p + p,
  .landing-about .landing-more-text p {
    margin-top: 1em;
  }

  .landing-about__body p,
  .landing-donor__text p {
    font-size: 1rem;
    line-height: 1.375rem;
  }

  .landing-donor {
    padding-bottom: 40px;
  }

  .landing-donor__logo {
    height: 90px;
  }

  .landing-donor__logo img {
    width: 227px;
    margin-top: -8.5px;
  }

  .landing-donor__text {
    display: block;
    min-height: 0;
    margin-top: 24px;
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid var(--gold);
  }
}

/* ---------- Motion ---------- */

/* Only for people who did not ask the system to reduce motion. Without support for
   scroll-driven animations the page simply shows everything at once. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: the title and offer rise in once on load, the leaves sway. */
  .landing-hero__eyebrow,
  .landing-hero h1,
  .landing-hero__lead,
  .landing-hero__offer .btn {
    animation: landing-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .landing-hero h1 {
    animation-delay: 0.12s;
  }

  .landing-hero__lead {
    animation-delay: 0.3s;
  }

  .landing-hero__offer .btn {
    animation-delay: 0.45s;
  }

  .landing-hero__leaves,
  .landing-hero__leaves-mobile img {
    transform-origin: 70% 100%;
    animation:
      landing-leaves-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both,
      landing-sway 10s linear 1.6s infinite;
  }

  /* «Підтримка має адресу» is written in from left to right when the photo comes
     into view (landing-motion.js adds .is-visible), then the gold leaf is drawn. */
  .js .landing-photo__caption > img:first-child,
  .js .landing-photo__leaf {
    clip-path: inset(0 100% 0 0);
  }

  .js .landing-photo__caption.is-visible > img:first-child {
    animation: landing-write 1.8s cubic-bezier(0.45, 0.05, 0.35, 1) 0.15s both;
  }

  /* After it is drawn, the leaf keeps swaying from the start of its stem. */
  .js .landing-photo__caption.is-visible .landing-photo__leaf {
    transform-origin: 0% 90%;
    animation:
      landing-write 0.9s cubic-bezier(0.45, 0.05, 0.35, 1) 1.7s both,
      landing-leaf-sway 3.6s ease-in-out 2.6s infinite alternate;
  }

  @supports (animation-timeline: view()) {
    /* Elements rise and come into focus while scrolling into view; each one is fully
       shown once it is entirely on screen, so the last blocks finish too. */
    .landing-steps h2,
    .landing-steps__list li,
    .landing-form__intro,
    .landing-card,
    .landing-about h2,
    .landing-about__body,
    .landing-donor__logo,
    .landing-donor__text {
      animation: landing-reveal cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }

    /* The three steps follow one another. */
    .landing-steps__list li:nth-child(2) {
      animation-range: entry 15% entry 100%;
    }

    .landing-steps__list li:nth-child(3) {
      animation-range: entry 30% entry 100%;
    }

    .landing-steps__number {
      animation: landing-number cubic-bezier(0.34, 1.56, 0.64, 1) both;
      animation-timeline: view();
      animation-range: entry 25% entry 100%;
    }

    /* Left and right halves come from their own side. */
    .landing-form__intro,
    .landing-about h2,
    .landing-donor__logo {
      animation-name: landing-from-left;
    }

    .landing-card,
    .landing-about__body,
    .landing-donor__text {
      animation-name: landing-from-right;
    }

    /* The opened donor text is taller than the screen, so its reveal would never
       finish and the text would stay shifted to the right. Each line of it gets the
       reveal instead, so it still slides in and out while scrolling. */
    .landing-about.is-expanded .landing-about__body {
      animation: none;
    }

    .landing-about.is-expanded .landing-about__logo,
    .landing-about.is-expanded .landing-about__body > p,
    .is-expanded .landing-more-text > p,
    .is-expanded .landing-more {
      animation: landing-from-right cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }

    /* Photo: a strong zoom-out while it passes through the screen; the caption slides in. */
    .landing-photo__image {
      animation: landing-photo linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

  }
}

@keyframes landing-rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(56px);
  }
}

@keyframes landing-leaves-in {
  from {
    opacity: 0;
    transform: translateY(-40px) rotate(-12deg);
  }
}

/* Starts and ends upright, where the entrance animation leaves the leaves, so the
   hand-over has no jump; the eased segments meet at the same speed. */
@keyframes landing-sway {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-out;
  }

  25% {
    transform: rotate(-4deg);
    animation-timing-function: ease-in-out;
  }

  75% {
    transform: rotate(4deg);
    animation-timing-function: ease-in;
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes landing-reveal {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(90px) scale(0.96);
  }

  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes landing-from-left {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateX(-90px);
  }

  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes landing-from-right {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateX(90px);
  }

  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes landing-number {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.6);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes landing-photo {
  /* Zooms from the top edge, so the sky behind the caption always stays. */
  from {
    transform: scale(1.18);
  }

  to {
    transform: none;
  }
}

@keyframes landing-write {
  from {
    opacity: 0.2;
    clip-path: inset(0 100% 0 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes landing-leaf-sway {
  0% {
    transform: rotate(0deg) translateY(0);
  }

  50% {
    transform: rotate(-2.5deg) translateY(-1px);
  }

  100% {
    transform: rotate(1.5deg) translateY(1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-card .btn--primary:hover {
    transform: none;
  }
}
