/* main stylesheet, part 4 of 6: pagination, contact and error pages, Jalali date picker, booking popup, skeletons.
   Loaded in this order by templates/base.html; the parts are one cascade, order matters. */
/* ── Pagination ──────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 0 0.5rem;
}

.button.pagination-btn {
  padding: 0.4rem 1rem;
  font-size: var(--fs-90);
}

.button.pagination-btn:hover {
  transform: none;
  box-shadow: inset 0 0 0 1.5px rgba(37, 145, 147, 0.9);
}

.button.pagination-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pagination-info {
  font-size: var(--fs-85);
  color: var(--muted);
  min-width: 5rem;
  text-align: center;
}

/* ── Contact page ────────────────────────────────────────────────────────── */

.contact-page {
  padding-bottom: 3rem;
}

/* ── 2-column layout (map left, info right in RTL) ── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  align-items: stretch;
}

.contact-map-col {
  display: flex;
  flex-direction: column;
}

.contact-info-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* fallback when no map */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface, #f8fafb);
  border: 1px solid var(--teal-12);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-card:hover {
  box-shadow: 0 6px 20px var(--teal-10);
  transform: translateY(-2px);
}

.contact-card-address {
  cursor: default;
}

.contact-card-address:hover {
  transform: none;
  box-shadow: none;
}

.contact-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  background: var(--teal-10);
  color: var(--accent, var(--accent-strong));
  flex-shrink: 0;
}

.contact-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-card-icon img {
  opacity: 0.75;
}

.contact-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-card-label {
  font-size: var(--fs-78);
  color: var(--muted);
  font-weight: 500;
}

.contact-card-value {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.contact-no-info {
  color: var(--muted);
  font-size: var(--fs-95);
}

.contact-card-phones {
  cursor: default;
}

.contact-card-phones:hover {
  transform: none;
  box-shadow: none;
}

.contact-phone-list {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  direction: ltr;
  unicode-bidi: isolate;
  word-break: normal;
}

.contact-phone-link {
  color: inherit;
  text-decoration: none;
  direction: ltr;
  unicode-bidi: bidi-override;
  white-space: nowrap;
  display: inline-block;
}

.contact-phone-link:hover {
  color: var(--accent-strong, var(--accent));
}

.contact-phone-sep {
  padding: 0 0.55rem;
  opacity: 0.35;
  user-select: none;
}

.contact-map {
  flex: 1;
  min-height: 420px;
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Error pages (404 / 500) ─────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 10rem 1rem 4rem;
  text-align: center;
}

@media (max-width: 768px) {
  .error-page {
    padding-top: 7rem;
  }
}

.error-code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: rgba(37, 145, 147, 0.15);
  letter-spacing: -0.02em;
  user-select: none;
}

.error-message {
  max-width: 38rem;
  color: var(--muted);
  font-size: var(--fs-105);
  line-height: 1.8;
  margin: 0;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .contact-map {
    min-height: 280px;
  }
}

/* ── Jalali date picker ──────────────────────────────────────────────────── */

.jdp-popup {
  position: absolute;
  /* Above .cal-modal-backdrop (1300) — this picker is now also opened from
     inside a calendar modal (the schedule-exception date field), so it must
     out-rank the modal it's nested in, not just page content. */
  z-index: 1400;
  width: 280px;
  background: #fff;
  border: 1px solid var(--teal-18);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(33, 50, 58, 0.2);
  padding: 0.85rem;
  font-family: "Peyda", Tahoma, Arial, sans-serif;
}

.jdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  margin-bottom: 0.75rem;
}

.jdp-title {
  font-weight: 700;
  font-size: var(--fs-95);
  color: var(--accent-strong);
}

.jdp-title-selects {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.jdp-month-select,
.jdp-year-select {
  direction: rtl;
  border: 1px solid var(--teal-18);
  border-radius: var(--radius-sm);
  background: var(--teal-05);
  color: var(--accent-strong);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-85);
  padding: 0.2rem 0.3rem;
  cursor: pointer;
}

.jdp-year-select {
  min-width: 4.2rem;
}

/* Custom-select for the picker's own month/year fields — the native
   <select> stays in the DOM (hidden) as the source of truth. */
.jdp-custom-select {
  position: relative;
  direction: rtl;
}

.jdp-custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--teal-18);
  border-radius: var(--radius-sm);
  background: var(--teal-05);
  color: var(--accent-strong);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--fs-85);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: background 0.12s ease-out;
}

.jdp-custom-select-trigger:hover {
  background: var(--teal-10);
}

.jdp-custom-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jdp-custom-select-chevron {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--accent-strong);
  transition: transform 0.15s ease;
}

.jdp-custom-select-trigger[aria-expanded="true"] .jdp-custom-select-chevron {
  transform: rotate(180deg);
}

.jdp-custom-select-list {
  /* Fixed (not absolute) and positioned from JS in viewport coordinates —
     an absolutely-positioned list here could poke past the document's
     current bottom edge and grow page scrollHeight, causing a visible
     jump/scrollbar-flicker the instant it opens. Fixed never affects
     document flow, so that can't happen regardless of where it renders. */
  position: fixed;
  z-index: var(--z-modal);
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border-radius: 0.65rem;
  box-shadow: 0 0 0 1px var(--teal-14), 0 16px 40px rgba(33, 50, 58, 0.18);
}

.jdp-custom-select-option {
  display: block;
  width: 100%;
  text-align: right;
  white-space: nowrap;
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 0.45rem;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  transition: background 0.1s ease-out;
}

.jdp-custom-select-option:hover {
  background: var(--teal-08);
}

.jdp-custom-select-option[aria-selected="true"] {
  background: var(--teal-14);
  color: var(--accent-strong);
  font-weight: 700;
}

.jdp-nav {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-sm2);
  background: var(--teal-08);
  color: var(--accent-strong);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.jdp-nav:hover { background: var(--teal-18); }

.jdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.3rem;
}

.jdp-weekdays span {
  text-align: center;
  font-size: var(--fs-72);
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0;
}

.jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.jdp-blank { aspect-ratio: 1; }

.jdp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-85);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.jdp-day:hover { background: var(--teal-10); }

.jdp-day.today {
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(37, 145, 147, 0.35) inset;
}

.jdp-day.selected {
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}

.jdp-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--teal-10);
  font-size: var(--fs-85);
  color: var(--muted);
}

.jdp-time select {
  font-family: inherit;
  font-size: var(--fs-85);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 145, 147, 0.25);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.jdp-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.jdp-actions button {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius-sm2);
  border: none;
  font-family: inherit;
  font-size: var(--fs-82);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.jdp-clear {
  background: rgba(30, 30, 30, 0.05);
  color: var(--muted);
}
.jdp-clear:hover { background: rgba(30, 30, 30, 0.1); }

.jdp-confirm {
  background: var(--accent-strong);
  color: #fff;
}
.jdp-confirm:hover { background: #1f7d7f; }

.jdp-input { cursor: pointer; background: #fff; }

/* ── Reservation Modal ───────────────────────────────────────────────────── */

/* hidden attribute must win over explicit display rules (flex/grid) */
[hidden] {
  display: none !important;
}

.res-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 30, 30, 0.55);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.res-backdrop.open {
  display: flex;
  opacity: 1;
}

.res-dialog {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
}

.res-box {
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-12);
  border-radius: 1.35rem;
  box-shadow: 0 32px 80px rgba(33, 50, 58, 0.18);
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform 0.22s;
}

.res-backdrop.open .res-box {
  transform: translateY(0);
}

.res-close {
  position: absolute;
  top: -3rem;
  left: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  padding: 0;
  z-index: 1;
  transition: background 0.15s;
}

.res-close::before {
  content: "";
  position: absolute;
  inset: -0.4rem;
}

.res-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.res-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Discard-answers confirm — nested above the reservation modal itself
   (higher z-index), styled like the rest of the site's own modal system
   instead of the browser's native confirm() dialog. */
.res-confirm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(30, 30, 30, 0.55);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.18s;
}

.res-confirm-backdrop.open {
  display: flex;
  opacity: 1;
}

.res-confirm-box {
  width: min(460px, 100%);
  background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%);
  border: 1px solid var(--teal-12);
  border-radius: 1.35rem;
  box-shadow: 0 32px 80px rgba(33, 50, 58, 0.22);
  padding: 2rem 2.1rem;
  transform: translateY(10px);
  transition: transform 0.18s;
}

.res-confirm-backdrop.open .res-confirm-box {
  transform: translateY(0);
}

.res-confirm-box .res-title {
  font-size: 1.15rem;
}

.res-confirm-text {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: var(--fs-92);
}

.res-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* The lift-on-hover from the base .button rule reads fine on a normal
   button in open space, but jittery this close together in a small,
   stacked pair — keep the hover feedback as just a color/background
   change, the same way .button-flat and .button.secondary already do
   elsewhere. */
.res-confirm-actions .button {
  transform: none !important;
  box-shadow: none !important;
}

.res-confirm-actions .button.primary:hover {
  background: var(--accent-strong);
}

.res-confirm-discard {
  color: var(--danger);
}

.res-confirm-discard:hover {
  background: rgba(180, 40, 40, 0.07);
}

.res-header {
  padding: 1.5rem 1.5rem 0;
}

.res-for {
  margin-bottom: 0.9rem;
  font-size: var(--fs-88);
  color: var(--muted);
}

.res-for strong {
  color: var(--text);
}

.res-for a {
  margin-inline-start: 0.4rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.res-stepper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.res-step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal-10);
  color: var(--muted);
  font-size: var(--fs-82);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.res-step-dot.active {
  background: var(--accent-strong);
  color: #fff;
}

.res-step-dot.done {
  background: rgba(34, 120, 70, 0.15);
  color: #227846;
}

.res-step-line {
  flex: 1;
  height: 2px;
  background: var(--teal-12);
  border-radius: 1px;
  transition: background 0.2s;
}

.res-step-line.done {
  background: rgba(34, 120, 70, 0.3);
}

.res-counselor-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: var(--teal-05);
  border: 1px solid var(--teal-10);
  margin-bottom: 1.1rem;
}

.res-counselor-bar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(37, 145, 147, 0.15);
}

.res-counselor-bar-info .res-counselor-name {
  font-weight: 700;
  font-size: var(--fs-95);
  color: var(--text);
}

.res-counselor-bar-info .res-counselor-role {
  font-size: var(--fs-82);
  color: var(--muted);
}

.res-body {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.res-title {
  font-size: var(--fs-105);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

/* Counselor picker */
.res-counselor-list {
  display: grid;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}

.res-counselor-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1.5px solid var(--teal-12);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: right;
  width: 100%;
}

.res-counselor-card:hover,
.res-counselor-card.selected {
  border-color: var(--accent-strong);
  background: var(--teal-04);
}

.res-counselor-card img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.res-counselor-card-name {
  font-weight: 600;
  font-size: var(--fs-92);
}

.res-counselor-card-role {
  font-size: var(--fs-80);
  color: var(--muted);
}

/* Session type cards */
.res-session-types {
  display: grid;
  gap: 0.6rem;
}

.res-session-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border-radius: 0.9rem;
  border: 1.5px solid var(--teal-14);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 100%;
  text-align: right;
}

.res-session-card:hover {
  border-color: rgba(37, 145, 147, 0.4);
}

.res-session-card.selected {
  border-color: var(--accent-strong);
  background: var(--teal-05);
  box-shadow: 0 0 0 1px var(--accent-strong) inset;
}

.res-session-card-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 0.7rem;
  background: var(--teal-08);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.res-session-card.selected .res-session-card-icon {
  background: var(--accent-strong);
  color: #fff;
}

.res-session-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.res-session-card-label {
  font-weight: 600;
  font-size: var(--fs-95);
}

.res-session-card-price {
  font-size: var(--fs-82);
  color: var(--accent-strong);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.res-session-card-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--teal-30);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.res-session-card-check::after {
  content: "";
  width: 6px;
  height: 10px;
  margin-bottom: 2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.res-session-card.selected .res-session-card-check {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.res-session-card.selected .res-session-card-check::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

/* Intake questionnaire */
.res-q-error {
  font-size: 0.83rem;
  color: var(--danger);
  background: rgba(180, 40, 40, 0.07);
  border: 1px solid rgba(180, 40, 40, 0.15);
  border-radius: var(--radius-sm2);
  padding: 0.6rem 0.85rem;
}

.res-required {
  color: var(--accent);
}

.res-question.missing .form-input {
  border-color: var(--danger);
}

.res-question.missing .res-question-label {
  color: var(--danger);
}

.res-question {
  display: grid;
  gap: 0.45rem;
}

.res-question-label {
  font-size: var(--fs-88);
  font-weight: 600;
  color: var(--text);
}

.res-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.res-radio-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(37, 145, 147, 0.2);
  background: #fff;
  font-size: var(--fs-82);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.res-radio-option:has(input:checked) {
  background: var(--teal-10);
  border-color: var(--accent-strong);
  color: var(--accent-strong);
  font-weight: 600;
}

.res-radio-option input {
  display: none;
}

/* Summary */
.res-summary-card {
  border-radius: 0.85rem;
  background: var(--teal-04);
  border: 1px solid var(--teal-10);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.res-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-88);
  gap: 1rem;
}

.res-summary-row-label {
  color: var(--muted);
}

.res-summary-row-value {
  font-weight: 600;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.res-summary-divider {
  height: 1px;
  background: var(--teal-10);
}

.res-payable-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-95);
  font-weight: 700;
  color: var(--accent-strong);
  gap: 1rem;
}

.res-notice {
  font-size: var(--fs-82);
  color: var(--muted);
  line-height: 1.7;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: rgba(222, 63, 130, 0.05);
  border: 1px solid rgba(222, 63, 130, 0.1);
}

.res-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--fs-85);
}

.res-terms-row input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.res-terms-row a {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* Footer actions */
.res-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--teal-07);
}

.res-footer .button {
  min-width: 180px;
}

.res-footer .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Success screen */
.res-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2.5rem 1.5rem 2rem;
}

.res-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34, 120, 70, 0.1);
  color: #227846;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.res-success h2 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text);
}

.res-success p {
  font-size: var(--fs-90);
  color: var(--muted);
  max-width: 340px;
  margin: 0;
  line-height: 1.75;
}

.res-success p + p {
  font-size: var(--fs-82);
  opacity: 0.7;
}

/* Payment result page (after the gateway) */
.pay-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  max-width: 460px;
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.pay-result h1 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}

.pay-result p {
  font-size: var(--fs-92);
  color: var(--muted);
  margin: 0;
  line-height: 1.85;
}

.pay-result .pay-result-ref {
  font-size: var(--fs-82);
  opacity: 0.8;
}

.res-pay-error {
  color: var(--danger);
  font-size: 0.83rem;
  display: none;
}

/* Session types grid in counselor profile edit */
.session-types-grid {
  display: grid;
  gap: 0.65rem;
}

.session-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-08);
}

.session-type-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-90);
  cursor: pointer;
}

.session-type-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

/* Hover feedback for a .reservation-item row. Deliberately no `cursor:
   pointer` here — plenty of these rows (users, blog, services, challenges,
   counselors) aren't clickable themselves, only their kebab menu is, and a
   pointer cursor over the whole row falsely promised it would do something
   on click. The genuinely clickable variants (a plain link, or one with
   data-res-detail wired to a click handler) get the pointer cursor from the
   more specific rule above instead. */
.reservation-item {
  transition: background 0.15s, border-color 0.15s;
}

.reservation-item:hover {
  background: var(--teal-06);
  border-color: rgba(37, 145, 147, 0.15);
}

/* Drag-and-drop reordering (panel_reorder.js) */
[data-sortable-list] {
  display: grid;
  gap: 0.75rem;
}

.sortable-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  transition: background 0.15s, color 0.15s;
}

.sortable-handle:hover {
  background: var(--teal-10);
  color: var(--accent-strong);
}

.sortable-item.sortable-dragging {
  opacity: 0.5;
  cursor: grabbing;
  user-select: none;
}

[data-sortable-list] [data-sortable-item] {
  cursor: default;
}

.reservation-item-meta {
  font-size: var(--fs-80);
  color: var(--muted);
  grid-column: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.meta-sep {
  color: rgba(0,0,0,0.2);
  font-weight: 300;
  user-select: none;
}

/* Detail popup for reservation */
.res-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: var(--fs-88);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--teal-06);
}

.res-detail-row:last-child {
  border-bottom: none;
}

.res-detail-label {
  color: var(--muted);
  flex-shrink: 0;
}

.res-detail-value {
  font-weight: 600;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.res-appointment-highlight {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(34, 120, 70, 0.08);
  border: 1px solid rgba(34, 120, 70, 0.15);
  font-weight: 700;
  color: #227846;
  font-size: var(--fs-92);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Terms page */
.terms-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.terms-page h1 {
  margin-bottom: 1.5rem;
}

.terms-section {
  margin-bottom: 2rem;
}

.terms-section h2 {
  font-size: var(--fs-105);
  color: var(--accent-strong);
  margin-bottom: 0.5rem;
}

.terms-section p,
.terms-section ul {
  font-size: var(--fs-92);
  color: var(--muted);
  line-height: 1.9;
  margin: 0 0 0.5rem;
}

.terms-section a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Assessments: disclaimer */
.test-disclaimer {
  font-size: var(--fs-85);
  line-height: 1.85;
  color: var(--muted);
  background: rgba(222, 63, 130, 0.05);
  border: 1px solid rgba(222, 63, 130, 0.15);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1rem 0 1.5rem;
}

/* Assessments: question wizard */
.quiz-page {
  max-width: 720px;
  margin: clamp(4rem, 14vh, 8rem) auto clamp(3.5rem, 12vh, 7rem);
}

.quiz-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--teal-10);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 1.5rem 1.5rem 1.75rem;
  view-transition-name: quiz-card;
}

.quiz-progress-track {
  height: 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.quiz-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-strong);
  view-transition-name: quiz-progress-fill;
}

.quiz-progress {
  font-size: var(--fs-82);
  font-weight: 600;
  color: rgba(37, 145, 147, 0.7);
  margin: 0 0 0.6rem;
}

.quiz-question-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.quiz-error {
  font-size: 0.83rem;
  color: var(--danger);
  background: rgba(180, 40, 40, 0.07);
  border: 1px solid rgba(180, 40, 40, 0.15);
  border-radius: var(--radius-sm2);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
}

.quiz-choices {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.quiz-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(37, 145, 147, 0.15);
  background: #fff;
  font-size: var(--fs-92);
  line-height: 1.65;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.quiz-choice:has(input:checked) {
  background: var(--teal-07);
  border-color: var(--accent-strong);
  color: var(--accent-strong);
  font-weight: 600;
}

.quiz-choice input {
  margin-top: 0.2rem;
  accent-color: var(--accent-strong);
  flex: 0 0 auto;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Question-to-question transition (View Transitions API, cross-document).
   The `@view-transition { navigation: auto; }` opt-in lives per-page in
   each assessment template's own <style> block, not here — the main stylesheet (static/css/site/) loads
   on every page, and this should only animate the assessment flow, not
   every navigation site-wide. These rules only take effect on pages that
   opted in and actually render a .quiz-card/.quiz-progress-fill; they're
   inert everywhere else. Browsers without View Transitions support just
   keep today's instant navigation. */
@media (prefers-reduced-motion: no-preference) {
  /* The header/footer/background are pixel-identical between two quiz
     pages, so the browser's default full-page cross-fade was fading the
     *entire* viewport through a transparent blend on every click — that
     "wash" over static chrome is what read as slow/laggy, not the card
     animation itself. Killing it means only the card actually moves;
     everything else holds rock still, which reads as instant + crisp. */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-old(quiz-card) {
    animation: quiz-card-leave 0.11s cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-new(quiz-card) {
    animation: quiz-card-enter 0.16s cubic-bezier(0, 0, 0.2, 1) both;
  }
}

@keyframes quiz-card-leave {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes quiz-card-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ===== Skeleton loading =================================================
   One shared shimmer look, reused everywhere something loads in after the
   page itself has rendered: content-image reveal (.img-skel, wired by
   static/js/img_skeleton.js on every page), the admin dashboard's
   sessions-trend chart, the reception/counselor calendar grid, the
   counselor's client-history list, and the public reservation modal's
   counselor picker. Each caller supplies its own size/shape; this only
   supplies the shimmer + the "stop and reveal real content" mechanics. */
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(30, 30, 30, 0.06) 25%, rgba(30, 30, 30, 0.13) 37%, rgba(30, 30, 30, 0.06) 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-circle {
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-line {
  height: 0.85em;
  border-radius: var(--radius-pill);
}

.skeleton-block {
  border-radius: 0.65rem;
}

/* Content-image reveal: wrap an <img> in an element carrying .img-skel.
   img_skeleton.js adds .img-skel-active once it starts watching that img
   (only when one is actually present — an avatar's initials-fallback span
   never gets a shimmer), then .is-loaded once it has loaded or failed, and
   finally drops .img-skel-active shortly after so the shimmer stops
   animating for good instead of running invisibly forever underneath.
   :where() keeps this at zero specificity so it never fights a wrapper's
   own position — several of these (.service-image, .article-image,
   .service-detail-cover-image, .blog-detail-cover-image) are already
   position:absolute full-bleed layers, and forcing position:relative here
   would collapse them back to a tiny in-flow image. */
:where(.img-skel) {
  position: relative;
}

.img-skel.img-skel-active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(30, 30, 30, 0.06) 25%, rgba(30, 30, 30, 0.13) 37%, rgba(30, 30, 30, 0.06) 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.img-skel.img-skel-active.is-loaded::before {
  opacity: 0;
}

.img-skel.img-skel-active > img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.img-skel.img-skel-active.is-loaded > img {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .img-skel.img-skel-active::before {
    animation: none;
    background-position: 0 0;
  }
}

/* Assessments: result page */
.result-page {
  max-width: 920px;
  margin: 0 auto;
}

.result-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--teal-10);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 2rem 2.5rem;
  text-align: center;
}

/* Inside the panel it sits directly on a .dashboard-section, which already
   supplies its own border + shadow — keeping both here doubled up into a
   visible card-inside-a-card outline. */
.dashboard-section .result-card {
  border: 0;
  box-shadow: none;
  padding: 0;
}

.result-band-label {
  font-size: var(--fs-120);
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 1.25rem;
}

.result-paragraph {
  font-size: var(--fs-95);
  line-height: 2;
  color: var(--muted);
  text-align: right;
  max-width: 680px;
  margin: 1.75rem auto 1.5rem;
}

/* Assessments: result scale (visual interval showing score position) */
.result-scale {
  max-width: 640px;
  margin: 0 auto 0.5rem;
}

.result-scale-track {
  position: relative;
  display: flex;
  height: 0.85rem;
  border-radius: var(--radius-pill);
  overflow: visible;
}

.result-scale-segment {
  height: 100%;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.result-scale-segment:first-child {
  border-radius: 999px 0 0 999px;
}

.result-scale-segment:last-child {
  border-radius: 0 999px 999px 0;
}

.result-scale-segment.active {
  opacity: 1;
}

.result-scale-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.result-scale-marker-dot {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.result-scale-labels {
  display: flex;
  margin-top: 0.5rem;
}

.result-scale-label {
  font-size: var(--fs-72);
  color: var(--muted);
  text-align: center;
  padding: 0 0.2rem;
}

.result-scale-label.active {
  color: var(--text);
  font-weight: 700;
}

/* Assessments: per-subscale result (tests with no single meaningful total,
   e.g. GARS-3 -- one small bar per subscale instead of one banded gauge) */
.subscale-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 640px;
  margin: 1.75rem auto;
}

/* These result components (.result-paragraph/.result-scale/.subscale-list)
   were sized to float inside the public site's narrow centered container.
   The panel's .dashboard-section content column is much wider, so the same
   fixed caps leave a large empty margin on both sides instead of filling
   the card — let them use the section's actual width there instead. */
.dashboard-section .result-paragraph {
  max-width: none;
}

/* .result-scale/.subscale-list specifically end in a fully round pill cap
   (border-radius: 999px) rather than a square edge — flush against the
   card's own rounded corner, that pill end optically reads as poking past
   it even though the margin matches the paragraph text exactly. A small
   fixed inset (rather than max-width: none) keeps them nearly full-width
   while giving the rounded ends breathing room. */
.dashboard-section .result-scale,
.dashboard-section .subscale-list {
  max-width: calc(100% - 2rem);
}

.subscale-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.subscale-row-label {
  font-size: var(--fs-95);
  font-weight: 700;
  color: var(--text);
}

.subscale-row-score {
  font-size: var(--fs-85);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.subscale-bar-track {
  height: 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.subscale-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-strong);
}

.result-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  background: var(--teal-06);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.result-score-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.result-score-max {
  font-size: var(--fs-85);
  color: var(--muted);
}

.result-risk-notice {
  font-size: var(--fs-88);
  line-height: 1.85;
  color: #7a3a1f;
  background: rgba(234, 130, 8, 0.1);
  border: 1px solid rgba(234, 130, 8, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  text-align: right;
  margin-bottom: 1.5rem;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Assessments: history list */
.history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--teal-03);
  border: 1px solid var(--teal-07);
  margin-bottom: 0.6rem;
}

.history-item-title {
  font-size: var(--fs-95);
  font-weight: 600;
  color: var(--accent-strong);
}

.history-item-date {
  font-size: var(--fs-82);
  color: var(--muted);
}

.history-item-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.history-item-score-value {
  font-weight: 700;
  color: var(--accent-strong);
}

.history-item-band {
  font-size: var(--fs-78);
  color: var(--muted);
  background: var(--teal-07);
  border-radius: var(--radius-pill);
  padding: 0.18rem 0.6rem;
}

.terms-section ul {
  padding-right: 1.25rem;
}

