/* =====================================================================
   DESIGN SYSTEM v2
   A friendly, modern hospital-review directory for Bangladesh — trust
   blue + warm coral, soft surfaces and real shadows instead of flat
   civic hairlines, star ratings as a first-class element, and a nav
   that actually works on a phone.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Noto+Sans+Bengali:wght@400;500;600;700;800&display=swap');

:root {
    /* --- Color: named tokens, used deliberately --- */
    --paper:        #F3F6FB;   /* base background: cool, calm, clinical-but-friendly */
    --paper-raised: #FFFFFF;   /* cards / form surfaces */
    --ink:          #16223A;   /* primary text */
    --ink-soft:     #5C6B85;   /* secondary text */
    --line:         #E2E8F2;   /* hairline rules / borders */
    --line-strong:  #C7D2E4;

    --primary:      #1768AC;   /* trust blue — links, primary actions, brand */
    --primary-deep: #0F4E82;
    --primary-wash: #E8F1FB;

    --accent:       #F0653D;   /* warm coral — submit-complaint / CTA */
    --accent-deep:  #D14E29;
    --accent-wash:  #FDECE6;

    --maroon:       #D8384F;   /* alert / report / rejected */
    --maroon-wash:  #FBE8EB;
    --gov-green:    #1B9E6B;   /* "approved / true / resolved" state */
    --gov-green-wash: #E3F7EF;
    --gold:         #FFB020;   /* star ratings only */
    --gold-wash:    #FFF6E5;

    --font-ui:    'Public Sans', 'Noto Sans Bengali', system-ui, sans-serif;
    --font-stat:  'Public Sans', 'Noto Sans Bengali', system-ui, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(22, 34, 58, 0.06), 0 1px 3px rgba(22, 34, 58, 0.06);
    --shadow-md: 0 4px 14px rgba(22, 34, 58, 0.09);
    --shadow-lg: 0 16px 40px rgba(15, 40, 80, 0.18);
    --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-ui);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: var(--ink);
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
h3 { font-size: 1.1rem; font-weight: 700; }

p { max-width: 68ch; }

.text-soft { color: var(--ink-soft); }

/* ---------------------------------------------------------------
   TOP UTILITY BAR + HEADER
   --------------------------------------------------------------- */
.utility-bar {
    background: var(--ink);
    color: #C9D3E6;
    font-size: 0.8rem;
}
.utility-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 7px;
    padding-bottom: 7px;
    gap: 12px;
    flex-wrap: wrap;
}
.utility-bar a { color: #C9D3E6; }
.lang-switch { display: flex; gap: 2px; flex-shrink: 0; }
.lang-switch a {
    padding: 2px 9px;
    border: 1px solid rgba(201,211,230,0.3);
    border-radius: 20px;
}
.lang-switch a.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.mobile-lang, .footer-tagline { display: none; }   /* shown on mobile only (see @media 760px) */

.site-header {
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 20px;
    position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-stat);
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.brand-name { font-family: var(--font-stat); font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.brand-name small { display: block; font-family: var(--font-ui); font-weight: 500; font-size: 0.7rem; color: var(--ink-soft); }

.nav-panel { display: flex; align-items: center; gap: 22px; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: 0.94rem; }
.main-nav a:hover { color: var(--primary-deep); text-decoration: none; }

.nav-toggle-checkbox { display: none; }
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: var(--ink); border-radius: 2px; margin: 0 auto; transition: transform .2s, opacity .2s; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    border: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(240,101,61,0.35); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--paper); border-color: var(--ink); }
.btn-teal { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-teal:hover { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------
   HERO — the working search bar IS the hero
   --------------------------------------------------------------- */
.hero {
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #fff;
    padding: 50px 0 44px;
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero-sub { color: #DCEBFA; max-width: 55ch; margin-bottom: 26px; }

.search-panel {
    background: var(--paper-raised);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-lg);
}
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row input[type="text"] {
    flex: 1 1 260px;
    padding: 13px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--paper);
}
.search-row input[type="text"]:focus { border-color: var(--primary); background: #fff; outline: none; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.22);
    padding-top: 22px;
}
.hero-stat { border-left: 1px solid rgba(255,255,255,0.22); padding-left: 16px; }
.hero-stat:first-child { border-left: none; padding-left: 0; }
.hero-stat .num { font-family: var(--font-stat); font-size: 2rem; font-weight: 800; display: block; }
.hero-stat .label { font-size: 0.82rem; color: #DCEBFA; }

/* ---------------------------------------------------------------
   SECTIONS
   --------------------------------------------------------------- */
.section { padding: 46px 0; }
.section-alt { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 22px;
}
.section-head a { font-weight: 700; font-size: 0.9rem; }

/* ---------------------------------------------------------------
   HOSPITAL CARD
   --------------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.hospital-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .15s;
}
.hospital-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hospital-card.gov { border-top: 3px solid var(--gov-green); }
.hospital-card:not(.gov) { border-top: 3px solid var(--primary); }
.hospital-card .type-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-deep);
    background: var(--primary-wash);
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
}
.hospital-card.gov .type-tag { color: var(--gov-green); background: var(--gov-green-wash); }
.hospital-card h3 { margin: 4px 0 0; }
.hospital-card .loc { font-size: 0.88rem; color: var(--ink-soft); }
.hospital-card .meta-row { display: flex; gap: 14px; font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; flex-wrap: wrap; }
.hospital-card .actions { margin-top: auto; display: flex; gap: 8px; padding-top: 12px; }

/* ---------------------------------------------------------------
   STAR RATINGS (display + interactive input)
   --------------------------------------------------------------- */
.rating-stars { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }
.rating-stars-track {
    position: relative;
    display: inline-block;
    font-size: 1.1rem;
    line-height: 1;
    letter-spacing: 2px;
    color: var(--line-strong);
}
.rating-stars-track::before { content: '★★★★★'; }
.rating-stars-fill {
    position: absolute; top: 0; left: 0; overflow: hidden;
    white-space: nowrap; color: var(--gold);
}
.rating-stars-fill::before { content: '★★★★★'; }
.rating-stars-sm .rating-stars-track { font-size: 0.9rem; letter-spacing: 1px; }
.rating-stars-num { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.rating-stars-count { font-size: 0.78rem; color: var(--ink-soft); }

.rating-input { display: flex; gap: 4px; }
.rating-input-star {
    background: none; border: none; cursor: pointer; padding: 2px;
    font-size: 1.9rem; line-height: 1; color: var(--line-strong);
    transition: transform .1s;
}
.rating-input-star span { pointer-events: none; }
.rating-input-star:hover { transform: scale(1.12); }
.rating-input-star.is-filled { color: var(--gold); }
.rate-widget { border-top: 3px solid var(--gold); }

/* ---------------------------------------------------------------
   COMPLAINT CARD
   --------------------------------------------------------------- */
.complaint-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.complaint-card + .complaint-card { margin-top: 14px; }
.complaint-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.category-chip {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--maroon-wash);
    color: var(--maroon);
    padding: 3px 10px;
    border-radius: 20px;
}
.complaint-date { font-size: 0.8rem; color: var(--ink-soft); }
.complaint-body { color: var(--ink); margin: 8px 0 12px; }
.vote-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vote-btn {
    border: 1.5px solid var(--line);
    background: var(--paper);
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vote-btn.true:hover, .vote-btn.true.active { border-color: var(--gov-green); color: var(--gov-green); background: var(--gov-green-wash); }
.vote-btn.false:hover, .vote-btn.false.active { border-color: var(--maroon); color: var(--maroon); background: var(--maroon-wash); }
.vote-btn.not_sure:hover, .vote-btn.not_sure.active { border-color: var(--accent-deep); color: var(--accent-deep); background: var(--accent-wash); }
.report-link { margin-left: auto; font-size: 0.82rem; color: var(--ink-soft); }

.disclaimer-box {
    border: 1px dashed var(--line-strong);
    background: var(--paper);
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    margin: 18px 0;
}

/* ---------------------------------------------------------------
   COMPLAINT SUBMISSION — step flow
   --------------------------------------------------------------- */
.step-tracker {
    display: flex;
    counter-reset: step;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}
.step-tracker .step {
    counter-increment: step;
    flex: 1;
    text-align: center;
    padding-bottom: 12px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    border-bottom: 3px solid transparent;
    position: relative;
}
.step-tracker .step::before {
    content: counter(step);
    display: block;
    width: 26px; height: 26px;
    line-height: 26px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--line-strong);
    margin: 0 auto 6px;
    font-family: var(--font-stat);
    font-weight: 700;
    color: var(--ink-soft);
}
.step-tracker .step.active { color: var(--primary-deep); border-color: var(--primary); font-weight: 700; }
.step-tracker .step.active::before { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-tracker .step.done::before { background: var(--gov-green); border-color: var(--gov-green); color: #fff; content: '✓'; }

.form-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    max-width: 640px;
    box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; }
.form-group .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
select, textarea, input[type="text"], input[type="tel"], input[type="url"], input[type="file"] {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}
select:focus, textarea:focus, input:focus { border-color: var(--primary); outline: none; }
textarea { resize: vertical; min-height: 130px; }
.form-actions { display: flex; justify-content: space-between; margin-top: 22px; }
.upload-note { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #B9C3D9; padding: 44px 0 22px; margin-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: 0.95rem; }
.site-footer a { color: #B9C3D9; }
.site-footer a:hover { color: #fff; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 30px;
    padding-top: 16px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    /* Top utility bar (tagline + language) is hidden on mobile:
       language switch lives in the menu, tagline lives in the footer. */
    .utility-bar { display: none; }
    .mobile-lang {
        display: flex; justify-content: space-between; align-items: center;
        padding: 6px 4px 12px; font-size: 0.9rem; color: var(--ink-soft); font-weight: 600;
    }
    .mobile-lang .lang-switch a { color: var(--ink); border-color: var(--line-strong); padding: 6px 16px; font-size: 0.88rem; }
    .mobile-lang .lang-switch a.active { color: #fff; border-color: var(--accent); }
    .footer-tagline { display: block; color: #B9C3D9; font-size: 0.85rem; margin: 18px 0 10px; text-align: center; }

    /* Header: hamburger + site name on one line */
    .site-header .container { justify-content: flex-start; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .nav-toggle { order: 1; flex-shrink: 0; }
    .brand { order: 2; flex: 1; min-width: 0; }
    .brand-mark { width: 36px; height: 36px; font-size: 1rem; }
    .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; min-width: 0; }
    .brand-name small { display: none; }
    .nav-toggle { display: flex; }
    .site-header .container { flex-wrap: wrap; }
    .nav-panel {
        order: 3;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }
    .main-nav { flex-direction: column; align-items: stretch; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
    .main-nav a { padding: 10px 4px; border-bottom: 1px solid var(--line); }
    .btn-block-mobile { width: 100%; justify-content: center; margin-bottom: 6px; }
    .nav-toggle-checkbox:checked ~ .nav-panel { max-height: 560px; }
    .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
    .nav-toggle-checkbox:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}

@media (max-width: 640px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .hero { padding: 34px 0 30px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
    .hero-stat:nth-child(3) { border-left: none; padding-left: 0; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-card { padding: 18px; }
    .section { padding: 30px 0; }
    .utility-bar .container { justify-content: center; text-align: center; }
    .utility-bar span:first-child { flex-basis: 100%; }
    h1 { max-width: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------
   SEARCH AUTOCOMPLETE DROPDOWN
   --------------------------------------------------------------- */
.search-panel { position: relative; }
.ac-box { position: relative; }
.ac-list {
    position: absolute; top: 6px; left: 0; right: 0; z-index: 30;
    background: #fff; border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    max-height: 340px; overflow-y: auto;
}
.ac-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ac-item:hover, .ac-item:focus { background: var(--primary-wash); text-decoration: none; }
.ac-item small { display: block; font-size: 0.8rem; color: var(--ink-soft); }
.ac-add {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    color: var(--accent-deep); font-weight: 700; background: var(--accent-wash);
}
.ac-add:hover { background: #fbdcd1; text-decoration: none; }
.ac-add-icon {
    width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; line-height: 1; flex-shrink: 0;
}