/* ══════════════════════════════════════════
   Hospital Request System — Public CSS
   Modern Patient Portal Theme v2
   ══════════════════════════════════════════ */

@font-face { font-family:'Inter'; font-weight:300; font-display:swap; src:url('../vendor/fonts/inter/inter-300.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-weight:400; font-display:swap; src:url('../vendor/fonts/inter/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-weight:500; font-display:swap; src:url('../vendor/fonts/inter/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-weight:600; font-display:swap; src:url('../vendor/fonts/inter/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-weight:700; font-display:swap; src:url('../vendor/fonts/inter/inter-700.woff2') format('woff2'); }

:root {
    --brand: #0e54b7;
    --brand-light: #0d5fc5;
    --brand-gradient: linear-gradient(135deg, #042d6e 0%, #064093 100%);
    --accent: #064093;
    --accent-soft: rgba(6,64,147,0.08);
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --surface: #ffffff;
    --bg: #f0f4f8;
    --text-primary: #1a2332;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow: 0 4px 20px rgba(6,64,147,0.10);
    --shadow-lg: 0 12px 40px rgba(6,64,147,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1 0 auto;
}

/* ── NAVBAR ── */
.public-navbar {
    background: var(--brand-gradient);
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.public-navbar-redesign {
    border-bottom: 1px solid rgba(255,255,255,0.14);
}
.public-navbar > .container {
    flex-wrap: nowrap;
    align-items: center;
}
.public-navbar .navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.navbar-brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
}
.navbar-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.public-brand-wrap {
    gap: 10px !important;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    max-width: calc(100% - 96px);
}
.public-brand-logo-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-shrink: 0;
}
.public-brand-logo {
    height: 42px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}
.public-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}
.public-brand-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: rgba(255,255,255,0.72);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.public-brand-name {
    font-size: 1.5rem !important;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-desktop-actions {
    flex-shrink: 0;
}
.navbar-action-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    font-size: 0.78rem;
    padding: 6px 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
    white-space: nowrap;
}
.navbar-action-btn:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
    text-decoration: none;
}

/* ── WARD HEADER ── */
.ward-header-card {
    background: var(--brand-gradient);
    border-radius: var(--radius);
    padding: 20px 24px;
    color: #fff;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.ward-header-icon {
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.3);
}
.ward-header-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.ward-header-sub {
    font-size: 0.78rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* ── HOME WARD HEADER (general page) ── */
.home-ward-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 24px;
    min-height: 134px;
    position: relative;
    overflow: hidden;
}
.home-ward-header::before {
    content: '';
    position: absolute;
    right: -24px; top: -36px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.home-ward-header::after {
    content: '';
    position: absolute;
    right: 90px; bottom: -60px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.home-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}
.home-header-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    color: #fff;
    flex-shrink: 0;
}
.home-header-title {
    font-size: clamp(1.15rem, 5vw, 1.4rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 5px;
}
.home-header-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.5;
}
.home-header-qr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 1.5px solid rgba(255,255,255,0.32);
    border-radius: 10px;
    padding: 9px 18px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    font-family: 'Inter', sans-serif;
    align-self: flex-start;
    position: relative;
    white-space: nowrap;
}
.home-header-qr-btn:hover { background: rgba(255,255,255,0.24); }

/* ── STEP PROGRESS ── */
.step-progress-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}
.step-progress-bars {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}
.step-seg {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 5px;
    transition: background var(--transition), opacity var(--transition);
}
.step-seg.done { background: var(--brand); opacity: 0.3; }
.step-seg.active { background: var(--brand); }
.step-prog-labels {
    display: flex;
    justify-content: space-between;
}
.step-prog-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color var(--transition);
}
.step-prog-label.active { color: var(--brand); font-weight: 700; }
.step-prog-label i { font-size: 0.72rem; }

/* ── CATEGORY BUTTONS ── */
.category-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px 10px 16px;
    width: 100%;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    transition: all var(--transition);
    cursor: pointer;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.category-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: 0 0 16px 16px;
}
.category-btn:hover::after,
.category-btn.selected::after { opacity: 1; }
.category-btn:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.category-btn.selected {
    border-color: var(--brand);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(6,64,147,0.12);
}

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ── FORM ── */
.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(6,64,147,0.12);
    outline: none;
}
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-text { font-size: 0.75rem; }

/* ── BUTTONS ── */
.btn {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 20px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}
.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 2px 12px rgba(6,64,147,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #021f4a, #064093);
    box-shadow: 0 4px 20px rgba(6,64,147,0.4);
    transform: translateY(-1px);
    color: #fff;
}
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-outline-secondary {
    border: 2px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ── ALERTS & BANNERS ── */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 14px 18px;
}
.alert-primary {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--accent);
}
.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success);
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

/* ── STATUS DETAIL (legacy dl.row styles) ── */
dl.row dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding-bottom: 10px;
}
dl.row dd {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
dl.row dt:last-of-type, dl.row dd:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── BADGE ── */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* ── SUCCESS ANIMATION ── */
@keyframes successPop {
    0% { transform: scale(0.7); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.success-icon-anim {
    animation: successPop 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* ── TICKET DISPLAY ── */
#ticket-number-display {
    letter-spacing: 3px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand);
    font-family: 'Courier New', monospace;
    background: var(--bg);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 2px dashed var(--border);
}

/* ── IMAGE PREVIEW ── */
#image-preview {
    border-radius: 12px;
    max-height: 180px;
    width: auto;
    border: 2px solid var(--border);
}

/* ── CATEGORY SEARCH ── */
.category-search-wrap {
    position: relative;
}
.category-search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
.category-search-wrap input {
    padding-left: 36px;
}

/* ── TRACK INPUT ── */
.track-input-group {
    display: flex;
    box-shadow: var(--shadow);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.track-input {
    flex: 1;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 1rem;
    padding: 14px 18px;
    outline: none;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    transition: border-color var(--transition);
}
.track-input:focus { border-color: var(--accent); }
.track-btn {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    padding: 14px 22px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex; align-items: center;
}
.track-btn:hover {
    background: linear-gradient(135deg, #021f4a, #064093);
}
/* fallback for when .form-control + .btn are used inside .track-input-group */
.track-input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
    border-width: 2px;
    font-size: 1rem;
    padding: 14px 18px;
}
.track-input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 22px;
}

/* ── STATUS CARD ── */
.status-card-header {
    background: var(--brand-gradient) !important;
    color: #fff;
    padding: 20px 24px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.status-card-header-ticket {
    font-family: 'Courier New', monospace;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.05em;
}
.status-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.status-field-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── CATEGORY BUTTON ICON ── */
.category-btn-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(6,64,147,0.08);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all var(--transition);
    pointer-events: none;
}
.category-btn:hover .category-btn-icon,
.category-btn.selected .category-btn-icon {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(6,64,147,0.35);
    transform: scale(1.05);
}
.category-btn-label {
    font-size: 0.79rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    color: var(--text-primary);
    transition: color var(--transition);
    pointer-events: none;
}
.category-btn:hover .category-btn-label,
.category-btn.selected .category-btn-label { color: var(--brand); }

/* ── SECTION HEADING ── */
.section-heading {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-heading::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 15px;
    background: var(--brand-gradient);
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── PUBLIC WELCOME SURFACE ── */
.welcome-surface {
    background: #ffffff;
    border: 1px solid #dbe6f7;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(6,64,147,0.08);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.welcome-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(6,64,147,0.2);
}
.welcome-copy h2 {
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ── STEP BACK BUTTON ── */
.step-back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
    text-decoration: none;
}
.step-back-btn:hover { color: var(--brand); }

/* ── SELECTED CATEGORY BANNER (step 2) ── */
.selected-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #eef3fc;
    border: 1.5px solid #b8cef5;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.selected-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.selected-banner-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 3px;
}
.selected-banner-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #064093;
}

/* ── SERVICE LIST (step 2) ── */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.service-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    width: 100%;
    font-family: 'Inter', sans-serif;
}
.service-item:hover,
.service-item:focus {
    border-color: var(--accent);
    background: #f0f4fb;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    outline: none;
}
.service-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.service-item-dot.other {
    background: #94a3b8;
}
.service-item-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.service-item-arrow {
    color: #cbd5e1;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.service-item-other {
    border-style: dashed;
    background: #f8fafc;
}
.service-item-other:hover {
    border-style: solid;
}

/* ── SUMMARY CARD (step 3) ── */
.summary-card {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.summary-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}
.summary-row-icon {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.summary-row-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 3px;
}
.summary-row-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

/* ── PRIORITY GRID ── */
.priority-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.priority-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}
.priority-btn i { font-size: 1.1rem; }
.priority-btn:hover { border-color: var(--accent); color: var(--accent); background: #f0f4fb; }
.priority-btn.priority-active { border-color: var(--accent); color: var(--accent); background: #edf2fc; }
.priority-btn.priority-emergency.priority-active { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
@media (max-width: 380px) {
    .priority-grid { grid-template-columns: 1fr 1fr; }
}

/* ── PAGE FADE IN ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
main > * {
    animation: fadeUp 0.35s ease both;
}
main > *:nth-child(2) { animation-delay: 0.07s; }
main > *:nth-child(3) { animation-delay: 0.14s; }

/* ── WARD QR BUTTON ── */
.ward-qr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 10px;
    padding: 8px 14px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}
.ward-qr-btn:hover {
    background: rgba(255,255,255,0.28);
}

/* ── PAGE HEADING ── */
.page-heading { padding: 2px 0 6px; }
.page-heading-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}
.page-heading-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── PAGE LOADER ── */
#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(240,244,248,0.92);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.28s ease;
    pointer-events: all;
}
#page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.loader-gif {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── FOOTER (single row) ── */
.public-footer-simple {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #e8edf5;
}
.footer-simple-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-simple-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand-logo-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.footer-simple-brand img {
    height: 21px;
    width: 21px;
    object-fit: contain;
}
.footer-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.footer-brand-copy strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}
.footer-brand-copy small {
    font-size: 0.66rem;
    color: #94a3b8;
}
.footer-simple-pow {
    font-size: 0.73rem;
    color: #94a3b8;
}
.footer-simple-pow strong {
    color: #64748b;
    font-weight: 700;
}
@media (max-width: 767px) { .public-footer-simple { display: none; } }

/* ── STATUS TIMELINE ── */
.status-timeline {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    gap: 0;
}
.st-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.st-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.st-done .st-circle {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.st-active .st-circle {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(6,64,147,0.07);
    box-shadow: 0 0 0 3px rgba(6,64,147,0.1);
}
.st-label {
    font-size: 0.63rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.st-done .st-label, .st-active .st-label { color: var(--brand); }
.st-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-bottom: 22px;
}
.st-connector.st-done { background: var(--brand); }

/* ════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════ */

/* Tablets and below */
@media (max-width: 768px) {
    main.container { padding-top: 16px !important; }

    /* Navbar brand: shrink text on narrow screens */
    .public-navbar .navbar-brand { font-size: 0.95rem; }
    .navbar-brand-icon { width: 32px; height: 32px; font-size: 0.95rem; }
    .public-brand-wrap { max-width: 100%; }
    .public-brand-logo-wrap { width: 38px; height: 38px; border-radius: 11px; }
    .public-brand-logo { width: 24px; height: 24px; }
    .public-brand-name { font-size: 0.9rem; }

    /* Ward header: tighter padding */
    .ward-header-card { padding: 16px 18px; gap: 12px; }
    .ward-header-icon { width: 46px; height: 46px; font-size: 1.25rem; border-radius: 12px; }
    .ward-header-name { font-size: 1rem; }

    /* Home ward header */
    .home-ward-header { padding: 18px 20px; min-height: 118px; gap: 12px; }
    .home-header-icon { width: 52px; height: 52px; font-size: 1.45rem; border-radius: 15px; }
    .home-header-title { font-size: 1.1rem; }
    .home-header-qr-btn { font-size: 0.78rem; padding: 8px 14px; }

    /* Step progress */
    .step-progress-wrap { padding: 12px 14px; }
    .step-prog-label { font-size: 0.64rem; }

    /* Category buttons */
    .category-btn { min-height: 100px; padding: 16px 8px 14px; border-radius: 14px; }
    .category-btn-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 1.35rem; }
    .category-btn-label { font-size: 0.73rem; }

    /* Service list */
    .service-item { padding: 12px 14px; }

    /* Summary card */
    .summary-row { padding: 12px 14px; }

    /* Priority grid: 2 columns on mobile */
    .priority-grid { grid-template-columns: repeat(2, 1fr); }

    /* Form inputs */
    .form-control, .form-select { padding: 10px 12px; font-size: 0.875rem; }

    /* Track input */
    .track-input, .track-input-group .form-control { padding: 12px 14px; font-size: 0.9rem; }
    .track-btn, .track-input-group .btn { padding: 12px 16px; }

    /* Status card header: stack on mobile */
    .status-card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Small phones */
@media (max-width: 480px) {
    .navbar-action-btn { padding: 7px 10px; }
    /* Brand text: truncate if too long */
    .navbar-brand-text { max-width: 140px; font-size: 0.9rem; }
    .public-brand-wrap { gap: 8px !important; max-width: calc(100% - 12px); }
    .public-brand-label { font-size: 0.58rem; }
    .public-brand-name { font-size: 0.83rem; }

    /* Ward header: stack icon + text vertically */
    .ward-header-card { flex-wrap: wrap; }

    /* QR button: hide text label on small phones */
    .ward-qr-label { display: none; }
    .ward-qr-btn { padding: 8px 10px; }

    /* Home ward header */
    .home-ward-header { padding: 16px; min-height: 110px; gap: 10px; }
    .home-header-icon { width: 46px; height: 46px; font-size: 1.3rem; border-radius: 13px; }
    .home-header-title { font-size: 1rem; }
    .home-header-qr-btn { font-size: 0.75rem; padding: 7px 12px; }

    /* Step progress */
    .step-prog-label i { display: none; }
    .step-prog-label { font-size: 0.62rem; }

    /* Category buttons */
    .category-btn { min-height: 92px; padding: 14px 8px 12px; }
    .category-btn-icon { width: 42px; height: 42px; border-radius: 11px; font-size: 1.25rem; }
    .category-btn-label { font-size: 0.7rem; }

    /* Category grid: always 2 cols */
    .col-6 { width: 50%; }

    /* Ticket display */
    #ticket-number-display { font-size: 1rem; letter-spacing: 2px; padding: 8px 14px; }

    /* Selected banner */
    .selected-banner { padding: 12px 14px; gap: 10px; }
    .selected-banner-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 10px; }

    /* Back button */
    .step-back-btn { font-size: 0.82rem; }

    /* Submit button */
    .btn-lg { font-size: 0.9rem; padding: 13px 20px; }
}

/* Very tiny phones (375px and below) */
@media (max-width: 375px) {
    .ward-header-card { padding: 12px 14px; }
    main.container { padding-left: 12px !important; padding-right: 12px !important; }
}


/* ══════════════════════════════════════════════════════════════
   MOBILE APP UI — v3
   Bottom Navigation · App Hero · Quick Actions · App Icons
   ══════════════════════════════════════════════════════════════ */

/* ── Hide desktop nav actions on mobile (bottom nav takes over) ── */
@media (max-width: 767px) {
    .navbar-desktop-actions { display: none !important; }
}

/* ── Main content bottom clearance for bottom nav ── */
.has-bottom-nav {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}
@media (min-width: 768px) {
    .has-bottom-nav { padding-bottom: 28px !important; }
}

/* ── Bottom Navigation Bar ── */
.app-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1.5px solid #e8edf5;
    display: flex;
    align-items: stretch;
    z-index: 1100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(6, 64, 147, 0.09);
}
@media (min-width: 768px) {
    .app-bottom-nav { display: none; }
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.app-nav-item i {
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1);
}
.app-nav-item span { line-height: 1; }
.app-nav-item.active { color: var(--brand); }
.app-nav-item.active i { transform: scale(1.14); }
.app-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 3px;
    background: var(--brand-gradient);
    border-radius: 0 0 4px 4px;
}
.app-nav-item:hover { color: var(--brand); text-decoration: none; }

/* Footer hidden on mobile — bottom nav replaces footer navigation */

/* ══ HOME PAGE: APP-STYLE HERO BANNER ══ */
.app-hero-banner {
    background: var(--brand-gradient);
    border-radius: 22px;
    padding: 22px 22px 22px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    box-shadow: 0 10px 32px rgba(6, 64, 147, 0.22);
}
.app-hero-banner::before {
    content: '';
    position: absolute;
    top: -32px; right: -32px;
    width: 145px; height: 145px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.app-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -55px; right: 65px;
    width: 115px; height: 115px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}
.app-hero-body {
    position: relative;
    flex: 1;
    min-width: 0;
}
.app-hero-greeting {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.app-hero-title {
    font-size: clamp(1.18rem, 5vw, 1.45rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.17;
    margin: 0 0 8px;
}
.app-hero-sub {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.62);
    margin: 0;
    line-height: 1.55;
}
.app-hero-emblem {
    width: 70px; height: 70px;
    background: rgba(255, 255, 255, 0.16);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: #ffffff;
    flex-shrink: 0;
    position: relative;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.app-hero-emblem img {
    height: 44px;
    max-width: 56px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* ══ QUICK ACTION CARDS ══ */
.app-quick-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.app-quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 16px 16px 14px;
    text-decoration: none !important;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 10px rgba(6, 64, 147, 0.06);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.app-quick-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(6, 64, 147, 0.14);
    color: var(--text-primary);
}
.app-quick-card:active {
    transform: scale(0.96);
    transition-duration: 0.07s;
}
.app-quick-icon-wrap {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.app-quick-icon-wrap.qr-icon   { background: rgba(6, 64, 147, 0.09);  color: var(--brand); }
.app-quick-icon-wrap.track-icon { background: rgba(22, 163, 74, 0.09); color: #16a34a; }
.app-quick-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}
.app-quick-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 1px;
    font-weight: 400;
    line-height: 1.3;
}

/* ══ APP SECTION HEADER (above category grid) ══ */
.app-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.app-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.app-section-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f1f5f9;
    border-radius: 20px;
    padding: 4px 11px;
    white-space: nowrap;
}

/* ══ CATEGORY BUTTONS: enhanced for app-icon feel ══ */
/* Override existing .category-btn to be larger and more tactile */
.category-btn {
    min-height: 126px;
    border-radius: 18px;
    padding: 22px 10px 18px;
    gap: 12px;
}
.category-btn-icon {
    width: 58px; height: 58px;
    border-radius: 16px;
    font-size: 1.55rem;
}
.category-btn-label { font-size: 0.79rem; }

@media (max-width: 768px) {
    .category-btn { min-height: 112px; padding: 18px 8px 15px; border-radius: 16px; gap: 10px; }
    .category-btn-icon { width: 52px; height: 52px; border-radius: 14px; font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .category-btn { min-height: 102px; padding: 16px 8px 13px; gap: 9px; }
    .category-btn-icon { width: 48px; height: 48px; border-radius: 12px; font-size: 1.3rem; }
    .app-hero-banner { padding: 18px 16px; min-height: 118px; }
    .app-hero-emblem { width: 62px; height: 62px; font-size: 1.7rem; border-radius: 17px; }
    .app-quick-card { padding: 13px 12px; gap: 8px; }
    .app-quick-icon-wrap { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 10px; }
    .app-quick-label { font-size: 0.8rem; }
    .app-quick-sub { font-size: 0.68rem; }
}

/* ══ WARD HEADER: app-style for ward-specific pages ══ */
.ward-header-card {
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(6, 64, 147, 0.18);
}

/* ══ STEP PROGRESS BAR: tighter / app-style ══ */
.step-progress-wrap {
    border-radius: 14px;
    padding: 12px 16px;
}
.step-seg { height: 4px; border-radius: 4px; }
.step-prog-label { font-size: 0.67rem; }

/* ══ SERVICE LIST ITEMS: bigger tap target ══ */
.service-item {
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 12px;
}
.service-item:active { transform: scale(0.98); transition-duration: 0.07s; }

/* ══ SUBMIT BUTTON: pill style ══ */
#btn-submit.btn-lg {
    border-radius: 14px;
    padding: 15px 24px;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* ══ SUCCESS SCREEN: more festive ══ */
#step-success .rounded-circle {
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.35);
}

