/* «От всех нас». Стиль по мотивам Serif: заголовки с засечками, белый фон,
   светлые полосы-секции, плоские карточки с тонкой рамкой. Сначала телефон. */

@font-face { font-family: "Playfair Display"; font-weight: 600; font-display: swap; src: url(/fonts/playfair-display-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Playfair Display"; font-weight: 600; font-display: swap; src: url(/fonts/playfair-display-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-display: swap; src: url(/fonts/playfair-display-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-display: swap; src: url(/fonts/playfair-display-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/fonts/source-sans-3-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url(/fonts/source-sans-3-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url(/fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122; }

/* Цвета. Чтобы сменить основной цвет сайта, достаточно поменять три строки --primary... */
:root {
  --primary: #b84a33;        /* терракотовый */
  --primary-dark: #963a27;
  --primary-soft: #f8e6df;
  --accent2: #e9b44c;        /* золотистый для мелких акцентов */
  --ink: #2f2f41;
  --grey: #5c5a66;
  --offset: #faf6f2;
  --line: #ebe4de;
  --card: #ffffff;
  --err: #b3261e;
  --ok: #1f6b3a;
  --head: "Playfair Display", Georgia, "Times New Roman", serif;
  --base: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 18px/1.5 var(--base); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--grey); }
h1, h2, h3 { font-family: var(--head); font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 2rem; line-height: 1.15; margin: 1.5rem 0 .75rem; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 0 0 .75rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
h3 { font-size: 1.1rem; line-height: 1.35; margin: 1.25rem 0 .5rem; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 56px; }
.main-wide { padding-bottom: 0; }

/* Шапка */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; }
.logo { font-family: var(--head); font-weight: 700; font-size: 1.25rem; color: var(--ink); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--primary); margin-right: 6px; }

/* Кнопки: плоские, с небольшим скруглением, текст заглавными */
.btn {
  display: inline-block; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--primary); color: #fff; font: 600 .95rem/1 var(--base);
  text-transform: uppercase; letter-spacing: .04em; text-align: center; text-decoration: none;
  padding: 17px 26px; min-height: 52px; transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.btn-wide { display: block; width: 100%; margin-top: 12px; }
.btn-light { background: var(--primary-soft); color: var(--primary-dark); }
.btn-light:hover { background: #f3d6cb; color: var(--primary-dark); }
.btn-sm { padding: 11px 14px; min-height: 40px; font-size: .78rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.muted { color: var(--grey); }
.center { text-align: center; }
.small { font-size: .88rem; }
.lead { font-size: 1.2rem; color: var(--grey); }
.hint { font-size: .9rem; color: var(--grey); margin-top: 10px; }

/* Главная: первый экран */
.intro { padding: 32px 0 24px; overflow: hidden; }
.intro-in { display: grid; gap: 8px; align-items: center; }
.intro h1 { font-size: 2.3rem; margin-top: 0; }
.hero-img { width: 100%; height: auto; display: block; max-width: 520px; margin: 0 auto; mix-blend-mode: multiply; }

/* Полосы-секции */
.strip { padding: 48px 0; }
.strip-grey { background: var(--offset); }
.strip-diagonal { transform: skewY(-4deg); margin: 24px 0; padding: 64px 0; }
.strip-diagonal > .container { transform: skewY(4deg); }
.sec-title { font-size: 1.7rem; display: block; margin: 0 0 1rem; }
.sec-lead { margin-top: -.25rem; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.step-num::before { content: counter(s); font-family: var(--head); font-size: 2.2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.steps h3 { margin: 8px 0 6px; }
.steps p { margin: 0; }

.features { display: grid; gap: 14px; }
.feature { border: 1px solid var(--line); border-radius: 6px; padding: 22px 20px; text-align: center; background: #fff; }
.feature-dot { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); align-items: center; justify-content: center; font-size: 1.4rem; }
.feature h3 { margin: 12px 0 6px; }
.feature p { margin: 0; }

.wishes { display: grid; gap: 12px; margin-top: 12px; }
.wish { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.wish p { margin: 0 0 8px; color: var(--ink); }
.wish b { font-family: var(--head); color: var(--primary); }

.faq { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; list-style-position: outside; }
.faq p { margin: 8px 0 0; }

/* Обложка открытки */
.cover {
  margin: 16px 0 8px; border-radius: 6px; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  color: #fff; text-align: center; font: 700 1.6rem/1.2 var(--head);
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.cover-big { font-size: 1.9rem; }
.cover-dark { color: var(--ink); text-shadow: 0 1px 0 rgba(255,255,255,.6); padding: 24px 22%; }
.step-img { display: block; width: 140px; height: 140px; margin: 0 auto 8px; object-fit: contain; mix-blend-mode: multiply; }
.cover-photo { background-size: cover !important; background-position: center !important; }

/* Формы */
.form { margin-top: 16px; }
.field { display: block; margin: 0 0 20px; border: 0; padding: 0; }
.field > span, .field > legend, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; color: var(--ink); }
.field small { font-weight: 400; color: var(--grey); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid #d9d0c8; border-radius: 4px; padding: 12px 14px; min-height: 50px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; }
input[type=file] { padding: 10px; background: var(--offset); }

.cover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cover-pick { position: relative; cursor: pointer; text-align: center; font-size: .85rem; }
.cover-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.cover-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 4px; border: 3px solid transparent; }
/* выбранная обложка */
.cover-pick input:checked + .cover-thumb { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.cover-pick input:focus-visible + .cover-thumb { outline: 3px solid var(--primary); }
.cover-name { display: block; margin-top: 4px; color: var(--grey); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 6px; font-size: .95rem; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--primary); }

.err { color: var(--err); font-size: .9rem; margin: 6px 0 0; }
.err-box { background: #fdecec; color: var(--err); padding: 12px 14px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#suggest { margin-bottom: 20px; }

.notice { background: #eaf5ee; border: 1px solid #c6e3d0; border-radius: 6px; padding: 16px; margin-top: 18px; color: var(--ink); }
.notice b { display: block; font-family: var(--head); font-size: 1.15rem; margin-bottom: 4px; }
.notice .copy-src { margin-top: 10px; font-size: .85rem; }

/* Блоки на страницах управления */
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 20px 16px; margin-top: 18px; }
.copy-src { font-size: .95rem; background: var(--offset); }
.count { font: 600 .85rem/1.4 var(--base); color: var(--primary-dark); background: var(--primary-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.count-wait { background: #fff1d6; color: #7a5000; }
.count-ok { background: #e1f4e8; color: var(--ok); }
.test-note { background: #fff1d6; color: #7a5000; padding: 8px 12px; border-radius: 4px; font-size: .9rem; }

.sig-list { list-style: none; padding: 0; margin: 0; }
.sig-list li { border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 12px; align-items: flex-start; }
.sig-photo { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; flex: none; }
.sig-body { min-width: 0; flex: 1; }
.sig-body p { margin: 2px 0 4px; font-size: .95rem; white-space: pre-line; overflow-wrap: anywhere; }
.sig-list li.is-hidden { opacity: .45; }
.link-btn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: .9rem; color: var(--primary); text-decoration: underline; cursor: pointer; min-height: 0; }
.photo-now { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.photo-now img { width: 96px; height: 96px; object-fit: cover; border-radius: 4px; }
.cover-form { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }

.plans { display: grid; gap: 14px; margin: 14px 0 20px; }
.plan { border: 1px solid var(--line); border-radius: 6px; padding: 18px; background: #fff; }
.plan-accent { border: 2px solid var(--primary); }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--head); font-size: 1.3rem; }
.price { font-weight: 700; color: var(--primary); }
.plan ul { margin: 10px 0 4px; padding-left: 20px; color: var(--grey); }

/* Страница получателя */
.reveal .cover { animation: pop .9s cubic-bezier(.2,.8,.2,1.1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.88) rotate(-2deg); } to { opacity: 1; transform: none; } }
.from-line { margin-top: 4px; }
.wish-grid { display: grid; gap: 14px; margin: 18px 0; }
.wish-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; animation: rise .6s ease both; break-inside: avoid; }
.wish-card img { width: 100%; border-radius: 4px; display: block; margin-bottom: 12px; }
.wish-card p { margin: 0 0 8px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.wish-card b { font-family: var(--head); font-size: 1.1rem; color: var(--primary); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.again { margin-top: 28px; background: var(--offset); }
.center-h { justify-content: center; }

/* Документы */
.legal h2 { display: block; font-size: 1.2rem; margin-top: 1.75rem; }
.legal p, .legal li { color: var(--ink); }
.lawyer { background: #fff1a8; padding: 0 4px; border-radius: 3px; font-size: .9rem; }
.draft-note { background: #fff1d6; color: #7a5000; padding: 10px 12px; border-radius: 4px; }

/* Подвал - в основном цвете, как в Serif */
.foot { background: var(--primary); color: #fff; margin-top: 0; }
.wrap + .foot { margin-top: 24px; }
.foot-in { display: grid; gap: 18px; padding-top: 36px; padding-bottom: 28px; }
.foot-logo { font: 700 1.35rem var(--head); color: #fff; margin: 0 0 6px; }
.foot-text { color: rgba(255,255,255,.85); margin: 0; }
.foot-links { display: flex; flex-direction: column; gap: 8px; }
.foot a { color: #fff; }
.subfoot { background: var(--primary-dark); color: rgba(255,255,255,.85); font-size: .85rem; padding: 14px 0; }

/* Плашка cookies */
.cookie { position: fixed; left: 8px; right: 8px; bottom: 8px; background: var(--ink); color: #fff; border-radius: 6px; padding: 14px; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 10; max-width: 560px; margin: 0 auto; }
.cookie p { margin: 0 0 10px; color: #fff; }
.cookie a { color: #ffd2c2; }
.cookie-btns { display: flex; gap: 8px; }
.cookie-btns .btn { flex: 1; min-height: 44px; padding: 12px 8px; font-size: .78rem; }
.cookie[hidden] { display: none; }

/* Админка */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; }
.stats b { font: 700 1.4rem var(--head); }
.stats span { color: var(--grey); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
.adm { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm th, .adm td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.adm tr.is-hidden td { opacity: .45; }

@media (prefers-reduced-motion: reduce) { .reveal .cover, .wish-card { animation: none; } .btn:hover { transform: none; } }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  .intro { padding: 72px 0 48px; }
  .intro-in { grid-template-columns: 1.05fr 1fr; gap: 40px; }
  .intro h1 { font-size: 3.1rem; }
  .strip { padding: 72px 0; }
  .strip-diagonal { padding: 96px 0; }
  .sec-title { font-size: 2.1rem; }
  .steps, .features { grid-template-columns: repeat(3, 1fr); }
  .example { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
  .example .cover { margin: 0; }
  .example .wishes { margin-top: 0; }
  .plans { grid-template-columns: 1fr 1fr; }
  .cover-grid { grid-template-columns: repeat(4, 1fr); }
  .cover { font-size: 2.1rem; }
  .wish-grid { grid-template-columns: 1fr 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}

/* Версия для печати: A4, без меню и кнопок */
@page { size: A4; margin: 14mm; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .top, .foot, .cookie, .no-print, script { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .cover { aspect-ratio: auto; height: 90mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wish-card, .reveal .cover { animation: none !important; opacity: 1 !important; transform: none !important; }
  .wish-grid { display: block; columns: 2; column-gap: 8mm; }
  .wish-card { margin: 0 0 6mm; display: inline-block; width: 100%; }
  .wish-card img { max-height: 60mm; object-fit: cover; }
}
