/* ════════════════════════════════════════════════════════════
   HealthDir – Public Stylesheet
   ════════════════════════════════════════════════════════════ */
:root {
    --hd-primary:      #0A6E6E;
    --hd-primary-dark: #074f4f;
    --hd-accent:       #FF6B35;
    --hd-teal-light:   #E8F5F5;
    --hd-text:         #1A2332;
    --hd-text-muted:   #6B7A8D;
    --hd-border:       #DEE5EC;
    --hd-white:        #FFFFFF;
    --hd-bg:           #F5F7FA;
    --hd-featured-bg:  #FFFBF0;
    --hd-shadow:       0 2px 12px rgba(10,110,110,.10);
    --hd-shadow-lg:    0 8px 32px rgba(10,110,110,.15);
    --hd-radius:       12px;
    --hd-radius-sm:    6px;
}

*, *::before, *::after { box-sizing: border-box; }

.hd-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── Flash Messages ──────────────────────────────────────── */
.hd-flash {
    padding: 14px 20px; border-radius: var(--hd-radius-sm);
    margin-bottom: 20px; font-weight: 500;
}
.hd-flash--success { background: #E8F9EE; color: #1A7A3B; border-left: 4px solid #1A7A3B; }
.hd-flash--error   { background: #FEF0EE; color: #C0392B; border-left: 4px solid #C0392B; }
.hd-flash--info    { background: #EEF4FF; color: #2563EB; border-left: 4px solid #2563EB; }

/* ── Buttons ─────────────────────────────────────────────── */
.hd-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: var(--hd-radius-sm);
    font-weight: 600; font-size: 15px; cursor: pointer;
    border: 2px solid transparent; text-decoration: none;
    transition: all .18s ease; white-space: nowrap;
}
.hd-btn--primary   { background: var(--hd-primary); color: #fff; }
.hd-btn--primary:hover { background: var(--hd-primary-dark); color: #fff; }
.hd-btn--outline   { border-color: var(--hd-primary); color: var(--hd-primary); background: transparent; }
.hd-btn--outline:hover { background: var(--hd-teal-light); }
.hd-btn--full      { width: 100%; justify-content: center; }
.hd-btn--lg        { padding: 14px 32px; font-size: 16px; }
.hd-btn--sm        { padding: 6px 14px; font-size: 13px; }

/* ── Badges ──────────────────────────────────────────────── */
.hd-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.hd-badge--featured  { background: #FFF3CD; color: #856404; }
.hd-badge--verified  { background: #D1FAE5; color: #065F46; }
.hd-badge--publish   { background: #D1FAE5; color: #065F46; }
.hd-badge--pending   { background: #FFF3CD; color: #856404; }
.hd-badge--draft     { background: var(--hd-border); color: var(--hd-text-muted); }

/* ══════════════════════════════════════════════════════════
   HERO SEARCH
══════════════════════════════════════════════════════════ */
.hd-hero {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%);
    padding: 64px 20px 56px; text-align: center; margin-bottom: 48px;
}
.hd-hero__title {
    font-size: clamp(28px,5vw,52px); font-weight: 800; color: #fff; margin: 0 0 12px;
    letter-spacing: -1px;
}
.hd-hero__title span { color: #FFD166; }
.hd-hero__sub { color: rgba(255,255,255,.85); font-size: 18px; margin: 0 0 40px; }

.hd-search-bar {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    max-width: 900px; margin: 0 auto;
}
.hd-search-bar__field {
    background: #fff; border-radius: var(--hd-radius-sm);
    display: flex; align-items: center; flex: 1; min-width: 180px;
    padding: 0 14px; border: 2px solid transparent;
    transition: border-color .18s;
}
.hd-search-bar__field:focus-within { border-color: #FFD166; }
.hd-search-bar__field svg { width: 18px; height: 18px; color: var(--hd-text-muted); flex-shrink: 0; margin-right: 8px; }
.hd-search-bar__field input,
.hd-search-bar__field select {
    border: none; outline: none; width: 100%; padding: 14px 0;
    font-size: 15px; color: var(--hd-text); background: transparent;
}
.hd-search-bar__field--keyword { min-width: 260px; }
.hd-search-bar .hd-btn { padding: 14px 28px; font-size: 16px; }

/* ══════════════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════════════ */
.hd-section { padding: 0 0 48px; }
.hd-section__header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.hd-section__header h2 { font-size: 22px; font-weight: 700; color: var(--hd-text); margin: 0; }

.hd-results-count { color: var(--hd-text-muted); font-size: 14px; margin-left: auto; }

/* ══════════════════════════════════════════════════════════
   PROVIDER GRID / CARDS
══════════════════════════════════════════════════════════ */
.hd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: 20px;
}
.hd-grid--featured { grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); }

.hd-card {
    background: var(--hd-white); border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border); overflow: hidden;
    text-decoration: none; color: inherit;
    transition: transform .18s, box-shadow .18s;
    display: flex; flex-direction: column;
}
.hd-card:hover { transform: translateY(-3px); box-shadow: var(--hd-shadow-lg); }
.hd-card--featured, .hd-card--is-featured { border-color: #FFD166; background: var(--hd-featured-bg); }

.hd-card__image {
    position: relative; height: 180px; overflow: hidden; background: var(--hd-teal-light);
}
.hd-card__image img { width: 100%; height: 100%; object-fit: cover; }
.hd-card__image-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--hd-teal-light), #C0E8E8);
}
.hd-card__image-placeholder span {
    font-size: 40px; font-weight: 800; color: var(--hd-primary); opacity: .6;
}
.hd-card__badges {
    position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap;
}

.hd-card__body { padding: 16px; flex: 1; }
.hd-card__title { font-size: 16px; font-weight: 700; color: var(--hd-text); margin: 0 0 6px; }
.hd-card__type {
    display: inline-block; background: var(--hd-teal-light); color: var(--hd-primary);
    border-radius: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; margin-bottom: 6px;
}
.hd-card__spec  { font-size: 13px; color: var(--hd-text-muted); margin: 0 0 4px; }
.hd-card__region{ font-size: 13px; color: var(--hd-text-muted); margin: 0 0 4px; }
.hd-card__phone { font-size: 13px; color: var(--hd-primary); font-weight: 600; margin: 0 0 4px; }
.hd-card__hours { font-size: 12px; color: var(--hd-text-muted); margin: 0; }

.hd-no-results { text-align: center; color: var(--hd-text-muted); padding: 48px 0; font-size: 16px; }

/* ══════════════════════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════════════════════ */
.hd-loading { text-align: center; padding: 40px; color: var(--hd-text-muted); }
.hd-spinner {
    width: 40px; height: 40px; border: 4px solid var(--hd-border);
    border-top-color: var(--hd-primary); border-radius: 50%;
    animation: hd-spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes hd-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════ */
.hd-pagination { display: flex; gap: 8px; justify-content: center; padding: 32px 0 0; flex-wrap: wrap; }
.hd-page-btn {
    min-width: 40px; height: 40px; border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border); background: #fff; color: var(--hd-text);
    cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s;
}
.hd-page-btn:hover, .hd-page-btn.active { background: var(--hd-primary); color: #fff; border-color: var(--hd-primary); }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════ */
.hd-auth-wrap { padding: 40px 20px; }
.hd-auth-box {
    max-width: 480px; margin: 0 auto;
    background: var(--hd-white); border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow-lg); padding: 40px;
}
.hd-auth-box__header { text-align: center; margin-bottom: 28px; }
.hd-auth-logo { font-size: 48px; margin-bottom: 12px; }
.hd-auth-box__header h2 { font-size: 24px; font-weight: 800; color: var(--hd-text); margin: 0 0 6px; }
.hd-auth-box__header p  { color: var(--hd-text-muted); margin: 0; }

.hd-social-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.hd-social-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 20px; border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border); background: #fff; text-decoration: none;
    color: var(--hd-text); font-weight: 600; font-size: 15px;
    transition: background .15s, box-shadow .15s;
}
.hd-social-btn:hover { background: var(--hd-bg); box-shadow: var(--hd-shadow); color: var(--hd-text); }

.hd-auth-divider {
    text-align: center; position: relative; margin: 20px 0;
    color: var(--hd-text-muted); font-size: 13px;
}
.hd-auth-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--hd-border); z-index: 0;
}
.hd-auth-divider span { position: relative; z-index: 1; background: #fff; padding: 0 12px; }

.hd-auth-switch { text-align: center; margin-top: 20px; color: var(--hd-text-muted); font-size: 14px; }
.hd-auth-switch a { color: var(--hd-primary); font-weight: 600; text-decoration: none; }
.hd-forgot-link { color: var(--hd-primary); font-size: 13px; text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.hd-form { display: flex; flex-direction: column; gap: 16px; }
.hd-form__group { display: flex; flex-direction: column; gap: 6px; }
.hd-form__group label { font-size: 13px; font-weight: 600; color: var(--hd-text); }
.hd-form__group input,
.hd-form__group select,
.hd-form__group textarea {
    padding: 11px 14px; border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-sm); font-size: 15px;
    color: var(--hd-text); outline: none; width: 100%;
    transition: border-color .15s;
}
.hd-form__group input:focus,
.hd-form__group select:focus,
.hd-form__group textarea:focus { border-color: var(--hd-primary); box-shadow: 0 0 0 3px rgba(10,110,110,.12); }
.hd-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hd-form__group--wide { grid-column: span 1; }
.hd-form__group--inline { flex-direction: row; align-items: center; justify-content: space-between; }
.hd-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.hd-form__actions { padding-top: 8px; display: flex; align-items: center; gap: 16px; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════ */
.hd-dash-wrap { padding: 0 0 60px; }
.hd-dash-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-bottom: 1px solid var(--hd-border);
    padding: 16px 24px; margin-bottom: 32px; flex-wrap: wrap; gap: 12px;
}
.hd-dash-topbar__left { display: flex; align-items: center; gap: 12px; }
.hd-dash-topbar__left strong { display: block; font-size: 16px; color: var(--hd-text); }
.hd-dash-topbar__left small  { font-size: 13px; color: var(--hd-text-muted); }
.hd-dash-topbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-dash-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--hd-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
}
.hd-dash-welcome { text-align: center; padding: 48px 20px; }
.hd-dash-welcome__icon { font-size: 64px; margin-bottom: 16px; }
.hd-dash-welcome h2 { font-size: 24px; color: var(--hd-text); }
.hd-dash-welcome p  { color: var(--hd-text-muted); }

.hd-dash-tabs {
    display: flex; gap: 0; border-bottom: 2px solid var(--hd-border); margin-bottom: 32px;
}
.hd-tab {
    padding: 12px 24px; border: none; background: none; cursor: pointer;
    font-size: 15px; font-weight: 600; color: var(--hd-text-muted);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.hd-tab:hover { color: var(--hd-primary); }
.hd-tab.active { color: var(--hd-primary); border-bottom-color: var(--hd-primary); }
.hd-tab-content { display: none; }
.hd-tab-content.active { display: block; }

.hd-dash-form .hd-form-section {
    background: #fff; border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius); padding: 28px; margin-bottom: 24px;
}
.hd-dash-form .hd-form-section h3 {
    font-size: 16px; font-weight: 700; color: var(--hd-text);
    margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--hd-border);
}
.hd-photo-upload input { margin: 8px 0; }
.hd-photo-upload small { color: var(--hd-text-muted); font-size: 12px; }
.hd-photo-current { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hd-photo-current img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }

/* ══════════════════════════════════════════════════════════
   PROVIDER DETAIL CARD
══════════════════════════════════════════════════════════ */
.hd-provider-card {
    background: #fff; border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border); overflow: hidden;
}
.hd-provider-card--featured { border-color: #FFD166; }
.hd-provider-card__header {
    display: flex; gap: 20px; padding: 24px; align-items: flex-start;
    border-bottom: 1px solid var(--hd-border);
}
.hd-provider-card__photo { flex-shrink: 0; }
.hd-provider-card__photo img {
    width: 100px; height: 100px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--hd-teal-light);
}
.hd-provider-card__initials {
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--hd-teal-light); display: flex;
    align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: var(--hd-primary);
}
.hd-provider-card__name { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.hd-provider-card__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.hd-provider-card__specs { font-size: 14px; color: var(--hd-text-muted); margin: 0 0 4px; }
.hd-provider-card__region { font-size: 14px; color: var(--hd-text-muted); margin: 0; }

.hd-tag { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.hd-tag--type { background: var(--hd-teal-light); color: var(--hd-primary); }

.hd-provider-card__desc { padding: 20px 24px; color: var(--hd-text-muted); border-bottom: 1px solid var(--hd-border); }
.hd-provider-card__contacts { padding: 16px 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.hd-contact-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--hd-teal-light); color: var(--hd-primary);
    border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: background .15s;
}
.hd-contact-pill:hover { background: #c0e0e0; color: var(--hd-primary-dark); }
.hd-provider-card__address { padding: 0 24px 12px; color: var(--hd-text-muted); font-size: 14px; margin: 0; }
.hd-provider-card__hours { padding: 12px 24px; border-top: 1px solid var(--hd-border); }
.hd-provider-card__hours pre { margin: 6px 0 0; font-size: 13px; color: var(--hd-text-muted); white-space: pre-wrap; font-family: inherit; }
.hd-provider-card__manager { padding: 0 24px 16px; color: var(--hd-text-muted); font-size: 14px; margin: 0; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hd-search-bar { flex-direction: column; }
    .hd-search-bar__field { min-width: auto; }
    .hd-form__row { grid-template-columns: 1fr; }
    .hd-dash-topbar { flex-direction: column; align-items: flex-start; }
    .hd-auth-box { padding: 28px 20px; }
    .hd-provider-card__header { flex-direction: column; }
    .hd-dash-tabs { overflow-x: auto; }
    .hd-tab { padding: 10px 16px; font-size: 14px; }
}
