/* ==========================================================================
   ZM Dental Studio — Components: buttons, cards, forms, badges
   ========================================================================== */

/* ---- Custom cursor (mouse devices only) ---- */
@media (hover: none) {
  .cursor {
    display: none;
  }
}

.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor__dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.2s;
  pointer-events: none;
  z-index: 9999;
}

.cursor__ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.3s;
}

.cursor--hover .cursor__dot {
  width: 12px;
  height: 12px;
}

.cursor--hover .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: rgba(47, 143, 138, 0.6);
}

.cursor--click .cursor__dot {
  transform: translate(-50%, -50%) scale(0.7);
}

/* ---- Buttons ---- */
.btn {
  --btn-fg: var(--white);
  --btn-bg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-md-0);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.btn svg,
.btn img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:hover svg,
.btn:hover img {
  transform: translateX(3px);
}

.btn--primary {
  --btn-bg: var(--ink);
  --btn-fg: var(--white);
}

.btn--accent {
  --btn-bg: var(--accent);
  --btn-fg: var(--white);
}

.btn--accent:hover {
  --btn-bg: var(--accent-dark);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line);
}

.btn--outline:hover {
  border-color: var(--ink);
  background: var(--ink);
  --btn-fg: var(--white);
}

.btn--ghost-light {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Glassmorphism button — used over photo/dark backgrounds */
.btn--glass {
  --btn-fg: var(--white);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn--glass:hover {
  background: var(--glass-bg-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px rgba(0, 0, 0, 0.18);
}

.btn--sm {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 1.1rem 2.1rem;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.btn--link {
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--accent-dark);
  font-weight: 700;
}

.btn--link:hover {
  transform: none;
  box-shadow: none;
  color: var(--ink);
}

.btn--link::before {
  display: none;
}

/* ---- Icon tile ---- */
.icon-tile {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

.feature-card:hover .icon-tile {
  transform: scale(1.08) rotate(-4deg);
  background: var(--accent);
}

.feature-card:hover .icon-tile img {
  filter: invert(1);
}

.icon-tile img {
  width: 30px;
  height: 30px;
  /* recolors the black line-art icons to the brand teal, so every icon
     reads as an "outline" glyph without needing separate colored assets */
  filter: invert(46%) sepia(59%) saturate(438%) hue-rotate(126deg) brightness(93%) contrast(89%);
  transition: filter var(--dur-base) var(--ease-out);
}

.icon-tile--dark {
  background: rgba(255, 255, 255, 0.1);
}

.icon-tile--dark img {
  filter: invert(1);
}

.icon-tile--square {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
}

.icon-tile--square img {
  width: 22px;
  height: 22px;
}

/* ---- Contact info list (shared: contacts.html + booking.html sidebar) ---- */
.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.contact-info-item:hover {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.contact-info-item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.contact-info-item p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.contact-info-item a {
  color: inherit;
}

/* ---- Features section head (shared: home + services) ---- */
.features-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.features-head__text {
  max-width: 48ch;
}

.features-head__text p {
  margin-top: var(--space-3);
  font-size: 1.02rem;
}

.features-decor {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
}

.features-decor svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 720px) {
  .features-decor {
    width: 78px;
    height: 78px;
  }
}

@media (max-width: 420px) {
  .features-decor {
    width: 60px;
    height: 60px;
  }
}

/* ---- Feature card ---- */
.feature-card {
  position: relative;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

/* Editorial index number in the corner — quiet, almost a watermark */
.feature-card::after {
  content: attr(data-num);
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--line);
  pointer-events: none;
  transition: color var(--dur-base) var(--ease-out);
}

.feature-card:hover::after {
  color: var(--accent);
}

/* Icon tiles lean alternately left/right — a playful hand-placed feel */
.features-grid .feature-card:nth-child(odd) .icon-tile {
  transform: rotate(-4deg);
}

.features-grid .feature-card:nth-child(even) .icon-tile {
  transform: rotate(4deg);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.feature-card:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: var(--shadow-md);
  border-color: transparent;
  transition-duration: 0.15s;
}

.feature-card .icon-tile {
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: 0.95rem;
}

/* ---- Card (service / doctor / generic) ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg-0);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card:active {
  transform: translateY(-2px) scale(0.985);
  box-shadow: var(--shadow-lg);
  transition-duration: 0.15s;
}

.card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card__media img,
.card:active .card__media img {
  transform: scale(1.06);
}

/* Doctor headshots are tall portraits going into a wide 4:3 card —
   default centered cover crops into the face. Anchor to the top so
   the head stays fully in frame instead of getting split top/bottom. */
.card__media--doctor img {
  object-position: top;
}

/* Placeholder tooth icon gets a little extra life of its own — a soft
   wiggle instead of just riding along with the zoom. */
.card__media .placeholder-media img {
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card__media .placeholder-media img,
.card:active .card__media .placeholder-media img {
  transform: scale(1.15) rotate(-6deg);
}

.card__body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.card__body h3 {
  margin-bottom: 0.4rem;
}

.card__body p {
  font-size: 0.92rem;
}

.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.card__price {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

/* ---- Service card meta (duration) + consultation fine print ---- */
.card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.card__meta img {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.card__note {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  white-space: normal;
}

.card__price-from {
  display: block;
}

.card__price-from strong {
  color: var(--ink);
  font-weight: 800;
}

/* Consultation-only cards get a dashed accent edge instead of the solid
   footer rule — a quiet visual cue that this isn't a fixed-price item. */
.card--consult .card__footer {
  border-top-style: dashed;
  align-items: flex-start;
}

/* ==========================================================================
   Inner-page shared blocks: page hero (full-bleed photo) + dark CTA banner.
   Used by services / doctors / about / contacts / booking — every page
   except home, which has its own hero and a light CTA in home.css.
   ========================================================================== */

.page-hero {
  overflow: hidden;
}

.page-hero__row {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: var(--space-7);
  align-items: stretch;
  margin-top: var(--space-6);
}

.page-hero__text {
  padding-left: var(--container-inset);
  padding-right: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-hero__text p {
  margin-top: var(--space-3);
  font-size: 1.03rem;
  max-width: 54ch;
}

.page-hero__text > .btn {
  margin-top: var(--space-5);
  align-self: flex-start;
}

/* Contacts (for now): no photo at all, on any screen size — text takes
   the full row width instead of being capped at 560px for a missing
   second column. Remove this once a real photo or video is ready. */
.page-hero--no-photo .page-hero__row {
  grid-template-columns: 1fr;
}

.page-hero--no-photo .page-hero__text {
  padding-right: var(--container-inset);
}

.page-hero__media {
  position: relative;
  min-height: 320px;
  border-radius: 28px 0 0 28px;
  overflow: hidden;
}

/* Absolutely positioned so a tall/portrait source photo can never inflate
   this grid cell's height (align-items:stretch on the row would otherwise
   size the row off the image's own intrinsic aspect ratio) — the image
   just fills whatever height the row ends up being instead of dictating it. */
.page-hero__media > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.page-hero__media:hover > img {
  transform: scale(1.06);
}

/* Mobile: text overlays the photo (bento treatment) instead of stacking
   the photo above the text as its own block. */
@media (max-width: 860px) {
  .page-hero__row {
    position: relative;
    display: block;
    margin-top: var(--space-4);
  }
  .page-hero__media {
    position: absolute;
    inset: 0;
    height: 320px;
    min-height: 0;
    border-radius: 0;
    z-index: 0;
  }
  .page-hero__media .placeholder-media {
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    bottom: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-pill);
  }
  .page-hero__media .placeholder-media img {
    width: 13px;
    height: 13px;
    opacity: 0.55;
  }
  .page-hero__media .placeholder-media span {
    font-size: 0.62rem;
    max-width: none;
    white-space: nowrap;
    color: var(--ink-soft);
  }
  .page-hero__text {
    position: relative;
    z-index: 1;
    padding: 60px var(--container-pad) 0;
  }

  /* Services / about / booking: no photo at all in the mobile hero, just
     the text — the bento-overlay treatment above is only for pages that
     opt in (i.e. don't have this modifier). Contacts currently has no
     photo markup at all (page-hero--no-photo), so it needs the same
     reduced top padding too. */
  .page-hero--no-mobile-photo .page-hero__media,
  .page-hero--no-photo .page-hero__media {
    display: none;
  }
  .page-hero--no-mobile-photo .page-hero__text,
  .page-hero--no-photo .page-hero__text {
    padding-top: var(--space-5);
  }
}

/* ---- Dark CTA banner ---- */
.cta-banner {
  padding-block: var(--space-9);
  background: var(--bg-soft);
}

.cta-banner__card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: stretch;
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cta-banner__text {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cta-banner__text h2 {
  color: var(--white);
}

.cta-banner__text p {
  margin-top: 0.5rem;
  margin-bottom: var(--space-5);
  color: rgba(255, 255, 255, 0.7);
}

.cta-banner__media {
  position: relative;
  min-height: 220px;
  background: rgba(255, 255, 255, 0.04);
}

/* Absolutely positioned for the same reason as .page-hero__media > img —
   a tall/portrait photo must never inflate this grid cell's height. */
.cta-banner__media > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.cta-banner__media:hover > img {
  transform: scale(1.06);
}

.cta-banner__media .placeholder-media {
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
}

.cta-banner__media .placeholder-media img {
  filter: invert(1);
  opacity: 0.5;
}

@media (max-width: 760px) {
  .cta-banner {
    padding-block: var(--space-7);
  }
  .cta-banner__card {
    grid-template-columns: 1fr;
  }
  .cta-banner__media {
    order: -1;
    min-height: 160px;
  }
  .cta-banner__text {
    padding: var(--space-6) var(--space-5);
  }
}

/* Placeholder media block — for missing photos until clinic supplies real ones */
.placeholder-media {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #e7eaed;
  color: var(--muted);
  text-align: center;
  padding: var(--space-4);
}

.placeholder-media img {
  width: 34px;
  height: 34px;
  opacity: 0.35;
}

.placeholder-media span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: 20ch;
}

/* ---- Doctor card ---- */
.doctor-card__body {
  padding: var(--space-5);
  text-align: left;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.doctor-card__name {
  margin-bottom: 0.15rem;
}

.doctor-card__role {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.doctor-card__exp {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.doctor-card__link {
  margin-top: auto;
  padding-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.doctor-card__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-fast) var(--ease-out);
}

.card:hover .doctor-card__link svg {
  transform: translateX(4px);
}

/* ---- Badge / pill ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
}

.badge--soft {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ---- Testimonial card ---- */
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.testimonial-card__stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-4);
}

.testimonial-card__stars svg {
  width: 16px;
  height: 16px;
  fill: #f0b429;
}

.testimonial-card__quote {
  font-size: 0.98rem;
  color: var(--ink-soft);
  line-height: 1.7;
  flex-grow: 1;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: var(--space-5);
}

.testimonial-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.testimonial-card__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
}

.testimonial-card__date {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- Forms ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: var(--space-5);
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 560px) {
  .field--row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field-check input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.form-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: var(--space-3);
}

/* ---- Rating stars (static, for form) ---- */
.star-input {
  display: flex;
  gap: 0.3rem;
  direction: ltr;
}

.star-input button {
  background: none;
  border: none;
  padding: 0;
  color: var(--line);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.star-input button svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.star-input button.is-active,
.star-input button:hover {
  color: #f0b429;
  transform: scale(1.08);
}

/* ---- Carousel (testimonials — shared by home + doctor profile pages) ---- */
.carousel {
  overflow: hidden;
}

/* While page-scoped reviews are being fetched, hide the track/controls
   (not the `.carousel` element itself — that already has its own
   scroll-reveal opacity/transform animation via [data-reveal], and we
   don't want the two to fight over the same property). Prevents a
   flash of the placeholder testimonials before the real ones swap in. */
.carousel.is-loading .carousel__track,
.carousel.is-loading .carousel__controls {
  visibility: hidden;
}

.carousel__track {
  display: flex;
  gap: var(--space-6);
  transition: transform var(--dur-slow) var(--ease-out);
}

.carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

@media (min-width: 720px) {
  .carousel__slide {
    flex-basis: calc(50% - var(--space-6) / 2);
  }
}

@media (min-width: 1080px) {
  .carousel__slide {
    flex-basis: calc(33.333% - var(--space-6) * 2 / 3);
  }
}

.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-6);
}

.carousel__dots {
  display: flex;
  gap: 0.4rem;
}

/* Testimonials get a "pinned note" personality: a slight alternating
   tilt and an oversized decorative quote mark behind the text. */
.carousel__slide:nth-child(odd) .testimonial-card {
  transform: rotate(-0.8deg);
}

.carousel__slide:nth-child(even) .testimonial-card {
  transform: rotate(0.8deg);
}

.testimonial-card {
  isolation: isolate;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.carousel__slide .testimonial-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow-md);
}

.testimonial-card::before {
  content: "«";
  position: absolute;
  top: -1.4rem;
  right: 1rem;
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-soft);
  z-index: -1;
  pointer-events: none;
}

/* The visible dot stays small (8px) but the button itself is a 22px
   tap target — padding + background-clip keep the extra area invisible. */
.carousel__dots button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  padding: 7px;
  background-clip: content-box;
  transition: background var(--dur-fast) var(--ease-out), width var(--dur-fast) var(--ease-out);
}

.carousel__dots button.is-active {
  background: var(--accent);
  background-clip: content-box;
  width: 36px;
  border-radius: var(--radius-pill);
}

/* While autoplay is on, the active pill slowly fills darker — a quiet
   countdown to the next review. Any pause removes the class and the fill. */
.carousel.is-autoplaying .carousel__dots button.is-active {
  background-image: linear-gradient(90deg, var(--accent-dark), var(--accent-dark));
  background-color: var(--accent);
  background-repeat: no-repeat;
  background-origin: content-box;
  background-size: 0% 100%;
  animation: dot-progress 5s linear forwards;
}

@keyframes dot-progress {
  to { background-size: 100% 100%; }
}

.carousel__arrows {
  display: flex;
  gap: 0.6rem;
}

.carousel__arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  color: var(--ink);
}

.carousel__arrow:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  transform: translateY(-2px);
}

.carousel__arrow svg {
  width: 18px;
  height: 18px;
}

/* ---- Review form (shared by home + doctor profile pages) ---- */
.review-form {
  margin-top: var(--space-9);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-7);
}

.review-form__head h3 {
  margin-bottom: var(--space-3);
}

.review-form__head p {
  font-size: 0.95rem;
  max-width: 32ch;
}

/* Toggle is a mobile-only affordance; on desktop the form is always open */
.review-form__toggle {
  display: none;
  margin-top: var(--space-5);
}

@media (max-width: 860px) {
  .review-form {
    grid-template-columns: 1fr;
    padding: var(--space-6) var(--space-5);
  }

  /* Collapsed by default on mobile — one button instead of a long form;
     tapping it unfolds the fields */
  .review-form__toggle {
    display: inline-flex;
  }

  .review-form__form {
    display: none;
  }

  .review-form.is-open .review-form__form {
    display: block;
    animation: form-open 0.45s var(--ease-out);
  }

  .review-form.is-open .review-form__toggle {
    display: none;
  }
}

@keyframes form-open {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* On touch screens hover fires on tap and then "sticks" until the next
   touch — neutralize the lift/zoom there; :active still gives feedback. */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-lg-0);
  }
  .card:hover .card__media img {
    transform: none;
  }
  .card:hover .card__media .placeholder-media img {
    transform: none;
  }
  .feature-card:hover {
    transform: none;
    box-shadow: var(--shadow-md-0);
    border-color: var(--line-soft);
  }
  .feature-card:hover .icon-tile {
    transform: none;
    background: var(--accent-soft);
  }
  .feature-card:hover .icon-tile img {
    filter: none;
  }
  .btn:hover {
    transform: none;
    box-shadow: var(--shadow-md-0);
  }
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--white);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  z-index: 1000;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ---- Legal / document content (privacy.html) ---- */
.legal {
  max-width: 760px;
  margin-top: var(--space-6);
}

.legal h2 {
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p {
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.legal ul {
  list-style: disc;
  padding-left: 1.3rem;
  margin-bottom: var(--space-4);
}

.legal li {
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.legal .legal-updated {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
