/* components.css: переиспользуемые блоки. Новая страница берёт их как есть. */

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: var(--r-pill);
  font-weight: 600; font-size: 1.0625rem; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s, opacity .25s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:active { transform: translateY(-1px) scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.form.is-unavailable .btn[disabled] { cursor: not-allowed; }
.btn--sm { min-height: 44px; padding: 0 22px; font-size: 1rem; }

/* ---------- Шапка ---------- */
/* The reserved header host must stick; its 72 px child cannot stick inside it. */
holas-header:not(:empty) { position: sticky; top: 0; z-index: var(--z-nav); }
.nav { height: var(--nav-h);
  background: transparent; border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s; }
.nav.is-stuck { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav__row { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 3px; white-space: nowrap; }
.nav__links { display: flex; align-items: center; gap: 32px; }
.nav__links a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 1rem; transition: color .2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); }
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav .brand { font-family: var(--font-body); font-weight: 600; font-size: 1.125rem; letter-spacing: .02em; }
}

/* ---------- Поля форм ---------- */
.form { --form-gap: 18px; display: grid; gap: var(--form-gap); }
.field { display: grid; gap: 8px; }
.field label, .field .label { font-size: .9375rem; font-weight: 500; color: var(--ink); padding: 0; }
.field .opt { color: var(--ink-2); font-weight: 400; }
.input {
  width: 100%; min-height: 52px; padding: 13px 16px; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-field); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 132px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.input:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.field[data-invalid] .input { border-color: #A8452B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field[data-invalid] .input { border-color: #E08A6E; } }
.field-error { color: #9A3A22; font-size: .9375rem; min-height: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field-error { color: #F0A58C; } }
.field-help { font-size: .9375rem; color: var(--ink-2); }

.choice__row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500; font-size: 1rem; transition: background-color .2s, color .2s, box-shadow .2s; }
.pill:hover span { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 45%, transparent); }
.pill input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.pill input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }

.form-msg { font-size: 1rem; color: var(--ink); }
.form > .form-msg:empty { margin-top: calc(var(--form-gap) * -1); }
.form-msg strong { font-weight: 600; margin-right: .35em; }
.form-msg[data-state="ok"] { color: var(--accent-ink); font-weight: 500; }
.form-msg[data-state="error"] { color: #9A3A22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-msg[data-state="error"] { color: #F0A58C; } }
.form-msg a { color: inherit; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* антиспам-ловушка */

/* ---------- Телефон ---------- */
.phone { position: relative; width: var(--phone-w, 288px); aspect-ratio: 277 / 600; flex: 0 0 auto; isolation: isolate;
  border: 9px solid #181917; border-radius: 46px; overflow: hidden; background: #4A5941; }
.phone::after { content: ""; position: absolute; inset: 0; border-radius: 37px; background: var(--dim, transparent); opacity: 0; transition: opacity .5s; pointer-events: none; z-index: 2; }
.phone img { width: 100%; height: 100%; object-fit: cover; }

/* Живой экран приложения (собирается в modes.js) */
.app { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 22px 12px 14px; border-radius: 37px; color: #E2D9D2; }
.app__logo { justify-self: center; margin-top: 26px; font-family: var(--font-display); font-weight: 300; font-size: 15px; letter-spacing: .32em; text-indent: .32em; opacity: .95; }
.ring { position: relative; align-self: center; justify-self: center; width: 200px; height: 200px; }
.ray { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ray i { position: absolute; left: -2px; width: 4px; border-radius: 2px; background: #E2D9D2; transform-origin: 50% 100%; }
.ray[data-hot] i { background: #CC5F22; }
.ring__core { position: absolute; inset: 50% auto auto 50%; width: 82px; height: 82px; margin: -41px 0 0 -41px; border-radius: 50%; background: #E2D9D2; display: grid; place-items: center; }
.ring__core span { display: flex; gap: 7px; }
.ring__core b { width: 5px; height: 22px; border-radius: 2px; background: #4A5941; opacity: .8; }
.is-live .ray i { animation: ray var(--t, .8s) ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes ray { from { transform: scaleY(1); } to { transform: scaleY(var(--s, .5)); } }
.ring__spin { position: absolute; inset: 0; }
.is-live .ring__spin { animation: spin 48s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-live .ring__core { animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.09); } }
.is-live .ring__core b { animation: bar .7s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.is-live .ring__core b:last-child { animation-delay: -.35s; }
@keyframes bar { from { transform: scaleY(.55); } to { transform: scaleY(1.15); } }

.np { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; margin: 0 0 12px;
  background: rgba(32,32,32,.34); border-radius: 12px; }
.np__cover { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: rgba(226,217,210,.16); }
.np__cover .icon { width: 22px; height: 22px; }
.np__text { min-width: 0; transition: opacity .35s; }
.np__title { font-size: 14px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np__sub { font-size: 10.5px; letter-spacing: .06em; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.np.is-swap .np__text, .np.is-swap .np__cover { opacity: 0; }
.np__cover { transition: opacity .35s; }
.np .icon.caret { opacity: .7; width: 16px; height: 16px; }

/* ---------- Плавающее подтверждение ---------- */
.foot-note { font-size: .9375rem; color: var(--ink-2); }

/* ---------- Подвал ---------- */
.footer { padding-block: 56px 40px; }
.footer__grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 32px 40px; align-items: center; }
.footer__about { display: grid; gap: 14px; max-width: 40ch; }
.footer__about p { color: var(--ink-2); font-size: 1rem; }
.footer__about a:not(.brand) { color: var(--ink); font-weight: 500; }
.to-top { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .3s var(--ease), background-color .3s, color .3s; }
.to-top:hover { transform: translateY(-4px); background: var(--ink); color: var(--bg); }
.to-top .icon { width: 24px; height: 24px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.footer__legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--ink-2); font-size: .9375rem; padding-top: 28px; border-top: 1px solid var(--line); }
.footer__legal a { color: inherit; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; justify-items: start; } .footer__links { justify-content: flex-start; } .to-top { order: 3; } }

/* ---------- Форма Fibery в окне ---------- */
.form.is-embed > *:not(.embed-cta):not(.card-form__foot):not(.field-help) { display: none; }
.form.is-embed .card-form__foot > *:not(.embed-cta) { display: none; }
.form.is-embed .field-help { display: none; }
.embed { width: min(620px, 94vw); height: min(760px, 90dvh); padding: 0; border: 0; border-radius: var(--r-surface); background: var(--bg); color: var(--ink); overflow: hidden; }
.embed[open] { display: grid; grid-template-rows: auto 1fr; }
.embed::backdrop { background: rgba(20, 22, 19, .6); }
.embed__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.embed__open { font-size: .9375rem; color: var(--ink-2); }
.embed__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; }
.embed__close:hover { background: var(--surface); }
.embed__frame { width: 100%; height: 100%; border: 0; background: #fff; }
.form.is-embed .embed-cta { justify-self: start; }

/* ---------- Подсветка заглушек (страница?stubs) ---------- */
.show-stubs [data-stub] { outline: 2px dashed #CC5F22; outline-offset: 3px; position: relative; }
.show-stubs [data-stub]::after { content: attr(data-stub); position: absolute; top: -10px; right: -6px; padding: 2px 8px; border-radius: 999px; background: #CC5F22; color: #fff; font: 600 11px/1.4 var(--font-body); letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }

/* Analytics consent: a non-modal notice, keeping navigation and forms available. */
.analytics-consent { position: fixed; z-index: 100; inset: auto 16px 16px; max-width: 680px; margin-inline: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--bg, #faf8f2); color: var(--ink); box-shadow: 0 8px 40px #0003; }
.analytics-consent p { margin: 10px 0 16px; font-size: 14px; line-height: 1.5; }
.analytics-consent a { text-decoration: underline; }
.analytics-consent__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.analytics-consent .btn { min-height: 44px; }
@media (max-width: 480px) { .analytics-consent { inset: auto 8px 8px; padding: 16px; max-height: 80dvh; overflow: auto; } }
