/**
 * HMS Public — Modern Classic UI layer
 * Timeless hospital aesthetic: crisp borders, solid teal, calm spacing
 */

:root {
    --radius: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --classic-rule: 1px solid var(--slate-200);
    --classic-accent: 3px solid var(--teal-600);
}

/* ─── Typography & base ─── */
body.hms-front-site {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--slate-700);
    letter-spacing: 0;
}

body.hms-front-site h1,
body.hms-front-site h2,
body.hms-front-site h3,
body.hms-front-site .hms-section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--slate-900);
}

body.hms-front-site .hms-label,
body.hms-front-site .hms-home__hero-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-700);
}

/* Solid buttons — no gradients, no lift */
body.hms-front-site .btn,
body.hms-front-site .hms-btn {
    border-radius: var(--radius) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

body.hms-front-site .btn-primary,
body.hms-front-site .hms-btn--primary {
    background: var(--teal-700) !important;
    border: 1px solid var(--teal-800) !important;
    box-shadow: none !important;
}

body.hms-front-site .btn-primary:hover,
body.hms-front-site .hms-btn--primary:hover {
    background: var(--teal-800) !important;
    transform: none !important;
    box-shadow: none !important;
}

body.hms-front-site .btn-outline-primary,
body.hms-front-site .hms-btn--outline {
    border-width: 1px !important;
    border-color: var(--slate-300) !important;
    color: var(--slate-700) !important;
    background: var(--white) !important;
}

body.hms-front-site .btn-outline-primary:hover,
body.hms-front-site .hms-btn--outline:hover {
    border-color: var(--teal-600) !important;
    color: var(--teal-800) !important;
    background: var(--teal-50) !important;
}

/* ─── Header: institutional bar ─── */
.hms-nav {
    border-bottom: var(--classic-rule);
    box-shadow: none;
}

.hms-nav--scrolled {
    box-shadow: 0 1px 0 var(--slate-200);
}

.hms-nav__ribbon {
    background: var(--teal-900);
    border-bottom: 2px solid var(--teal-700);
}

.hms-nav__link {
    border-radius: var(--radius) !important;
    font-weight: 500 !important;
}

.hms-nav__link.is-active {
    color: var(--teal-900) !important;
    background: transparent !important;
    box-shadow: inset 0 -2px 0 var(--teal-600);
    border-radius: 0 !important;
}

.hms-nav__phone-cta,
.hms-nav__call {
    border-radius: var(--radius);
}

/* ─── Hero: calm, readable, classic SVG frame ─── */
.hms-home__hero {
    position: relative;
    overflow: hidden;
    border-bottom: var(--classic-rule);
    background-color: #f0fdfa;
    background-image: none;
}

.hms-home__hero-svg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

.hms-home__hero-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        102deg,
        rgba(255, 255, 255, 0.82) 0%,
        rgba(255, 255, 255, 0.58) 42%,
        rgba(240, 253, 250, 0.38) 62%,
        rgba(236, 253, 245, 0.48) 100%
    );
}

.hms-home__hero-inner {
    position: relative;
    z-index: 2;
}

/* ─── Hero title: original black type + JS typewriter ─── */
.hms-hero-title--type {
    font-family: var(--font-body, "Inter", system-ui, sans-serif);
    font-size: clamp(2rem, 4.2vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--slate-900);
    margin-bottom: 1rem;
    min-height: 1.25em;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.hms-hero-title__typed {
    display: inline;
    font-style: normal;
    font-weight: 700;
    color: var(--slate-900);
}

.hms-hero-title--type.is-typing .hms-hero-title__typed::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 0.82em;
    margin-left: 3px;
    vertical-align: -0.06em;
    background: var(--slate-900);
    animation: hmsTypeCaretBlink 0.75s step-end infinite;
}

.hms-hero-title--type.is-typing .hms-hero-title__typed {
    visibility: visible;
}

@keyframes hmsTypeCaretBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hms-hero-title--type.is-typing .hms-hero-title__typed::after {
        display: none;
    }
}

.hms-home__hero-frame {
    border: var(--classic-rule);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hms-home__hero-img {
    border-radius: calc(var(--radius-lg) - 2px);
}

/* Trust / stats strip */
.hms-home__trust,
.hms-trust-strip {
    border-top: var(--classic-rule);
    border-bottom: var(--classic-rule);
    background: var(--white);
}

.hms-trust-strip__item {
    border-right: var(--classic-rule);
}

.hms-trust-strip__item:last-child {
    border-right: none;
}

/* ─── Sections: classic dividers ─── */
.hms-home section,
.hms-inner-section {
    border-top: var(--classic-rule);
}

.hms-home section:first-of-type {
    border-top: none;
}

.hms-section-head--left {
    padding-left: 1rem;
    border-left: var(--classic-accent);
}

.hms-inner-head--center {
    border-left: none;
    padding-left: 0;
}

.hms-inner-head--center::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--teal-600);
    margin: 1rem auto 0;
}

/* Services directory — ledger style */
.hms-services-directory {
    border: var(--classic-rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--white);
}

.hms-services-directory__row {
    border-bottom: var(--classic-rule);
    padding: 1.15rem 1.25rem;
    transition: background 0.12s ease;
}

.hms-services-directory__row:hover {
    background: var(--slate-50);
}

.hms-services-directory__num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--teal-700);
    min-width: 2rem;
}

.hms-services-directory__name {
    font-weight: 600;
    color: var(--slate-900);
}

/* Cards — flat classic */
.hms-doctor-card,
.hms-contact-card,
.hms-stat-box,
.hms-content-panel,
body.hms-front-site .contact-form,
body.hms-front-site .appointment-form-card {
    border-radius: var(--radius-lg) !important;
    box-shadow: none !important;
    border: var(--classic-rule) !important;
}

.hms-doctor-card:hover {
    border-color: var(--teal-400) !important;
    box-shadow: none !important;
    transform: none;
}

.hms-stat-box__value {
    font-variant-numeric: tabular-nums;
}

/* Page hero (inner pages) */
.hms-page-hero {
    border-bottom: var(--classic-rule);
    background-color: #f8fafc;
    background-image: var(--hms-pattern-light);
}

.hms-page-hero__title {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Footer — classic institutional */
body.hms-front-site .footer.hms-footer {
    background: var(--slate-900);
    border-top: 3px solid var(--teal-600);
    color: rgba(255, 255, 255, 0.75);
}

body.hms-front-site .footer.hms-footer::before {
    display: none;
}

body.hms-front-site .footer.hms-footer a {
    color: rgba(255, 255, 255, 0.9);
}

body.hms-front-site .footer.hms-footer a:hover {
    color: var(--teal-300);
}

/* Forms */
body.hms-front-site .form-control,
body.hms-front-site .form-select {
    border-radius: var(--radius) !important;
    border-color: var(--slate-300) !important;
    min-height: 44px;
}

body.hms-front-site .form-control:focus,
body.hms-front-site .form-select:focus {
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2) !important;
}

/* Performance: defer paint for below-fold sections */
@media (min-width: 768px) {
    .hms-home section:not(.hms-home__hero),
    .hms-inner-section {
        content-visibility: auto;
        contain-intrinsic-size: auto 400px;
    }
}

/* Classic picker — matches home booking date + doctor fields */
.hms-classic-picker-field .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--slate-700);
    margin-bottom: 0.4rem;
}

.hms-classic-picker {
    position: relative;
}

.hms-classic-picker__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    color: var(--teal-700);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.hms-home__booking-card .hms-classic-picker__input,
.hms-home__booking-card .hms-classic-picker .selectize-input,
.book-appintment .hms-classic-picker__input,
.book-appintment .hms-classic-picker .selectize-input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem !important;
    border: 1px solid var(--slate-200) !important;
    border-radius: 10px !important;
    background: #fff !important;
    font-size: 0.9375rem !important;
    color: var(--slate-800) !important;
    box-shadow: none !important;
    line-height: 1.4;
}

.hms-home__booking-card .hms-classic-picker__input:focus,
.hms-home__booking-card .hms-classic-picker .selectize-input.focus,
.book-appintment .hms-classic-picker__input:focus,
.book-appintment .hms-classic-picker .selectize-input.focus {
    border-color: var(--teal-500) !important;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15) !important;
}

.hms-classic-picker .selectize-control {
    width: 100%;
}

.hms-classic-picker .selectize-control.single .selectize-input::after {
    border-color: var(--slate-500) transparent transparent;
    right: 1rem;
    margin-top: -2px;
}

.hms-classic-picker .selectize-control.single .selectize-input input {
    font-size: 0.9375rem !important;
}

.hms-classic-picker .selectize-input .item {
    font-weight: 500;
}

.hms-classic-picker__dropdown.selectize-dropdown,
body.hms-front-site .hms-classic-picker__dropdown {
    border: 1px solid var(--slate-200) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
    margin-top: 6px !important;
    overflow: hidden;
    z-index: 1200 !important;
}

.hms-classic-picker__dropdown .selectize-dropdown-content {
    max-height: 240px;
}

.hms-classic-picker__dropdown .option {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--slate-100);
}

.hms-classic-picker__dropdown .option:last-child {
    border-bottom: 0;
}

.hms-classic-picker__dropdown .active {
    background: rgba(20, 184, 166, 0.1) !important;
    color: var(--teal-900) !important;
}

/* jQuery UI datepicker — classic teal (home booking) */
body.hms-front-site .ui-datepicker {
    width: 17.5em;
    padding: 1rem 1.15rem 1.15rem;
    border: 1px solid var(--slate-200) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
    background: #fff !important;
    z-index: 1200 !important;
}

body.hms-front-site .ui-datepicker .ui-datepicker-header {
    background: transparent;
    border: 0;
    padding: 0 0 0.5rem;
}

body.hms-front-site .ui-datepicker .ui-datepicker-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate-900);
}

body.hms-front-site .ui-datepicker th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.hms-front-site .ui-datepicker .ui-state-default {
    border: 1px solid transparent !important;
    background: var(--slate-50) !important;
    color: var(--slate-700) !important;
    border-radius: 8px !important;
    text-align: center;
    font-weight: 500;
}

body.hms-front-site .ui-datepicker .ui-state-active,
body.hms-front-site .ui-datepicker .ui-state-active.ui-state-hover {
    border-color: var(--teal-600) !important;
    background: var(--teal-600) !important;
    color: #fff !important;
}

body.hms-front-site .ui-datepicker .ui-state-hover {
    border-color: var(--teal-400) !important;
    background: rgba(20, 184, 166, 0.12) !important;
    color: var(--teal-900) !important;
}

body.hms-front-site .ui-datepicker .ui-datepicker-prev,
body.hms-front-site .ui-datepicker .ui-datepicker-next {
    border-radius: 8px;
    cursor: pointer;
    top: 2px;
}

body.hms-front-site .ui-datepicker .ui-datepicker-prev:hover,
body.hms-front-site .ui-datepicker .ui-datepicker-next:hover {
    background: var(--slate-100) !important;
    border: 0 !important;
}

/* Other pages — searchable doctor select */
body.hms-front-site .appointment-form-card .selectize-control,
body.hms-front-site .book-appointment-inner-box .selectize-control {
    width: 100%;
}

body.hms-front-site .selectize-control.single .selectize-input {
    border-radius: var(--radius) !important;
    border: 1px solid var(--slate-300) !important;
    min-height: 44px;
    padding: 0.55rem 2.25rem 0.55rem 0.85rem;
    box-shadow: none !important;
    background: #fff !important;
    font-size: 0.95rem;
    color: var(--slate-800);
}

body.hms-front-site .selectize-control.single .selectize-input.focus {
    border-color: var(--teal-600) !important;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2) !important;
}

body.hms-front-site .selectize-dropdown:not(.hms-classic-picker__dropdown) {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    margin-top: 4px;
    overflow: hidden;
}

body.hms-front-site .selectize-dropdown:not(.hms-classic-picker__dropdown) .option {
    padding: 0.6rem 0.85rem;
    font-size: 0.92rem;
}

body.hms-front-site .selectize-dropdown:not(.hms-classic-picker__dropdown) .active {
    background: var(--teal-50);
    color: var(--teal-800);
}

/* Doctors directory */
.hms-doctors-directory__head {
    max-width: 42rem;
    margin-bottom: 2.5rem;
}

.hms-doctors-directory__lead {
    margin: 0.75rem 0 0;
    color: var(--slate-600);
    font-size: 1rem;
}

.hms-doctors-directory__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.hms-doctors-directory__card {
    display: flex;
    flex-direction: column;
    border: var(--classic-rule);
    border-radius: var(--radius-lg);
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.hms-doctors-directory__card:hover {
    border-color: var(--teal-400);
}

.hms-doctors-directory__media {
    position: relative;
    padding: 1.25rem 1.25rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.hms-doctors-directory__num {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--teal-700);
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    z-index: 1;
}

.hms-doctors-directory__portrait {
    aspect-ratio: 4 / 5;
    max-height: 280px;
    margin: 0 auto;
    border: var(--classic-rule);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--slate-100);
}

.hms-doctors-directory__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.hms-doctors-directory__body {
    padding: 1.25rem 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.35rem;
}

.hms-doctors-directory__name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--slate-900);
}

.hms-doctors-directory__qual {
    margin: 0;
    font-size: 0.88rem;
    color: var(--slate-600);
}

.hms-doctors-directory__specialty {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--teal-800);
}

.hms-doctors-directory__specialty i {
    margin-right: 0.35rem;
    opacity: 0.85;
}

.hms-doctors-directory__dept {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

.hms-doctors-directory__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--slate-200);
    font-size: 0.82rem;
    color: var(--slate-600);
}

.hms-doctors-directory__stats strong {
    color: var(--slate-900);
    font-weight: 700;
}

.hms-doctors-directory__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.hms-doctors-directory__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    border: var(--classic-rule);
    border-radius: var(--radius-lg);
    color: var(--slate-600);
}

.hms-doctors-directory__empty i {
    font-size: 2.5rem;
    color: var(--teal-600);
    margin-bottom: 1rem;
    display: block;
}

.hms-doctors-directory__pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    body.hms-front-site *,
    body.hms-front-site *::before,
    body.hms-front-site *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
