/* Operana.Site — shared design system for the "Find a Doctor" directory.
   Same tokens/technique as wwwroot/marketing-html/*.html so the whole site
   (marketing + directory) reads as one product, not two. */

:root {
  --bg:#F6FAFD; --surface:#FFFFFF; --surface2:#EDF4FA; --ink:#0F304A; --muted:#51697E;
  --line:#DFEAF3; --azure:#00A1FF; --brand:#006EB3; --navy:#1B3B8B; --aqua:#47D7BC;
  --grad:linear-gradient(140deg,#2E7BD6 0%,#2456AE 55%,#1B3B8B 100%);
  --btngrad:linear-gradient(135deg,#00A1FF,#006EB3);
  --shadow:0 24px 60px -24px rgba(15,48,74,.25);
  --shadow-sm:0 10px 26px -14px rgba(15,48,74,.18);
  --danger:#DC2626;
  --star:#F5A623;
}
[data-theme="dark"] {
  --bg:#0A1B2C; --surface:#102538; --surface2:#0D2032; --ink:#EAF4FC; --muted:#93ABC0;
  --line:#1E3B55; --brand:#4FC1FF;
  --shadow:0 24px 60px -24px rgba(0,0,0,.6);
  --shadow-sm:0 10px 26px -14px rgba(0,0,0,.5);
  --star:#FBBF24;
}

* { box-sizing: border-box; }
/* The [hidden] attribute must always win over a component class that sets its own
   `display` (e.g. .form-hint's display:flex) — otherwise "hidden" elements still show.
   Equal specificity between [hidden] and a class is resolved by source order, and this
   guarantees [hidden] always comes last regardless of where a class rule is authored. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background .3s ease;
}
h1, h2, h3, .heading-font { font-family: 'Quicksand', sans-serif; font-weight: 700; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(0,161,255,.22); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
[data-reveal] { animation: fadeUp .7s cubic-bezier(.16,.7,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .fade-up { animation: none !important; opacity: 1 !important; transform: none !important; }
}

:focus-visible {
  outline: 3px solid rgba(0,161,255,.5);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px,4vw,40px); }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-center-link {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-weight: 700; font-size: 14.5px; color: var(--brand); text-decoration: none;
  padding: 8px 18px; border-radius: 999px; background: var(--surface2); white-space: nowrap;
  transition: background .15s ease;
}
.nav-center-link:hover { background: var(--line); }
.brand-word { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 23px; letter-spacing: .02em; color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: contents; }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 15px;
  text-decoration: none; border-radius: 999px; padding: 13px 28px; border: none;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  min-height: 44px;
}
.btn-primary { background: var(--btngrad); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(0,110,179,.5); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; min-height: 36px; }
.btn-lg { padding: 16px 34px; font-size: 16.5px; }

/* ---------- Hero (search) ---------- */
.hero-search {
  background: var(--grad); color: #fff; position: relative; overflow: hidden;
}
/* Same brand-mark watermark treatment as the login/register screens' blue panel. */
.hero-watermark { position: absolute; right: -180px; bottom: -180px; opacity: .12; pointer-events: none; }
.hero-search .container { position: relative; padding-top: clamp(56px,8vw,88px); padding-bottom: clamp(56px,8vw,88px); text-align: center; }
.hero-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.hero-search h1 { font-size: clamp(30px,4.6vw,50px); line-height: 1.14; margin: 0 0 16px; }
.hero-search p.lead { font-size: 17px; line-height: 1.7; color: rgba(255,255,255,.88); max-width: 560px; margin: 0 auto 36px; }

.search-bar {
  background: var(--surface); border-radius: 20px; box-shadow: 0 24px 50px -18px rgba(0,0,0,.35);
  padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; margin: 0 auto;
  text-align: left;
}
.search-field { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px; padding: 6px 14px; }
.search-field svg { color: var(--muted); flex-shrink: 0; }
.search-field select, .search-field input {
  border: none; background: transparent; font-family: inherit; font-size: 15px; color: var(--ink);
  width: 100%; padding: 8px 0; min-height: 32px;
}
.search-field select:focus, .search-field input:focus { outline: none; }
.search-divider { width: 1px; background: var(--line); margin: 6px 0; }
.search-bar .btn-primary { flex-shrink: 0; }

/* ---------- Specialty chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 13.5px; font-weight: 600;
  text-decoration: none; border: 1px solid rgba(255,255,255,.25); transition: background .15s ease;
}
.chip:hover, .chip.active { background: rgba(255,255,255,.28); }

/* ---------- Results section ---------- */
.results-section { padding: clamp(40px,6vw,64px) 0; }
.results-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.results-count { color: var(--muted); font-size: 14.5px; }

.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }

.doctor-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.doctor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--azure); }

.doctor-card-top { display: flex; align-items: center; gap: 16px; }
.doctor-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--surface2); border: 3px solid var(--surface2);
  box-shadow: 0 0 0 3px rgba(0,161,255,.15);
}
.doctor-card h3 { margin: 0 0 3px; font-size: 18px; }
.doctor-clinic { color: var(--muted); font-size: 13.5px; margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: rgba(0,161,255,.12); color: var(--brand);
}
.doctor-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.location-line { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13.5px; }

.book-status { margin-top: auto; padding-top: 6px; }
.book-status .btn { width: 100%; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: clamp(48px,8vw,80px) 20px; color: var(--muted); }
.empty-state .icon-badge {
  width: 72px; height: 72px; border-radius: 50%; background: var(--surface2); color: var(--azure);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.empty-state h3 { color: var(--ink); margin: 0 0 8px; }

/* ---------- Welcome panel (idle screen, before any search) ---------- */
.welcome-panel { padding: clamp(28px,6vw,44px) 0 12px; }
.welcome-grid { display: grid; grid-template-columns: 280px 1fr; gap: clamp(28px,5vw,56px); align-items: center; }
.welcome-photo-wrap { position: relative; }
.welcome-photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow); }
.welcome-badge {
  position: absolute; left: 18px; bottom: -16px; background: var(--surface); border-radius: 999px;
  padding: 10px 16px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.welcome-badge svg { color: var(--aqua); flex-shrink: 0; }
.welcome-copy h2 { font-size: clamp(24px,3.2vw,32px); margin: 0 0 12px; }
.welcome-copy > p { color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 480px; margin: 0 0 32px; }

.how-it-works { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.how-step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 18px; }
.how-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface2); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.how-step h4 { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 15.5px; margin: 0 0 4px; color: var(--ink); }
.how-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 860px) {
  .welcome-grid { grid-template-columns: 1fr; text-align: center; }
  .welcome-photo-wrap { max-width: 240px; margin: 0 auto 28px; }
  .welcome-copy > p { margin-left: auto; margin-right: auto; }
  .how-it-works { grid-template-columns: 1fr; text-align: left; }
}

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 40px; list-style: none; padding: 0; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.pagination .active span, .pagination .active a { background: var(--btngrad); color: #fff; border-color: transparent; }

/* ---------- Profile hero ---------- */
.profile-hero { background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.profile-hero .container { position: relative; padding-top: clamp(48px,6vw,72px); padding-bottom: clamp(40px,5vw,56px); }
.profile-top { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.profile-avatar {
  width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: #fff; border: 4px solid #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.25), var(--shadow);
}
.profile-name { font-size: clamp(26px,3.4vw,36px); margin: 0 0 6px; color: #fff; }
.profile-clinic { color: rgba(255,255,255,.85); font-size: 16px; margin: 0 0 12px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.profile-hero .badge { background: rgba(255,255,255,.18); color: #fff; }
.profile-hero .location-line { color: rgba(255,255,255,.85); }
.profile-verified { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px 5px 10px; border-radius: 999px; background: rgba(71,215,188,.22); color: #fff; font-size: 12.5px; font-weight: 700; }
.profile-verified svg { color: var(--aqua); flex-shrink: 0; }
.profile-book-inline { margin-top: 22px; }
.profile-hero .btn-primary { background: #fff; color: var(--navy); box-shadow: 0 14px 30px -12px rgba(0,0,0,.35); }
.profile-hero .btn-primary:hover { transform: translateY(-1px); }

/* ---------- Profile content ---------- */
.profile-body { padding: clamp(40px,6vw,64px) 0; }
.profile-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(28px,4vw,48px); align-items: start; }
.profile-sidebar { position: sticky; top: 90px; }
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }
}
.content-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.content-card h2 { font-size: 19px; margin: 0 0 12px; }
.content-card p { color: var(--muted); line-height: 1.75; margin: 0; font-size: 15.5px; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row svg { color: var(--azure); flex-shrink: 0; }
.info-row .label { font-size: 13px; color: var(--muted); }
.info-row .value { font-weight: 600; font-size: 14.5px; }
.hours-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.cta-card { background: var(--grad); border-radius: 18px; padding: 28px; color: #fff; text-align: center; margin-bottom: 20px; }
.cta-card h3 { margin: 0 0 8px; font-size: 19px; }
.cta-card p { color: rgba(255,255,255,.85); font-size: 14px; margin: 0 0 18px; }
.cta-card .btn-primary { background: #fff; color: var(--navy); box-shadow: 0 14px 30px -12px rgba(0,0,0,.4); width: 100%; }
.cta-card .btn-primary:hover { transform: translateY(-1px); }

/* ---------- Booking form ---------- */
.booking-card { max-width: 600px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.form-field .optional { color: var(--muted); font-weight: 500; }
.form-input, .form-textarea {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  min-height: 46px; width: 100%;
}
.form-textarea { min-height: 84px; resize: vertical; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,161,255,.15); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; }
.form-hint.warn { color: #B45309; }
[data-theme="dark"] .form-hint.warn { color: #FBBF24; }
.form-alert {
  background: rgba(220,38,38,.1); color: var(--danger); border: 1px solid rgba(220,38,38,.25);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px;
}
.form-submit-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

.booking-confirm { text-align: center; padding: 12px 0; }
.booking-confirm .icon-badge { background: rgba(71,215,188,.16); color: var(--aqua); width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.booking-confirm h2 { margin: 0 0 8px; }
.booking-confirm > p { color: var(--muted); margin: 0 0 24px; }
.confirm-details { background: var(--surface2); border-radius: 14px; padding: 16px 18px; text-align: left; max-width: 360px; margin: 0 auto; }
.confirm-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.confirm-row:last-child { border-bottom: none; }
.confirm-row .label { color: var(--muted); }
.confirm-row .value { font-weight: 700; text-align: right; }

/* ---------- Filters bar (compact, sits under hero) ---------- */
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface2); color: var(--ink); font-size: 13px; font-weight: 600;
}
.filter-pill a { color: var(--muted); text-decoration: none; margin-left: 2px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .container { padding: 32px clamp(18px,4vw,40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--brand); text-decoration: none; font-weight: 600; }

@media (max-width: 640px) {
  .nav-row { height: auto; padding: 12px clamp(14px,4vw,40px); flex-wrap: wrap; row-gap: 10px; }
  .nav-center-link { position: static; transform: none; order: 3; width: 100%; text-align: center; }
  .doctor-grid { grid-template-columns: 1fr; }
  .profile-top { flex-direction: column; text-align: center; }
  .profile-meta { justify-content: center; }
  .search-divider { display: none; }
  .search-bar { flex-direction: column; }
}

/* ---------- Star ratings ---------- */
.stars { position: relative; display: inline-block; font-size: 16px; line-height: 1; white-space: nowrap; letter-spacing: 2px; }
.stars-bg { color: var(--line); }
.stars-fg { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.rating-summary { display: inline-flex; align-items: center; gap: 8px; }
.rating-summary .rating-number { font-weight: 700; color: var(--ink); }
.rating-summary .rating-count { color: var(--muted); font-size: 13.5px; }
.profile-hero .rating-summary .rating-number { color: #fff; }
.profile-hero .rating-summary .rating-count { color: rgba(255,255,255,.75); }

/* ---------- Reviews ---------- */
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: none; }
.review-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.review-author { font-weight: 700; font-size: 14.5px; }
.review-date { color: var(--muted); font-size: 12.5px; }
.review-comment { margin: 6px 0 0; color: var(--ink); font-size: 14.5px; line-height: 1.65; }
.review-empty { color: var(--muted); font-size: 14.5px; padding: 8px 0 4px; }

.review-form { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.review-form.open { display: block; }
.review-form-success { display: none; background: rgba(71,215,188,.12); color: var(--ink); border-radius: 12px; padding: 14px 16px; font-size: 14px; margin-top: 20px; }
.review-form-success.open { display: block; }

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-input label { font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; transition: color .12s ease; }
.star-input input:checked + label,
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: var(--star); }
