/* Страницы клиента: запись (index.html), кабинет клиента (portal.html), мини-приложение Telegram (app.html). Видеозвонок — css/call.css. */

.page.app .hero {
  gap: 14px;
  margin-bottom: 16px;
}

.client-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}

.client-nav .tab {
  border: 1px solid var(--line);
  background: #fff;
}

.telegram-book {
  margin: 16px 0 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.pay-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
}

.pay-box p {
  margin: 0 0 8px;
}

.window-row,
.list-row,
.journal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #efe6d8;
}

body.client .client-nav {
  display: inline-flex;
  gap: 0;
  border: 1px solid #e4ebe7;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
}

body.client .client-nav .tab {
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 10px 16px;
  background: transparent;
  color: #111916;
  font-size: 13px;
  font-weight: 700;
}

body.client .client-nav .tab.on {
  background: #e5f4ed;
  color: #217752;
}

/* ---------- Кабинет клиента, опрос, задание (portal.html) ---------- */

.page.portal {
  width: min(640px, calc(100% - 32px));
  padding: 24px 0 72px;
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.portal-top .brand-bar {
  margin: 0;
}

.portal-back {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.portal-head {
  margin-bottom: 22px;
}

.portal-head h1 {
  font-size: clamp(1.75rem, 4.6vw, 2.4rem);
  line-height: 1.1;
  margin: 0 0 8px;
}

.portal-head .hint {
  max-width: 34em;
  font-size: 15px;
}

body.client .portal .card {
  padding: 20px 22px;
  margin-bottom: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Скелетон загрузки */
.portal-skel {
  display: grid;
  gap: 14px;
}

.portal-skel span {
  display: block;
  height: 120px;
  border-radius: 18px;
  background: linear-gradient(90deg, #eef2f0 0%, #f7f9f8 50%, #eef2f0 100%);
  background-size: 200% 100%;
  animation: portal-shimmer 1.4s linear infinite;
}

.portal-skel span:first-child {
  height: 190px;
}

.portal-skel.small span {
  height: 56px;
}

@keyframes portal-shimmer {
  to { background-position: -200% 0; }
}

/* Пилюли статусов */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.pill-ok {
  background: #e5f4ed;
  color: #1d6b48;
}

.pill-warn {
  background: #fdf1e3;
  color: #8a4b12;
}

.pill-new {
  background: #123b2d;
  color: #fff;
}

.pill-move {
  background: #eef2ff;
  color: #3b4a8a;
  white-space: normal;
}

/* Ближайшая встреча */
.next-card {
  border-color: #cfe5da;
  box-shadow: 0 14px 34px rgba(18, 59, 45, 0.07);
}

.next-card.is-live {
  border-color: #23865f;
  box-shadow: 0 0 0 3px #e5f4ed, 0 14px 34px rgba(18, 59, 45, 0.1);
}

.next-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d6b48;
}

.next-when h2 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  line-height: 1.15;
}

.next-when h2::first-letter {
  text-transform: uppercase;
}

.next-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Местное время клиента рядом с московским */
.next-local {
  font-size: 14px;
  font-weight: 600;
}

.next-rel {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.next-rel.is-soon {
  color: #1d6b48;
}

.next-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.next-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.next-actions:empty {
  display: none;
}

body.client .btn-video {
  background: #23865f;
  box-shadow: 0 9px 22px rgba(35, 134, 95, 0.28);
}

body.client .btn-video:hover {
  background: #1d6b48;
}

.video-later {
  flex: 1 1 220px;
  font-size: 14px;
}

.move-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: #eef2ff;
  color: #2f3a6b;
  font-size: 14px;
}

.move-note strong {
  display: block;
  margin-bottom: 2px;
}

.pay-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pay-inline > div:first-child {
  flex: 1 1 240px;
}

.pay-inline-title {
  margin: 0 0 2px;
  font-weight: 800;
}

.pay-inline .hint {
  font-size: 14px;
}

.pay-inline .hint strong {
  color: var(--ink);
  white-space: nowrap;
}

.pay-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Разделы */
.portal-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 18px;
}

.section-title .count {
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f4f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.meet-list,
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.meet-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.meet-list > .meet-row:first-child {
  border-top: 0;
}

.meet-date strong {
  display: block;
  font-size: 15px;
}

.meet-date span {
  font-size: 14px;
  color: var(--muted);
}

.meet-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meet-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

.meet-actions .link-btn {
  min-height: 32px;
  font-size: 14px;
  text-decoration: none;
}

.meet-row.is-past .meet-date strong {
  font-weight: 700;
  color: var(--muted);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: inherit !important;
  text-decoration: none;
}

.item-list > li:first-child .item-row {
  border-top: 0;
}

a.item-row:hover .item-title {
  color: #111916;
}

.item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-weight: 700;
  line-height: 1.35;
}

.item-sub {
  font-size: 13px;
  color: var(--muted);
}

.item-sub:empty {
  display: none;
}

.item-go {
  color: var(--muted);
  font-weight: 700;
}

body.client .btn-small {
  padding: 9px 14px;
  font-size: 13px;
  box-shadow: none;
}

.item-row.is-done .item-title {
  color: var(--muted);
}

/* Материалы и прошедшие — раскрываются */
.material {
  border-top: 1px solid var(--line);
}

.material:first-child {
  border-top: 0;
}

.material summary,
.past-block > summary:hover {
  color: #111916;
}

.past-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.material summary::-webkit-details-marker,
.past-block > summary::-webkit-details-marker {
  display: none;
}

.material summary::after,
.past-block > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid #6d7773;
  border-bottom: 2px solid #6d7773;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s;
}

.material[open] summary::after,
.past-block[open] > summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.past-block > summary {
  justify-content: flex-start;
  margin: 0;
  min-height: 32px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.past-block > summary::after {
  margin-left: auto;
}

.past-block[open] > summary {
  margin-bottom: 4px;
}

.portal-text {
  font-size: 16px;
  line-height: 1.6;
}

.portal-text p {
  margin: 0 0 0.8em;
}

.portal-text p:last-child {
  margin-bottom: 0;
}

.material .portal-text {
  padding: 0 0 14px;
  color: #2a3430;
}

.portal-foot {
  margin: 18px 4px 0;
  font-size: 14px;
}

.portal-empty h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.portal-done {
  text-align: center;
  padding: 34px 22px !important;
}

.portal-done h2 {
  margin-bottom: 6px;
}

.portal-done .btn {
  margin-top: 18px;
}

.done-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e5f4ed;
  color: #1d6b48;
  font-size: 24px;
  font-weight: 800;
}

/* Шторки: перенос и оплата */
.portal-sheet {
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  overflow: auto;
}

.portal-sheet::backdrop {
  background: rgba(17, 25, 22, 0.4);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-head h2 {
  margin: 0 0 2px;
  font-size: 20px;
}

.sheet-close:hover {
  background: #e5ebe8;
}

.sheet-close {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f2;
  color: #111916;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sheet-step {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.move-dates {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.move-dates .chip {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: center;
}

.move-dates .chip .d {
  text-transform: none;
}

.move-dates .chip .n {
  white-space: nowrap;
}

.portal-sheet .error {
  margin: 6px 0 0;
}

.portal-sheet .error:empty {
  min-height: 0;
}

.portal-sheet .slots .slot {
  min-width: 82px;
}

.sheet-note {
  margin-top: 16px !important;
  font-size: 13px;
}

.sheet-submit {
  width: 100%;
  margin-top: 8px;
}

body.client .btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.move-empty {
  padding: 8px 0 4px;
}

.pay-sheet {
  text-align: center;
}

.pay-sum {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.pay-phone {
  margin: 4px 0 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.portal-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 13px;
  background: #123b2d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(17, 25, 22, 0.25);
}

.portal-toast.is-error {
  background: #8f3232;
}

/* Опрос */
.test-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -4px 14px;
  padding: 10px 4px;
  background: #f7f9f8;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.test-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e4ebe7;
  overflow: hidden;
}

.test-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #23865f;
  transition: width 0.2s;
}

fieldset.question {
  min-width: 0;
  margin: 0 0 12px;
  transition: border-color 0.15s;
}

fieldset.question.is-answered {
  border-color: #cfe5da;
}

.question-num {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.question-text {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

label.answer {
  position: relative;
  display: flex;
  flex-direction: row;
  margin: 0;
  font-size: 15px;
  cursor: pointer;
}

label.answer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

label.answer span {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s;
}

label.answer:hover span {
  border-color: #8fbca7;
}

label.answer input:checked + span {
  border-color: #23865f;
  background: #e5f4ed;
  color: #1d6b48;
  font-weight: 700;
}

label.answer input:focus-visible + span {
  outline: 3px solid #217752;
  outline-offset: 2px;
}

.test-submit {
  margin-top: 18px;
  text-align: center;
}

.test-submit .btn {
  min-width: 240px;
}

.test-submit .hint {
  margin-top: 10px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .page.portal {
    padding-top: 16px;
  }

  .portal-top {
    margin-bottom: 20px;
  }

  body.client .portal .card {
    padding: 18px 16px;
  }

  .next-actions .btn,
  .pay-inline-actions .btn {
    flex: 1 1 auto;
  }

  .pay-inline-actions {
    width: 100%;
  }

  .meet-row {
    grid-template-columns: 1fr auto;
  }

  .meet-info {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .answers {
    grid-template-columns: 1fr;
  }

  .portal-sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 88vh;
    margin: auto 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation: sheet-up 0.2s ease-out;
  }

  .test-submit .btn {
    width: 100%;
  }
}

.portal-empty p:first-child {
  margin-top: 0;
}

/* Страница записи: экран «Вы записаны» (24.10.2026 — без раздела «Мои записи») */
.done-card {
  text-align: center;
}

.done-card h2 {
  margin-bottom: 4px;
}

.done-when {
  margin: 6px 0 2px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.done-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.done-block:empty {
  display: none;
}

.done-label {
  margin: 0 0 4px;
  font-weight: 800;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.done-card a.btn:not(.ghost),
.done-card a.btn:not(.ghost):hover {
  color: #fff;
}

.done-block.done-actions {
  margin-top: 18px;
}

.done-foot {
  margin-top: 18px !important;
}

.done-card .pay-sheet .btn.ghost {
  margin-bottom: 4px;
}

@media (max-width: 520px) {
  .done-actions .btn {
    width: 100%;
  }
}

/* Галочка согласия на странице записи: в одну строку с текстом (раньше растягивалась на всю ширину над текстом) */
label.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.4;
}
label.check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent, #23865f);
}

