/* Patient portal components, built on the variables in theme.css. */

body { font-family: var(--font-body); background-color: var(--bg-page); color: var(--text-primary); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
}
.card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1rem; border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--border-light); transition: background 0.2s; }
.row-item:hover { background: var(--bg-page); }

/* Sidebar */
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 10px 14px; border-radius: var(--radius-md); color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.sidebar-link:hover, .sidebar-link.active { background: var(--color-primary-soft); color: var(--color-primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.5rem; border-radius: var(--radius-full); font-weight: 600; font-size: 0.925rem; transition: all 0.2s; cursor: pointer; }
.btn-primary { background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark)); color: var(--text-on-primary); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px var(--color-primary); transform: translateY(-1px); }
.btn-outline { border: 2px solid var(--border-light); color: var(--text-primary); background: transparent; }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-soft { background: var(--color-primary-soft); color: var(--color-primary); padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-soft:hover { background: var(--color-primary); color: var(--text-on-primary); }
.btn-quiet { background: var(--bg-page); color: var(--text-secondary); padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-quiet:hover { background: var(--border-light); }
.btn-danger { background: color-mix(in srgb, var(--color-error) 12%, transparent); color: var(--color-error); padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-danger:hover { background: var(--color-error); color: white; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.link { color: var(--color-primary); }
.link:hover { text-decoration: underline; }

/* Forms */
.field-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, .input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-light);
  background: var(--bg-input); color: var(--text-primary);
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; box-shadow: 0 0 0 2px var(--color-primary); border-color: transparent; }
.field input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--color-primary); }
.field-error { color: var(--color-error); font-size: 0.8rem; margin-top: 0.35rem; }
.form-error { background: color-mix(in srgb, var(--color-error) 12%, var(--bg-surface)); color: var(--color-error); border-radius: var(--radius-md); padding: 0.75rem 1rem; font-size: 0.875rem; }
.form-note { background: var(--color-primary-soft); color: var(--text-primary); border-radius: var(--radius-md); padding: 0.75rem 1rem; font-size: 0.875rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.75rem; border-radius: var(--radius-full); white-space: nowrap; }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.badge-success { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--tone-success-text); }
.badge-warning { background: color-mix(in srgb, var(--color-warning) 20%, transparent); color: var(--tone-warning-text); }
.badge-error { background: color-mix(in srgb, var(--color-error) 15%, transparent); color: var(--tone-error-text); }
.badge-info { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--tone-info-text); }
.badge-muted { background: var(--bg-page); color: var(--text-secondary); border: 1px solid var(--border-light); }

/* Tinted icon tiles: <div class="tone tone-info">…</div> */
.tone { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tone-primary { background: var(--color-primary-soft); color: var(--color-primary); }
.tone-success { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--tone-success-text); }
.tone-error { background: color-mix(in srgb, var(--color-error) 15%, transparent); color: var(--tone-error-text); }
.tone-info { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--tone-info-text); }
.tone-accent { background: color-mix(in srgb, var(--color-accent) 15%, transparent); color: var(--tone-accent-text); }

/* Theme switch (portal.js): shows the icon of the theme in use. */
.theme-toggle { padding: 0.5rem; border-radius: var(--radius-md); color: var(--text-secondary); }
.theme-toggle:hover { background: var(--bg-page); color: var(--text-primary); }
.theme-toggle .icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: block; }
}
.auth-theme-toggle { position: fixed; top: 1rem; right: 1rem; z-index: 20; color: #94A3B8; }
.auth-theme-toggle:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.segmented { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: var(--radius-full); background: var(--bg-page); border: 1px solid var(--border-light); }
.segmented button { padding: 0.4rem 1rem; border-radius: var(--radius-full); font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.segmented button[aria-pressed="true"] { background: var(--bg-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* Tabs */
.tab { padding: 0.5rem 1rem; border-radius: var(--radius-full); font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--color-primary-soft); color: var(--color-primary); }

/* Booking */
.choice { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; padding: 1.1rem 1.25rem; border-radius: var(--radius-lg); border: 2px solid var(--border-light); background: var(--bg-surface); transition: all 0.2s; }
.choice:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.step-dot { width: 2.5rem; height: 2.5rem; border-radius: 9999px; border: 2px solid var(--border-medium); background: var(--bg-surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; flex-shrink: 0; }
.step-dot.current { border-color: var(--color-primary); background: var(--color-primary); color: white; }
.step-dot.done { border-color: var(--color-success); background: var(--color-success); color: white; }
.time-slot { display: block; text-align: center; padding: 0.5rem 0.25rem; border-radius: var(--radius-md); border: 1px solid var(--border-light); font-size: 0.85rem; color: var(--text-primary); background: var(--bg-surface); transition: all 0.15s; }
.time-slot:hover { border-color: var(--color-primary); color: var(--color-primary); }

.avatar { border-radius: var(--radius-md); background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

/* Auth pages */
.auth-body { background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 50%, var(--bg-dark) 100%); min-height: 100vh; }
.auth-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.auth-bg::before { content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px; background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%); opacity: 0.12; filter: blur(80px); }
.auth-bg::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 500px; height: 500px; background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%); opacity: 0.08; filter: blur(80px); }

/* Toasts */
.toast { padding: 0.75rem 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 0.9rem; background: var(--bg-surface); border-left: 4px solid var(--color-primary); animation: slideInRight 0.3s ease; }
.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-error); }

/* HTMX */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request.htmx-dim, .htmx-request .htmx-dim { opacity: 0.55; transition: opacity 0.2s; }

/* Loading: a bar along the top of the page, and busy submit buttons (see portal.js). */
#page-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
#page-progress.is-active { opacity: 1; }
#page-progress::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light)); animation: progress-slide 1.1s ease-in-out infinite; }
@keyframes progress-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
button.is-busy > * { visibility: hidden; }
button.is-busy::after { content: ''; position: absolute; width: 1.1rem; height: 1.1rem; top: 50%; left: 50%; margin: -0.55rem 0 0 -0.55rem; border-radius: 9999px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: white; animation: spin 0.7s linear infinite; }
.btn-outline.is-busy::after, .btn-quiet.is-busy::after, .btn-soft.is-busy::after, .btn-danger.is-busy::after { border-color: var(--border-medium); border-top-color: var(--color-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #page-progress::before { animation-duration: 3s; } }
.btn.is-busy[disabled] { opacity: 0.85; }

/* Messages */
.bubble { padding: 0.75rem 1rem; border-radius: var(--radius-lg); white-space: pre-line; word-break: break-word; line-height: 1.55; font-size: 0.95rem; }
.bubble-in { background: var(--bg-surface); border: 1px solid var(--border-light); border-top-left-radius: 4px; }
.bubble-out { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--text-on-primary); border-top-right-radius: 4px; }
.bubble-withdrawn { border: 1px dashed var(--border-medium); color: var(--text-muted); font-style: italic; }
.nav-count { margin-left: auto; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 9999px; background: var(--color-primary); color: var(--text-on-primary); font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Health articles */
.article-card { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s; }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.article-placeholder { display: flex; align-items: flex-end; padding: 1rem; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--text-on-primary); font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.article-body { color: var(--text-primary); font-size: 1.05rem; line-height: 1.8; overflow-wrap: break-word; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2.25rem 0 0.75rem; line-height: 1.3; }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
.article-body h4 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.article-body p { margin: 0 0 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin: 0.35rem 0; }
.article-body li::marker { color: var(--color-primary); }
.article-body blockquote { margin: 1.5rem 0; padding: 0.5rem 0 0.5rem 1.25rem; border-left: 4px solid var(--color-primary); color: var(--text-secondary); font-style: italic; }
.article-body a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.video-poster { background: radial-gradient(circle at 30% 20%, #1e293b, #0f172a); }
.video-poster iframe { width: 100%; height: 100%; border: 0; }
.video-play { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: #fff; text-align: center; padding: 1rem; cursor: pointer; }
.video-play-icon { width: 4.5rem; height: 4.5rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: var(--color-primary); box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary) 25%, transparent); transition: transform 0.2s; }
.video-play:hover .video-play-icon { transform: scale(1.08); }
/* Visit ratings: an average (one star, the number, how many), and the five-star input. */
.rating { display: inline-flex; align-items: center; gap: 0.3rem; }
.rating-star { width: 1rem; height: 1rem; color: #f59e0b; flex-shrink: 0; }
.rating-lg .rating-star { width: 1.25rem; height: 1.25rem; }
.rating-star-xl { width: 2rem; height: 2rem; }
.rating-count { color: var(--text-muted); font-size: 0.875em; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.25rem; border: 0; padding: 0; margin: 0; }
.star-input label { cursor: pointer; color: color-mix(in srgb, var(--text-muted) 45%, transparent); transition: color 0.15s, transform 0.15s; border-radius: var(--radius-sm, 0.375rem); }
.star-input svg { width: 2.25rem; height: 2.25rem; display: block; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }
.star-input label:hover { transform: scale(1.08); }
.star-input input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.stars-static { display: inline-flex; gap: 0.15rem; }
.stars-static svg { width: 1.5rem; height: 1.5rem; color: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.stars-static svg.on { color: #f59e0b; }

/* Booking: in person or video */
.mode-option { position: relative; display: flex; gap: 0.875rem; align-items: flex-start; padding: 1rem 2.75rem 1rem 1rem; border: 2px solid var(--border-light); border-radius: var(--radius-lg); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.mode-option:hover { border-color: color-mix(in srgb, var(--color-primary) 50%, var(--border-light)); }
.mode-option:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }
.mode-option:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.mode-icon { flex-shrink: 0; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--bg-page); color: var(--color-primary); }
.mode-check { position: absolute; top: 1rem; right: 1rem; width: 1.25rem; height: 1.25rem; border-radius: 9999px; border: 2px solid var(--border-light); }
.mode-option:has(input:checked) .mode-check { border-color: var(--color-primary); background: var(--color-primary); box-shadow: inset 0 0 0 3px var(--bg-page); }

/* The video visit page */
#video-visit { --th-primary: var(--color-primary); }

/* ---- The public home page (see the glossary: Home page (portal)) ---- */
.hero-bg { background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 50%, var(--bg-dark) 100%); position: relative; overflow: hidden; }
.hero-bg::before { content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px; background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%); opacity: 0.15; filter: blur(80px); }
.hero-bg::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 500px; height: 500px; background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%); opacity: 0.1; filter: blur(80px); }
/* With the clinic's photo: a fixed dark layer keeps the white text readable. */
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.6) 55%, rgba(15, 23, 42, 0.35) 100%); }
.hero-bg.has-photo::before, .hero-bg.has-photo::after { display: none; }
.service-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-primary); }
.hero-grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: linear-gradient(120deg, transparent 15%, #000 60%, transparent 95%); mask-image: linear-gradient(120deg, transparent 15%, #000 60%, transparent 95%); }
.hero-rise { animation: hero-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pulse-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@media (prefers-reduced-motion: reduce) { .hero-rise, .pulse-dot { animation: none; } }
.figures-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); }
.figure { display: flex; align-items: center; gap: 0.85rem; padding: 1rem; margin: 0 -1px -1px 0; border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
@media (min-width: 768px) { .figure { gap: 1rem; padding: 1.4rem 1.5rem; } }
@media (max-width: 639px) { .figure-icon { display: none; } }
.figure-icon { width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--color-primary-soft); color: var(--color-primary); }
.figure-value { font-family: var(--font-heading); font-size: clamp(1.35rem, 4vw, 1.75rem); line-height: 1.1; font-weight: 700; color: var(--text-primary); }
.figure-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.15rem; }
.chip { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: var(--radius-full); background: var(--color-primary-soft); color: var(--color-primary); font-size: 0.72rem; font-weight: 600; }
/* Services have no icon of their own: the cards take turns through these colours. */
.tone-tile { width: 3rem; height: 3rem; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-md); }
.tone-1 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.tone-2 { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.tone-3 { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.tone-4 { background: linear-gradient(135deg, #10b981, #059669); }
.tone-5 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tone-6 { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.video-band { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 2.5rem; box-shadow: var(--shadow-sm); background-image: radial-gradient(circle at 100% 0%, var(--color-primary-soft), transparent 55%); }
@media (min-width: 768px) { .video-band { padding: 3.5rem; } }
.step { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.25rem; border-radius: var(--radius-lg); background: var(--bg-page); border: 1px solid var(--border-light); }
.step-number { width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: var(--text-on-primary); background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); }
.cta-band::before { top: -60%; right: -5%; opacity: 0.3; }
.open-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; }
.open-badge::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: currentColor; }
.open-badge.is-open { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 14%, transparent); }
.open-badge.is-closed { color: var(--text-secondary); background: color-mix(in srgb, var(--text-secondary) 14%, transparent); }
.site-footer { background: var(--bg-dark); color: #fff; }
.site-footer a:hover { color: #fff; }
