/*
 * «Подключить заведение» (templates/connect.html, js/connect.js). Тёплый стол: овсяная бумага, какао-текст,
 * травяные действия. Сначала телефон, затем планшет (≥760) и компьютер (≥1040). Только токены brand.css.
 */
.cn {
  --cn-ink: var(--brand-charcoal, #29251f);
  --cn-muted: var(--brand-muted, #6d655a);
  --cn-line: var(--brand-line, #e5dfd4);
  --cn-bg: var(--brand-cream, #f7f4ed);
  --cn-soft: var(--brand-soft, #f0eae0);
  --cn-paper: #fff;
  --cn-green: var(--brand-green, #34784a);
  --cn-green-strong: var(--brand-green-strong, #245b37);
  --cn-wash: var(--brand-green-wash, #eaf3e8);
  --cn-danger: var(--brand-danger, #b42332);
  --cn-ease: cubic-bezier(.22, 1, .36, 1);
  margin: 0;
  background: var(--cn-bg);
  color: var(--cn-ink);
  font-family: var(--brand-font, 'Manrope', system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.cn *, .cn *::before, .cn *::after { box-sizing: border-box; }
.cn h1, .cn h2, .cn h3 { margin: 0; line-height: 1.12; letter-spacing: -.02em; color: var(--cn-ink); }
.cn p { margin: 0; }
.cn a { color: var(--cn-green-strong); }
.cn-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.cn-skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--cn-ink); color: #fff !important; font-weight: 700; }
.cn-skip:focus { top: 12px; }
.cn :focus-visible { outline: 3px solid var(--cn-green); outline-offset: 2px; }

/* ── Кнопки ── */
.cn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px;
  background: var(--cn-green); color: #fff !important; font: inherit; font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .15s var(--cn-ease), box-shadow .15s ease; touch-action: manipulation; }
.cn-btn:hover { background: var(--cn-green-strong); }
.cn-btn:active { transform: scale(.98); }
.cn-btn svg { width: 20px; height: 20px; flex: none; }
.cn-btn--sm { min-height: 44px; padding: 0 16px; font-size: .92rem; border-radius: 12px; }
.cn-btn--ghost { background: var(--cn-paper); color: var(--cn-ink) !important; box-shadow: 0 0 0 1.5px var(--cn-line) inset; }
.cn-btn--ghost:hover { background: var(--cn-paper); box-shadow: 0 0 0 2px var(--cn-green) inset; }
.cn-btn--tg { background: #2a8bc9; }
.cn-btn--tg:hover { background: #1f72a8; }
.cn-btn--wide { width: 100%; }
.cn-btn[disabled] { opacity: .65; cursor: progress; }
.cn-btn.is-busy span::after { content: ''; display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: -3px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: cn-spin .8s linear infinite; }
@keyframes cn-spin { to { transform: rotate(360deg); } }

/* ── Шапка ── */
.cn-bar { position: sticky; top: 0; z-index: 20; background: rgba(247,244,237,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(229,223,212,.7); }
.cn-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.cn-logo img { display: block; width: auto; height: 34px; }
.cn-bar-nav { display: flex; align-items: center; gap: 6px; }
.cn-bar-link { display: none; padding: 10px 12px; border-radius: 10px; color: var(--cn-ink) !important; font-weight: 700; font-size: .92rem; text-decoration: none; }
.cn-bar-link:hover { background: var(--cn-soft); }

/* ── Первый экран ── */
.cn-hero { padding: 28px 0 60px; overflow: hidden; }
.cn-hero-in { display: grid; gap: 28px; }
.cn-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; background: var(--cn-wash);
  color: var(--cn-green-strong); font-size: .82rem; font-weight: 800; }
.cn-hero h1 { font-size: clamp(2rem, 7.4vw, 3.4rem); font-weight: 800; text-wrap: balance; }
.cn-lead { margin-top: 14px !important; max-width: 36em; color: var(--cn-muted); font-size: 1.06rem; line-height: 1.6; }
.cn-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cn-hero-cta .cn-btn { flex: 1 1 200px; }
.cn-hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.cn-hero-facts li { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--cn-paper); box-shadow: 0 0 0 1px var(--cn-line) inset; }
.cn-hero-facts b { font-size: .92rem; line-height: 1.25; }
.cn-hero-facts span { color: var(--cn-muted); font-size: .78rem; line-height: 1.3; }

.cn-hero-art { position: relative; min-height: 300px; display: grid; place-items: center; }
.cn-hero-art::before { content: ''; position: absolute; inset: 8% 4% 4%; border-radius: 32px; background: radial-gradient(120% 90% at 30% 20%, #fbe7d3 0%, var(--brand-apricot, #f4d3b4) 45%, #efc39c 100%); }
.cn-ticket { position: relative; z-index: 1; width: min(340px, 86%); margin-right: 12%; padding: 16px; border-radius: 20px; background: var(--cn-paper);
  box-shadow: 0 24px 50px rgba(70,49,26,.18), 0 0 0 1px rgba(229,223,212,.8); transform: rotate(-2deg); }
.cn-ticket-head { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; color: var(--cn-muted); }
.cn-ticket-head b { color: var(--cn-ink); }
.cn-ticket-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.cn-dot { width: 10px; height: 10px; border-radius: 50%; background: #2f9a55; box-shadow: 0 0 0 4px rgba(47,154,85,.18); }
.cn-ticket-lines { margin: 12px 0; padding: 12px 0; list-style: none; border-top: 1px dashed var(--cn-line); border-bottom: 1px dashed var(--cn-line); display: grid; gap: 6px; font-size: .9rem; }
.cn-ticket-lines li { display: flex; justify-content: space-between; gap: 10px; }
.cn-ticket-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--cn-muted); }
.cn-ticket-foot b { color: var(--cn-ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.cn-ticket-actions { display: flex; gap: 8px; margin-top: 12px; }
.cn-chip-on, .cn-chip-off { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: .84rem; font-weight: 800; }
.cn-chip-on { background: var(--cn-green); color: #fff; }
.cn-chip-off { background: var(--cn-soft); color: var(--cn-muted); }
.cn-raccoon { position: absolute; z-index: 2; right: -6px; bottom: -34px; width: 32%; max-width: 230px; height: auto; filter: drop-shadow(0 12px 18px rgba(70,49,26,.18)); }

/* ── Секции ── */
.cn-section { padding: 44px 0; }
.cn-section--soft { background: var(--cn-paper); border-top: 1px solid var(--cn-line); border-bottom: 1px solid var(--cn-line); }
.cn-section h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; text-wrap: balance; }
.cn-grid { display: grid; gap: 12px; margin-top: 22px; }
.cn-card { padding: 18px; border-radius: 20px; background: var(--cn-paper); box-shadow: 0 0 0 1px var(--cn-line) inset; }
.cn-card h3 { margin-top: 12px; font-size: 1.08rem; font-weight: 800; }
.cn-card p { margin-top: 6px; color: var(--cn-muted); font-size: .94rem; line-height: 1.55; }
.cn-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--cn-wash); color: var(--cn-green-strong); }
.cn-ico svg { width: 22px; height: 22px; }
.cn-note { margin-top: 18px !important; padding: 14px 16px; border-radius: 16px; background: var(--cn-soft); color: var(--cn-ink); font-size: .94rem; line-height: 1.55; }

.cn-steps { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: none; }
.cn-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 20px; background: var(--cn-bg); }
.cn-step-n { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--cn-green); color: #fff; font-weight: 800; font-size: 1.05rem; }
.cn-steps h3 { font-size: 1.08rem; font-weight: 800; }
.cn-steps p { margin-top: 4px; color: var(--cn-muted); font-size: .94rem; line-height: 1.55; }

/* ── Заявка ── */
.cn-lead-grid { display: grid; gap: 16px; align-items: start; }
.cn-form-box { padding: 20px 16px; border-radius: 24px; background: var(--cn-paper); box-shadow: 0 1px 2px rgba(70,49,26,.05), 0 16px 40px rgba(70,49,26,.08); }
.cn-form-sub { margin-top: 6px !important; color: var(--cn-muted); font-size: .92rem; }
.cn-form { display: grid; gap: 18px; margin-top: 20px; }
.cn-form[hidden], .cn-form-sub[hidden], .cn-summary[hidden] { display: none; }
.cn-row { display: grid; gap: 18px; }
.cn-field { display: grid; gap: 6px; min-width: 0; }
.cn-field > label, .cn-choice legend { font-size: .9rem; font-weight: 800; color: var(--cn-ink); }
.cn-req { color: var(--cn-danger); }
.cn-opt { color: var(--cn-muted); font-weight: 600; }
.cn input:not([type=radio]):not([type=checkbox]), .cn textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--brand-field, #faf8f3); color: var(--cn-ink);
  font: inherit; font-size: 16px; box-shadow: 0 0 0 1.5px var(--cn-line) inset; transition: box-shadow .15s ease, background .15s ease; }
.cn textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.cn input:not([type=radio]):not([type=checkbox]):hover, .cn textarea:hover { box-shadow: 0 0 0 1.5px #d3cbbd inset; }
.cn input:not([type=radio]):not([type=checkbox]):focus, .cn textarea:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--cn-green) inset, var(--brand-focus, 0 0 0 4px rgba(52,120,74,.16)); }
.cn input[aria-invalid=true], .cn textarea[aria-invalid=true] { box-shadow: 0 0 0 2px var(--cn-danger) inset !important; background: #fff; }
.cn-hint { color: var(--cn-muted); font-size: .82rem; }
.cn-err { display: flex; gap: 6px; color: var(--cn-danger); font-size: .86rem; font-weight: 700; }
.cn-err[hidden] { display: none; }
.cn-err::before { content: '!'; flex: none; width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: var(--cn-danger); color: #fff; font-size: .72rem; font-weight: 800; }

.cn-choice { margin: 0; padding: 0; border: 0; min-width: 0; }
.cn-choice legend { padding: 0; margin-bottom: 8px; }
.cn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cn-chip { position: relative; display: inline-flex; cursor: pointer; }
.cn-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cn-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--brand-field, #faf8f3);
  box-shadow: 0 0 0 1.5px var(--cn-line) inset; font-size: .92rem; font-weight: 700; line-height: 1.25; transition: background .15s ease, box-shadow .15s ease, color .15s ease; }
.cn-chip:hover span { box-shadow: 0 0 0 1.5px #cfc6b6 inset; }
.cn-chip input:checked + span { background: var(--cn-wash); color: var(--cn-green-strong); box-shadow: 0 0 0 2px var(--cn-green) inset; }
.cn-chip input:checked + span::before { content: ''; width: 14px; height: 8px; margin-right: 8px; border: solid currentColor; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.cn-chip input:focus-visible + span { outline: 3px solid var(--cn-green); outline-offset: 2px; }

.cn-consent { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; font-weight: 600 !important; line-height: 1.5; color: var(--cn-muted) !important; cursor: pointer; }
.cn-consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cn-green); cursor: pointer; }
.cn-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cn-summary { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #fdf1f0; box-shadow: 0 0 0 1px #f3d2cf inset; color: var(--cn-ink); font-size: .92rem; }
.cn-summary b { display: block; margin-bottom: 6px; color: var(--cn-danger); }
.cn-summary ul { margin: 0; padding-left: 18px; }
.cn-summary a { font-weight: 700; }

.cn-done { display: grid; justify-items: center; gap: 10px; padding: 26px 8px 8px; text-align: center; }
.cn-done[hidden] { display: none; }
.cn-done:focus { outline: none; }
.cn-done-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--cn-wash); color: var(--cn-green); animation: cn-pop .4s var(--cn-ease); }
.cn-done-ico svg { width: 32px; height: 32px; }
.cn-done h3 { font-size: 1.4rem; font-weight: 800; }
.cn-done p { max-width: 30em; color: var(--cn-muted); }
.cn-done .cn-btn { margin-top: 8px; background: #2a8bc9; }
.cn-done .cn-btn:hover { background: #1f72a8; }
.cn-done-sub { font-size: .86rem; }
@keyframes cn-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.cn-side { display: grid; gap: 12px; }
.cn-side-card { display: grid; gap: 8px; padding: 18px; border-radius: 20px; background: var(--cn-paper); box-shadow: 0 0 0 1px var(--cn-line) inset; }
.cn-side-card h3 { font-size: 1.08rem; font-weight: 800; }
.cn-side-card p { color: var(--cn-muted); font-size: .92rem; line-height: 1.5; }
.cn-side-card .cn-btn { margin-top: 6px; }
.cn-side-note { padding: 4px 4px 0; color: var(--cn-muted); font-size: .88rem; }

/* ── Вопросы ── */
.cn-faq { display: grid; gap: 10px; margin-top: 20px; }
.cn-faq details { border-radius: 16px; background: var(--cn-bg); }
.cn-faq summary { position: relative; display: block; min-height: 56px; padding: 16px 52px 16px 18px; font-weight: 800; cursor: pointer; list-style: none; line-height: 1.4; }
.cn-faq summary::-webkit-details-marker { display: none; }
.cn-faq summary::after { content: ''; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border: solid var(--cn-muted); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform .2s var(--cn-ease); }
.cn-faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.cn-faq details p { padding: 0 18px 18px; color: var(--cn-muted); line-height: 1.6; }

/* ── Планшет ── */
@media (min-width: 760px) {
  .cn-wrap { padding: 0 24px; }
  .cn-bar-link { display: inline-flex; }
  .cn-hero { padding: 48px 0 56px; }
  .cn-hero-cta .cn-btn { flex: 0 0 auto; }
  .cn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cn-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cn-steps li { flex-direction: column; }
  .cn-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cn-form-box { padding: 28px; }
  .cn-section { padding: 64px 0; }
}
/* ── Компьютер ── */
@media (min-width: 1040px) {
  .cn-hero-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 40px; }
  .cn-hero-art { min-height: 420px; }
  .cn-ticket { margin-right: 18%; }
  .cn-raccoon { width: 46%; right: 0; bottom: -6px; }
  .cn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cn-lead-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
  .cn-side { position: sticky; top: 88px; }
  .cn-form-box { padding: 36px; }
  .cn-faq-wrap { max-width: 860px; }
}
@media (max-width: 380px) {
  .cn-hero-facts { grid-template-columns: 1fr; }
  .cn-logo img { height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .cn-btn, .cn-faq summary::after { transition: none; }
  .cn-done-ico { animation: none; }
  .cn-btn.is-busy span::after { animation-duration: 2s; }
}
