/* =========================================================
   Базова система: шрифти, токени, типографіка, кнопки, форми,
   шапка й підвал сайту. Підключається на всіх сторінках.

   Ідея: фотостудія. Один сміливий елемент — суцільний синій «студійний фон»
   (як рулон паперу за товаром), усе інше тихе: білий папір, нейтральний сірий,
   на якому фотографи оцінюють знімки, тонкі лінії. Без градієнтів і світіння;
   тіні — лише під фотографіями, як під відбитками.
   ========================================================= */

/* ---------- Шрифти (локально, з @fontsource-variable) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-cyrillic-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(/fonts/unbounded-latin-wght-normal.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: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-cyrillic-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-latin-wght-normal.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: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url(/fonts/jetbrains-mono-latin-wght-normal.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; }

/* ---------- Токени ---------- */
:root {
  /* Палітра */
  --blue: #2347d5;        /* студійний синій: фон-акцент, кнопки, вибрані стани (з білим 6,8:1) */
  --blue-deep: #16297a;   /* натиснуті стани, текст на світло-синьому */
  --blue-tint: #e7ecfd;   /* вибране, підсвічене */
  --blue-line: #c8d2f7;
  --ink: #151c2c;         /* текст */
  --ink-2: #4d5668;       /* другорядний текст (8,3:1 на білому) */
  --ink-3: #6b7383;       /* підказки (4,9:1 на білому) */
  --paper: #ffffff;
  --studio: #eceef2;      /* нейтральний сірий: тло секцій і перегляду фото */
  --studio-2: #e2e5eb;
  --line: #d8dce4;
  --line-strong: #bcc2cf;

  --ok: #12704f;
  --ok-tint: #dcf1e8;
  --warn: #8a5300;
  --warn-tint: #fbefd6;
  --danger: #b4232c;
  --danger-tint: #fbe5e6;

  /* Старі назви, якими ще користуються сторінки */
  --primary: var(--blue);
  --primary-hover: var(--blue-deep);
  --primary-text: var(--blue);
  --primary-soft: var(--blue-tint);
  --primary-soft-2: var(--blue-line);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --card: var(--paper);
  --paper-2: #f6f7f9;

  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Радіуси за ієрархією: дрібні елементи керування → кнопки → блоки */
  --r-xs: 6px;
  --r-s: 10px;
  --r-btn: 12px;
  --r-m: 14px;
  --r-l: 20px;
  --r-pill: 999px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 120px);
  --header-h: 64px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* Тінь відбитка: під фотографіями й тим, що лежить над сторінкою */
  --shadow-print: 0 1px 1px rgba(21, 28, 44, 0.08), 0 8px 24px -10px rgba(21, 28, 44, 0.35);
  --shadow-float: 0 2px 6px rgba(21, 28, 44, 0.08), 0 20px 50px -18px rgba(21, 28, 44, 0.4);

  color-scheme: light;
  accent-color: var(--blue);
}

/* ---------- Скидання ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(h1, h2, h3, h4, p, figure, blockquote, dl, dd) { margin: 0; }
:where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r-xs); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-s);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографіка ---------- */
.h1, .h2, .display {
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}
.h1 { font-size: clamp(2.2rem, 1.4rem + 2.8vw, 3.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.h2 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.75rem); line-height: 1.08; letter-spacing: -0.03em; }
.h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 750; letter-spacing: -0.01em; text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.18rem); line-height: 1.6; color: var(--ink-2); max-width: 34em; }
.muted { color: var(--ink-2); }
/* Цифри однакової ширини — для лічильників і сум, що змінюються */
.mono { font-variant-numeric: tabular-nums; }
p { text-wrap: pretty; }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
  --btn-h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-weight: 700; font-size: 0.97rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: scale(0.97); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn--sm { --btn-h: 40px; padding: 0 16px; font-size: 0.92rem; }
.btn--lg { --btn-h: 54px; padding: 0 28px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--soft { background: var(--blue-tint); color: var(--blue-deep); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
/* Кнопки на синьому тлі */
.btn--on-blue { background: var(--paper); color: var(--blue-deep); }
.btn--ghost-dark { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--quiet { background: transparent; color: var(--ink-2); padding-inline: 12px; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--blue-deep); }
  .btn--dark:hover { background: #26304a; }
  .btn--light:hover, .btn--ghost:hover { border-color: var(--ink); }
  .btn--soft:hover { background: var(--blue-line); }
  .btn--on-blue:hover { background: var(--blue-tint); }
  .btn--ghost-dark:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
  .btn--danger:hover { background: #8f1a21; }
  .btn--quiet:hover { color: var(--ink); background: var(--studio); }
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; }

/* Текстове посилання-дія */
.link { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) { .link:hover { color: var(--blue-deep); } }

.spinner {
  width: 22px; height: 22px; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Форми ---------- */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 18px; }
.field__label { font-weight: 700; font-size: 0.92rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__hint { font-size: 0.85rem; color: var(--ink-3); font-weight: 500; }
.field__error { font-size: 0.86rem; color: var(--danger); font-weight: 600; }
.field__error:empty { display: none; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--paper);
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.input { min-height: 92px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #8b92a0; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 71, 213, 0.18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 44, 0.15); }
@media (hover: hover) { .input:hover:not(:focus) { border-color: var(--ink-3); } }
@media (forced-colors: active) { .input:focus { outline: 2px solid Highlight; } }
.input--with-btn { padding-right: 52px; }
.input-wrap { position: relative; }
.input-wrap__btn {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
}
@media (hover: hover) { .input-wrap__btn:hover { color: var(--ink); background: var(--studio); } }
.input-wrap__btn svg { width: 20px; height: 20px; }
.input-wrap__btn .icon-eye-off { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon-eye { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon-eye-off { display: block; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; cursor: pointer; }
.check a { color: var(--ink); }

.form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-s);
  font-size: 0.92rem; line-height: 1.45; font-weight: 600;
}
.form-alert:empty { display: none; }
.form-alert--error { background: var(--danger-tint); color: var(--danger); }
.form-alert--ok { background: var(--ok-tint); color: var(--ok); }
.form-alert--info { background: var(--blue-tint); color: var(--blue-deep); }
.form-alert a { color: inherit; font-weight: 800; }

/* Сегментовані перемикачі (radio) */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-s);
  background: var(--paper); font-weight: 650; font-size: 0.92rem; cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
@media (hover: hover) { .segmented label:hover { border-color: var(--ink); } }
.segmented input:checked + label { background: var(--blue); border-color: var(--blue); color: #fff; }
.segmented input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Назва сервісу (текстовий знак замість іконки) ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; border-radius: var(--r-xs); }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.045em; line-height: 1; }

/* ---------- Шапка сайту ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header[data-scrolled] { border-bottom-color: var(--line); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a {
  padding: 8px 12px; border-radius: var(--r-s);
  text-decoration: none; font-weight: 600; font-size: 0.94rem; color: var(--ink-2);
  transition: color 150ms ease;
}
@media (hover: hover) { .site-nav a:hover { color: var(--ink); } }
.site-header__actions { display: flex; align-items: center; gap: 6px; }
.site-header__login { padding: 8px 12px; font-weight: 700; font-size: 0.94rem; text-decoration: none; border-radius: var(--r-s); }
@media (hover: hover) { .site-header__login:hover { color: var(--blue); } }
.nav-toggle {
  display: none;
  width: 44px; height: 44px; margin-left: auto;
  place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--paper);
}
.nav-toggle svg { width: 20px; height: 20px; }
.mobile-nav { display: none; }

@media (max-width: 960px) {
  .site-nav, .site-header__actions .site-header__login { display: none; }
  .site-header__actions { margin-left: auto; }
  .nav-toggle { display: grid; margin-left: 0; }
  .mobile-nav {
    display: block;
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
    padding: 4px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(21, 28, 44, 0.4);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
  .mobile-nav a:last-child { border-bottom: 0; }
}
.site-header__cta-short { display: none; }
@media (max-width: 480px) {
  .site-header__inner { gap: 12px; }
  .site-header__actions .btn { padding-inline: 14px; }
  .site-header__cta-long { display: none; }
  .site-header__cta-short { display: inline; }
}

/* ---------- Підвал ---------- */
.site-footer { padding: 56px 0 36px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.94rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.site-footer__brand p { margin-top: 12px; max-width: 26ch; }
.site-footer h2 { font-family: var(--font-body); font-size: 0.92rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; color: var(--ink-2); font-weight: 600; }
@media (hover: hover) { .site-footer a:hover { color: var(--blue); } }
.site-footer__bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Сповіщення (toasts) ---------- */
.toasts {
  position: fixed; z-index: 200; left: 50%; bottom: 24px; translate: -50% 0;
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-m);
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-float);
  font-weight: 600; font-size: 0.94rem; line-height: 1.4;
  animation: toast-in 300ms var(--ease-out);
}
.toast--error { background: #5c1418; }
.toast__icon { flex: none; width: 20px; height: 20px; }
.toast[data-leaving] { animation: toast-out 200ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; } }

/* ---------- Діалоги ---------- */
dialog.modal {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0; border-radius: var(--r-l);
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-float);
}
dialog.modal::backdrop { background: rgba(21, 28, 44, 0.5); }
dialog.modal[open] { animation: modal-in 220ms var(--ease-out); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal__body { padding: 28px; }
.modal__title { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 10px; }
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-2);
}
@media (hover: hover) { .modal__close:hover { background: var(--studio); color: var(--ink); } }
.modal__close svg { width: 20px; height: 20px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }

/* Менше руху: прибираємо зсуви, лишаємо зміну прозорості */
@media (prefers-reduced-motion: reduce) {
  .toast, dialog.modal[open] { animation-name: fade-in; }
  .btn:active:not(:disabled, [aria-disabled="true"]) { transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
