/* Pochatok — кабінет: реєстрація (signup.html), вибір шаблону (cabinet.html), перегляд шаблону (cabinet-template.html).
   Figma: реєстрація 49:914, вибір 49:979, перегляд 49:1167 — лише десктоп; мобільне тут — мої запасні правила.
   Підключається після style.css (і inner.css — на сторінках з чорним верхом). */

/* ================= buttons used in the cabinet ================= */
.cbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 10px 30px;
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
  transition: opacity .2s;
}
.cbtn:hover { opacity: .85; }
.cbtn--white { background: var(--white); color: var(--black); }
.cbtn--grey  { background: #d9d9d9; color: var(--black); }
.cbtn--black { background: var(--black); color: var(--white); }

/* ================= SIGN-UP (Figma 49:914, 1440×900) ================= */
.signup {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--black);
}

/* left half: the hero photo, 1946×1095 in a 720×900 box, centre shifted (-100, -97.5) */
.signup__media {
  position: relative;
  flex: 0 0 50%;
  overflow: hidden;
  background: #1d3a2c;
  color: var(--white);
}
.signup__photo {
  /* the first slide's photo (08.10), covering the half like the slides above it */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.signup__caption {
  position: absolute;
  left: var(--pad);
  bottom: 41px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.signup__name { font-size: 20px; line-height: 1.1; }
.signup__desc { font-size: 16px; line-height: 1.65; color: #d9d9d9; }
.signup__bars {
  position: absolute;
  left: var(--pad);
  bottom: 20px;
  width: 454px;
  max-width: calc(100% - 2 * var(--pad));
  display: flex;
  gap: 4px;
  height: 1px;
}
/* template videos (from the hero) — cross-fade like .hero__video; same crop box as the photo */
.signup__videos { position: absolute; inset: 0; z-index: 0; pointer-events: none; }   /* own stacking layer: the active fill's z-index 1 stays inside it, under the caption + bars (09.10 they were hidden) */
.signup__fill { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease .8s; background: center / cover no-repeat; }   /* slide photos (08.10) over their colour */
.signup__fill.is-active { opacity: 1; z-index: 1; transition: opacity .8s ease; }   /* the next fades in ON TOP, the old one goes after — no third photo through both */
.signup__caption { transition: opacity .3s; }
.signup__caption.is-changing { opacity: 0; }
/* the navigator works like the hero's: segment = slide, its timer bar fills while the slide is shown, click = go */
.signup__bars span { position: relative; flex: 1 0 0; display: flex; align-items: center; background: rgba(255, 255, 255, .35); cursor: pointer; }
.signup__bars span::after { content: ""; position: absolute; inset: -10px 0; } /* bigger hit area */
.signup__bars i { display: block; width: 0; height: 4px; background: var(--white); }
.signup__bars .is-active i { width: 34px; }   /* static markup only (no JS) */

/* right half: logo mark + form as ONE block, centred vertically; the mark sits 28 px above the form
   (the Figma gap at 900 px). At 900 px high this lands exactly on the design (mark y=80, form y=168). */
.signup__panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 80px 140px;
  color: var(--white);
}
.signup__mark { display: block; color: var(--white); }
/* the mark's intro animation (.lmark) lives in style.css — shared with the site-building loader */

.signup__form { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 40px; }
.signup__head { display: flex; flex-direction: column; gap: 20px; text-align: center; }
.signup__title { font-size: var(--fs-xl); line-height: 1.1; text-wrap: balance; }
/* 16.10 (user: «З поверненням» in one line at 64): on desktop the head is wider than the 440 fields: the panel (= half of
   the page, the photo half is 50 %) minus 60 a side, at most 640; centred over the form; the lead stays 440 */
@media (min-width: 901px) {
  .signup { container-type: inline-size; }
  .signup__head { align-self: center; width: min(calc(50cqw - 120px), 640px); }
  .signup__sub { max-width: 440px; margin-inline: auto; }
}
.signup__sub { font-size: 18px; line-height: 1.65; color: #d9d9d9; }

.signup__socials, .signup__email { display: flex; flex-direction: column; gap: 16px; }
.sbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 48px;
  padding: 16px;
  background: rgba(186, 185, 185, .15);
  color: #d9d9d9;
  font-size: 14px;
  line-height: 1.65;
  white-space: nowrap;
  transition: background-color .2s;
}
.sbtn:hover { background: rgba(186, 185, 185, .25); }
.sbtn img { flex: none; width: 24px; height: 24px; object-fit: contain; }
.sbtn:disabled { cursor: default; opacity: .5; }
.sbtn:disabled:hover { background: rgba(186, 185, 185, .15); }
.sbtn__soon { margin-left: -8px; }
.sbtn__soon::before { content: '· '; }

.signup__or {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(217, 217, 217, .65);
  white-space: nowrap;
}
.signup__or::before, .signup__or::after { content: ""; flex: 1 1 0; height: 1px; background: rgba(255, 255, 255, .35); }

.signup__field { display: flex; flex-direction: column; gap: 10px; }
.signup__label { font-size: 14px; line-height: 1.65; color: rgba(217, 217, 217, .65); }
.signup__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(186, 185, 185, .5);
  outline: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 14px;
  transition: border-color .25s;
}
.signup__input:focus { border-color: rgba(186, 185, 185, .9); }

/* ---------- step 2: password (no Figma frame — built from the same tokens as step 1) ---------- */
.signup__form [hidden] { display: none !important; }   /* .signup__email etc. are display:flex — keep [hidden] winning */
.signup__step-in { animation: signup-step .45s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes signup-step { from { opacity: 0; transform: translateY(12px); } }

.signup__who { color: var(--white); word-break: break-all; }
.signup__change {
  color: #d9d9d9;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.signup__change:hover { color: var(--white); }
.signup__change:disabled, .signup__change:disabled:hover { color: rgba(217, 217, 217, .65); text-decoration: none; cursor: default; }

.signup__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.signup__forgot { font-size: 14px; line-height: 1.65; color: #d9d9d9; transition: color .2s; }
.signup__forgot:hover { color: var(--white); }

.signup__pass { position: relative; display: block; }
.signup__pass .signup__input { padding-right: 104px; }
.signup__eye {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(217, 217, 217, .65);
  transition: color .2s;
}
.signup__eye:hover { color: #d9d9d9; }
.signup__hint { font-size: 12px; line-height: 1.65; color: rgba(217, 217, 217, .65); }
.signup__error { font-size: 14px; line-height: 1.65; color: #ff8f80; }
/* 16.10: an info line in the error's place (e-mail confirmed, sign in by hand) = the yellow plate, never red */
.signup__error.is-info { color: var(--black); background: var(--accent); padding: 12px 16px; }
.signup__input[aria-invalid="true"] { border-color: rgba(255, 143, 128, .7); }

/* visually hidden, but present for password managers (username + new/current password pair) */
.signup__email { position: relative; }
.signup__username {
  left: 0;
  top: 0;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.signup__note { font-size: 14px; line-height: 1.65; text-align: center; color: rgba(217, 217, 217, .65); }
.signup__note a { color: #d9d9d9; transition: color .2s; }
.signup__note a:hover { color: var(--white); }

/* ================= cabinet header (Figma 49:981) ================= */
.header__user { display: flex; align-items: center; gap: 32px; font-size: 16px; line-height: 1.35; } /* 40 to the icon − its 8 px tap padding */
.header__greet { white-space: nowrap; transition: opacity .2s; }
a.header__greet:hover { opacity: .7; }
.header--cabinet .header__burger { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; }
/* «?» help icon right next to the burger (user 03.10); account things live in the burger menu */
.header__help { display: grid; place-items: center; width: 44px; height: 44px; color: var(--white); transition: opacity .2s; }
.header__help:hover { opacity: .7; }
.header__help + .header__burger { margin-left: -20px; }
.menu__user { font-size: 16px; line-height: 1.35; color: var(--grey-soft); }
/* «‹ До кабінету сайту» — left, above the content (account sub-pages, the catalogue opened from the cabinet) */
.acc-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1.35; color: var(--grey-text); transition: color .2s; }
.acc-back:hover { color: var(--black); }
.acc-back[hidden] { display: none; }
.cab-list > .acc-back { margin-bottom: -20px; }   /* 40 to the first group, like .acc-solo (the list's gap is 60) */

/* ================= choose a template: groups by theme (Figma 49:1032) — .tpl-group lives in inner.css (08.10) ================= */

/* ================= template preview (Figma 49:1168 / 49:1237) ================= */
.tpl-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px var(--pad-wide) 0;
  text-align: center;
}
.tpl-head__title { font-size: var(--fs-xl); line-height: 1.1; }
.tpl-head__desc { font-size: 18px; line-height: 1.65; color: #d9d9d9; }

.view-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* tabs stay exactly in the centre */
  align-items: center;
  padding: 40px var(--pad-wide) 20px;
}
.view-bar__back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 1.35;
  transition: opacity .2s;
}
.view-bar__back:hover { opacity: .7; }
.view-bar__choose { justify-self: end; }

.view-tabs { display: flex; padding: 4px; background: rgba(186, 185, 185, .15); }
.view-tabs__tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 154px;
  padding: 10px 30px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--white);
  transition: background-color .25s, color .25s;
}
.view-tabs__tab.is-active { background: var(--white); color: var(--black); }
.view-tabs__tab:not(.is-active):not(:disabled):hover { background: rgba(255, 255, 255, .08); }
.view-tabs__icon { flex: none; }
/* «За рік / За місяць» (user 13.10): the same switch (Figma 49:1214: strip 316 × 50, tabs 154 × 42), text only, buttons with
   aria-pressed. On the landing's black «Тарифи» exactly as Figma; on a light surface (--light) inverted: the same sizes and
   translucent strip, the chosen tab black with white text. Narrower than 316 (a grey block at 390) the tabs shrink evenly.
   Disabled = another site joining a subscription that already has its period (site-plan.html). */
.view-tabs--period { max-width: 100%; }
.view-tabs--period .view-tabs__tab { flex: 0 1 154px; min-width: 0; }
.view-tabs__tab:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.view-tabs--light .view-tabs__tab { color: var(--black); }
.view-tabs--light .view-tabs__tab.is-active { background: var(--black); color: var(--white); }
.view-tabs--light .view-tabs__tab:not(.is-active):not(:disabled):hover { background: rgba(0, 0, 0, .08); }
.view-tabs--light .view-tabs__tab:focus-visible { outline-color: var(--black); }
.view-tabs__tab:disabled { opacity: .35; cursor: not-allowed; }

.tpl-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  padding: 40px var(--pad-wide) 140px;
}
/* desktop preview 926 × 578.75 = 1440 × 900 scaled (06.10, was 926×580); phone preview keeps the height, width 306 */
.tpl-view__frame {
  width: 926px;
  max-width: 100%;
  height: calc(926px * 900 / 1440);
  background: var(--grey-bg) center top / cover no-repeat;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.tpl-view__frame.is-phone { width: 306px; }
.tpl-view__actions { display: flex; gap: 20px; }
.tpl-view__choose { width: 222px; }

/* mobile-only parts of the template title row are hidden on desktop */
.tpl-head__back, .tpl-head__spacer { display: none; }

/* ================= in-between widths (no design) ================= */
@media (max-width: 1100px) {
  .signup__panel { padding: 60px 60px; }
}

/* ================= MOBILE (Figma: sign-up 54:1661, choose 54:1291, template 54:1470) ================= */
@media (max-width: 900px) {
  /* sign-up: black page, the form only; mark 36 px, 20 px above the title (same gap as title → subtitle) */
  .signup__media { display: none; }
  .signup__panel { padding: 60px var(--pad); gap: 20px; }
  .lmark { --p: 29px; width: 36.83px; height: 36px; }
  .signup__title { font-size: 28px; }
  .signup__sub { font-size: 16px; }
  /* the Ukrainian terms line doesn't fit 2 lines on 350 px: drop the forced break, balance the 3 lines */
  .signup__note br { display: none; }
  .signup__note { text-wrap: balance; }

  /* cabinet header: logo + burger */
  .header__greet { display: none; }
  .header--cabinet .header__burger { margin: -8px -8px 0 0; }
  /* «?» on the same line as the burger (12.10, user: «іконки на одну лінію»): the burger is lifted 8 px to its design spot —
     the help icon was 4 px lower (centre 38 vs 34 at 390) */
  .header--cabinet .header__help { margin-top: -8px; }
  .header__help + .header__burger { margin-left: -12px; }
  .cab-list > .acc-back { margin-bottom: -8px; }   /* 32, like .acc-solo on the phone (the list's gap is 40) */

  /* choose a template: theme title 28, 20 to the row, 2 cards per theme, themes 40 apart */
  /* (06.10 the phone showed 2 cards per theme — with real templates every one is shown, 08.10) */

  /* template: back · title · spacer row, description; no view bar on mobile */
  .tpl-head { padding: 40px var(--pad) 20px; }
  .tpl-head__row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .tpl-head__back { display: block; flex: none; width: 16px; height: 16px; }
  .tpl-head__back img { display: block; }
  .tpl-head__spacer { display: block; flex: none; width: 16px; height: 16px; }
  .tpl-head__title { font-size: 28px; }
  .tpl-head__desc { font-size: 16px; }
  .view-bar { display: none; }

  /* preview is always the phone screen, full width; «Обрати» first (black), «Переглянути» second (grey) */
  .tpl-view { gap: 40px; }
  .tpl-view__frame,
  .tpl-view__frame.is-phone { width: 100%; height: auto; aspect-ratio: 390 / 740; }
  .tpl-view__actions { flex-direction: column; width: 100%; }
  .tpl-view__actions .cbtn { width: 100%; }
  .tpl-view__choose { order: -1; }
}

/* ================= cabinet burger = side panel from the right, UNDER the header (user 03.10) =================
   No logo / × inside: the header (name, «?», burger) stays on top and uncovered, the burger turns into × (js/main.js).
   The dimmed page is the panel's own huge shadow; a click on it closes the menu. */
.menu--side {
  inset: 82px 0 0 auto;
  width: 400px;
  max-width: 100%;
  padding: 8px 32px 40px;
  opacity: 1;
  transform: translateX(100%);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.menu--side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
.menu--side .menu__top { display: none; }
.menu--side .menu__nav { align-items: flex-start; gap: 0; margin-top: 0; font-size: 16px; }
.menu--side .menu__nav a { width: 100%; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .2); transition: opacity .2s; }
.menu--side .menu__nav a:hover { opacity: .7; }
.menu--side .menu__auth { align-items: flex-start; padding-left: 0; }
.menu--side .menu__user { color: var(--grey-soft); }
/* while it is open the header stays above the panel and its shade, pinned to the top even if the page was scrolled */
body.menu-side-open .header--cabinet { position: fixed; z-index: 101; height: 82px; padding-bottom: 20px; background: var(--black); }
@media (max-width: 900px) { body.menu-side-open .header--cabinet { height: 60px; padding-bottom: 0; } }
@media (max-width: 900px) { .menu--side { inset: 60px 0 0 0; width: auto; } }
@media (prefers-reduced-motion: reduce) { .menu--side { transition: none; } }

/* template change after launch (03.10): the catalogue in «change» mode — info plate → yellow */
.cab-plate { margin-bottom: 48px; padding: 16px 20px; background: var(--accent); font-size: 16px; line-height: 1.5; }
.cab-plate a { text-decoration: underline; text-underline-offset: 4px; }

/* the real template inside the preview frame (04.10): rendered at 1440 / 390 and scaled to the frame by main.js */
.tpl-view__frame { position: relative; overflow: hidden; }
.tpl-view__site { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #000; }
.tpl-view__frame.is-soon { display: flex; align-items: center; justify-content: center; }
.tpl-view__frame.is-soon::after { content: 'Шаблон ще готуємо'; font-size: 16px; color: var(--grey-text); }
.tpl-view__actions .cbtn.is-disabled, .view-bar__choose.is-disabled { opacity: .35; pointer-events: none; }
/* placeholder cards of templates still being made */
.tpl-card.is-soon .tpl-card__name::after { content: ' · скоро'; color: var(--grey-text); }

/* the cabinet's real data comes a moment after the page (api.js → /api/sites…, then main.js draws). Until then the demo texts
   still in the markup («Youremailadress», «Poudre nail studio», «14:00 Eva Marešová»…) stay hidden — only the black header is
   shown (12.10, user: «чому при перезавантаженні тимчасово спливає ця крокозябра?»). html.api-wait is set in each cabinet
   page's <head>, api.js removes it when main.js has run; if that never happens, everything shows after 6 s anyway. */
html.api-wait body > :not(.page-top):not(.menu):not(script),
html.api-wait [data-greet] { visibility: hidden; animation: api-show 0s 6s forwards; }
@keyframes api-show { to { visibility: visible; } }
