/* ==========================================================================
   KTAS — base styles
   ========================================================================== */

:root {
  --orange: #E77A15;
  --orange-600: #CC6609;
  --orange-100: #FDEBD8;
  --orange-50: #FFF6EC;
  --ink: #1C1612;
  --ink-2: #4A413A;
  --muted: #7A6F66;
  --line: #EDE2D6;
  --bg: #FFFBF7;
  --surface: #FFFFFF;
  --paypal: #FFC439;
  --paypal-ink: #002C6B;
  --danger: #C62828;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 8px 28px rgba(60, 35, 10, .08);
  --header-h: 68px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 900; }
h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--orange-600); }
.muted { color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 80px 0; } }

.section-title { font-size: clamp(26px, 4vw, 34px); text-align: center; }
.section-lead { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }

.eyebrow {
  color: var(--orange-600);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: inherit; font-weight: 800;
  padding: 12px 24px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .lang__btn:focus-visible, .tabs__tab:focus-visible, .carousel__nav:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
.btn--primary { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(231, 122, 21, .35); }
.btn--primary:hover { background: var(--orange-600); }
.btn--paypal { background: var(--paypal); color: var(--paypal-ink); }
.btn--paypal:hover { background: #F2B52B; }
.btn--sm { padding: 9px 18px; font-size: 15px; }
.btn--lg { padding: 16px 28px; font-size: 18px; }
.btn--block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 251, 247, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand__name { font-weight: 900; font-size: 20px; color: var(--ink); letter-spacing: .02em; }
.brand__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .brand__sub { display: none; } }
@media (max-width: 360px) { .brand__text { display: none; } }
.header__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.lang { display: flex; background: var(--orange-50); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang__btn {
  font: inherit; font-size: 13px; font-weight: 800;
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.lang__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Welcome ---------- */
.welcome { padding-top: 32px; }
.welcome__grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 820px) { .welcome__grid { grid-template-columns: 5fr 6fr; gap: 56px; } }
.welcome__photo { margin: 0; position: relative; max-width: 440px; justify-self: center; width: 100%; }
.welcome__photo img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; }
.welcome__photo::before {
  content: ""; position: absolute; inset: 18px -14px -14px 18px; z-index: -1;
  background: var(--orange); border-radius: var(--radius);
}
/* Телефони й планшети: фото нижче, щоб заголовок було видно на першому екрані */
@media (max-width: 819px) {
  .welcome { padding-top: 20px; }
  .welcome__grid { gap: 24px; }
  .welcome__photo { max-width: 520px; }
  .welcome__photo img { aspect-ratio: 4 / 3; object-position: center 34%; }
  .welcome__photo::before { inset: 10px -8px -8px 10px; }
}

.signature { display: flex; flex-direction: column; padding-left: 14px; border-left: 4px solid var(--orange); }
.welcome__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; margin-top: 24px; }

/* Широкі екрани: більше місця тексту, щоб блок вміщався у висоту Full HD */
@media (min-width: 1100px) {
  .header .container, .welcome .container, .footer .container { max-width: 1240px; }
  .welcome__grid { grid-template-columns: 2fr 3fr; gap: 64px; }
  .welcome__photo { justify-self: start; }
  .welcome__text p { margin-bottom: .8em; }
}
.signature__name { font-weight: 900; color: var(--ink); font-size: 18px; }
.signature__role { color: var(--muted); font-size: 15px; }

/* ---------- Gallery / Carousel ---------- */
.gallery { background: var(--surface); border-block: 1px solid var(--line); }
.carousel { position: relative; }
.carousel__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; scrollbar-width: none;
  padding-bottom: 4px; border-radius: var(--radius);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
@media (min-width: 700px) { .carousel__track { grid-auto-columns: calc((100% - 14px) / 2); } }
@media (min-width: 1000px) { .carousel__track { grid-auto-columns: calc((100% - 28px) / 3); } }
.carousel__slide { scroll-snap-align: start; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--orange-50); }
.carousel__slide picture, .carousel__slide img { width: 100%; height: 100%; object-fit: cover; }
.thanks__photo picture { display: block; width: 100%; height: 100%; }
.carousel__nav {
  position: absolute; top: calc(50% - 22px); transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  display: none; align-items: center; justify-content: center; cursor: pointer;
}
.carousel__nav:disabled { opacity: 0; pointer-events: none; }
.carousel__nav--prev { left: -12px; }
.carousel__nav--next { right: -12px; }
@media (min-width: 700px) { .carousel__nav { display: flex; } }
.carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.carousel__dots button {
  width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0;
  background: var(--line); cursor: pointer; transition: width .2s, background-color .2s;
}
.carousel__dots button[aria-selected="true"] { width: 26px; background: var(--orange); }

/* ---------- Donate ---------- */
.impact {
  list-style: none; padding: 0; margin: 0 auto 28px; max-width: 640px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.impact li {
  background: var(--orange-50); border: 1px solid var(--orange-100); border-radius: var(--radius-sm);
  padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.impact strong { font-size: 22px; color: var(--orange-600); font-weight: 900; }
.impact span { font-size: 13px; line-height: 1.35; color: var(--ink-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.donate__card { max-width: 560px; margin: 0 auto; padding: 8px 20px 24px; }
@media (min-width: 640px) { .donate__card { padding: 10px 32px 32px; } }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 0 20px; }
.tabs__tab {
  font: inherit; font-weight: 800; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-selected="true"] { border-color: var(--orange); color: var(--ink); background: var(--orange-50); }
.tabs__tab[aria-selected="true"] svg { color: var(--orange); }

.field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.field__label { display: block; font-weight: 800; color: var(--ink); font-size: 15px; margin-bottom: 8px; padding: 0; }
.field__error { color: var(--danger); font-size: 14px; font-weight: 700; margin: 6px 0 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--orange-50); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 800; color: var(--muted); transition: background-color .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 1px; }
.segmented--small { max-width: 280px; margin: 0 0 16px; }
.segmented--small span { padding: 6px 4px; font-size: 14px; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.chips button {
  font: inherit; font-weight: 800; font-size: 16px;
  padding: 11px 4px; border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.chips button:hover { border-color: var(--orange-100); }
.chips button[aria-pressed="true"] { border-color: var(--orange); background: var(--orange-50); }
.chips button:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }

.amount-input { position: relative; }
.amount-input__symbol { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); }
input[type="number"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 12px 14px;
  transition: border-color .15s;
}
input[type="number"] { padding-left: 38px; font-weight: 700; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, textarea:focus { outline: none; border-color: var(--orange); }
textarea { resize: vertical; min-height: 84px; }
.is-invalid { border-color: var(--danger) !important; }

.pay-note { display: flex; align-items: flex-start; justify-content: center; gap: 6px; text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.pay-note svg { flex-shrink: 0; margin-top: 2px; }
.paypal > p:first-child { text-align: center; }
.pay-alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; font-size: 14px; color: var(--muted); }
.link-btn {
  font: inherit; font-weight: 800; color: var(--orange-600);
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.bank-intro { font-size: 15px; }

.requisites { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.requisites > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 12px 10px 14px; border-top: 1px solid var(--line); }
.requisites > div:first-child { border-top: 0; }
.requisites dt { grid-column: 1; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.requisites dd { grid-column: 1; margin: 0; color: var(--ink); font-weight: 700; word-break: break-word; font-variant-numeric: tabular-nums; }
.copy-btn {
  grid-column: 2; grid-row: 1 / span 2;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.copy-btn:hover { color: var(--orange-600); border-color: var(--orange-100); }
.copy-btn.is-done { color: #2E7D32; border-color: #A5D6A7; }

/* ---------- Thanks ---------- */
.thanks__inner {
  display: grid; gap: 24px; align-items: center; text-align: center;
  max-width: 820px;
}
.thanks__inner .section-title { text-align: inherit; }
.thanks__photo { width: 200px; height: 200px; justify-self: center; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 8px var(--orange-100); }
.thanks__photo img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 700px) {
  .thanks__inner { grid-template-columns: auto 1fr; gap: 40px; text-align: left; }
  .thanks__photo { width: 220px; height: 220px; }
}

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #CFC6BE; padding: 48px 0 24px; font-size: 15px; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: var(--orange); }
.footer h3 { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.footer .muted { color: #9A8F86; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr auto; } }
.footer__brand { display: flex; gap: 14px; align-items: center; }
.footer__brand img { background: #fff; border-radius: 14px; padding: 4px; }
.footer__name { color: #fff; font-weight: 800; margin: 0 0 2px; }
.footer__brand p { margin: 0; }
.social { display: flex; gap: 10px; }
.social a {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); transition: background-color .15s;
}
.social a:hover { background: var(--orange); color: #fff; }
.footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.footer__bottom p { margin: 0; font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  max-width: calc(100% - 32px); width: max-content;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 15px; z-index: 100;
}

.paypal .requisites { margin-bottom: 16px; }
.steps { margin: 0 0 18px; padding-left: 1.4em; font-size: 15px; display: grid; gap: 4px; }
.steps li::marker { color: var(--orange-600); font-weight: 800; }
