/* ============================================================
   Nigerian States Transportation Questionnaire
   Custom Stylesheet — Government Professional Theme
   ============================================================ */

:root {
    --ng-green:       #008751;  /* Nigerian flag green */
    --ng-green-dark:  #005f38;
    --ng-green-light: #e8f5ee;
    --ng-white:       #ffffff;
    --gov-gray:       #f4f5f7;
    --sidebar-bg:     #1a2332;
    --sidebar-hover:  #243447;
    --text-muted-gov: #6b7280;
}

/* ── Wizard: hide all steps before JS runs ────────────────── */
/* Must be in the stylesheet (loaded before body renders)      */
.wizard-step          { display: none; }
#group_ministry_name  { display: none; }
#group_testing_components { display: none; }

/* ── Global ───────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gov-gray);
    color: #1f2937;
}

/* ── Government top bar ───────────────────────────────────── */
.gov-topbar {
    background: var(--ng-green-dark);
    border-bottom: 3px solid #ffffff;
}
.gov-logo {
    height: 56px;
    width: auto;
}
.gov-title-main {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.2;
}
.gov-title-sub {
    color: rgba(255,255,255,0.8);
    font-size: 0.78rem;
    line-height: 1.2;
}

/* ── Navbar (kept for admin pages) ───────────────────────── */
.gov-navbar {
    background: var(--ng-green) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.gov-navbar .navbar-brand { color: #fff !important; font-size: 1rem; }
.gov-navbar .nav-link { color: rgba(255,255,255,0.9) !important; font-size: 0.875rem; transition: color 0.15s; }
.gov-navbar .nav-link:hover { color: #fff !important; }

/* ── Footer ───────────────────────────────────────────────── */
.gov-footer {
    background: #fff;
    border-top: 3px solid var(--ng-green);
}

/* ── Form hero ────────────────────────────────────────────── */
.form-hero {
    background: linear-gradient(135deg, var(--ng-green-dark) 0%, var(--ng-green) 100%);
    color: #fff;
    padding: 1.25rem 0 1rem;
}
.form-hero h1 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}
.form-hero .small {
    font-size: 0.78rem;
    opacity: 0.88;
}

/* ── Wizard top bar ───────────────────────────────────────── */
.wizard-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
}
.wizard-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ng-green-dark);
    white-space: nowrap;
    min-width: 100px;
}
.wizard-pct {
    font-size: 0.75rem;
    color: var(--text-muted-gov);
    min-width: 32px;
    text-align: right;
}

/* Step dots */
.step-dots { flex-wrap: wrap; }
.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: default;
    transition: background 0.2s, transform 0.2s;
}
.step-dot.completed { background: var(--ng-green); opacity: 0.6; }
.step-dot.active    { background: var(--ng-green); transform: scale(1.4); }

/* ── Section cards ─────────────────────────────────────────── */
.q-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}
.q-section-header {
    background: var(--ng-green);
    color: #fff;
    padding: 0.875rem 1.1rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
}
.q-section-header .section-num {
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}
.q-section-body {
    padding: 1.1rem 1rem;
}
.q-question { margin-bottom: 0; }
.q-question + .q-question { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #f3f4f6; }

/* ── Labels ───────────────────────────────────────────────── */
.q-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 0.4rem;
    display: block;
    line-height: 1.4;
}
.q-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted-gov);
    font-weight: 400;
}

/* ── Form controls ─────────────────────────────────────────── */
.form-control, .form-select {
    font-size: 1rem; /* prevent iOS zoom (must be >= 16px) */
    min-height: 48px;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ng-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 135, 81, 0.18);
}
.form-check-input:checked {
    background-color: var(--ng-green);
    border-color: var(--ng-green);
}
textarea.form-control { min-height: unset; }

/* ── Radio cards (2-option yes/no) ────────────────────────── */
.radio-card-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.radio-card {
    display: block;
    cursor: pointer;
}
.radio-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    min-height: 54px;
}
.radio-card input:checked + .radio-card-inner {
    border-color: var(--ng-green);
    background: var(--ng-green-light);
    color: var(--ng-green-dark);
}
.radio-card:hover .radio-card-inner {
    border-color: var(--ng-green);
    background: var(--ng-green-light);
}

/* ── Radio stack (multi-option list) ──────────────────────── */
.radio-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.radio-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.88rem;
    line-height: 1.4;
}
.radio-row input[type=radio] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    accent-color: var(--ng-green);
}
.radio-row:has(input:checked) {
    border-color: var(--ng-green);
    background: var(--ng-green-light);
}
.radio-row:hover {
    border-color: var(--ng-green);
    background: #f0faf5;
}

/* ── Checkbox stack ───────────────────────────────────────── */
.check-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.88rem;
    line-height: 1.4;
}
.check-row input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    accent-color: var(--ng-green);
}
.check-row:has(input:checked) {
    border-color: var(--ng-green);
    background: var(--ng-green-light);
}
.check-row:hover {
    border-color: var(--ng-green);
    background: #f0faf5;
}

/* ── Conditional hidden fields ────────────────────────────── */
.conditional-field {
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border-left: 3px solid var(--ng-green);
    border-radius: 0 8px 8px 0;
}

/* ── Submit button ─────────────────────────────────────────── */
.btn-submit-gov {
    background: var(--ng-green);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    width: 100%;
    transition: background 0.2s;
    min-height: 54px;
}
.btn-submit-gov:hover  { background: var(--ng-green-dark); color: #fff; }
.btn-submit-gov:active { opacity: 0.9; }

/* ── Wizard navigation buttons ────────────────────────────── */
.wizard-nav .btn {
    min-height: 54px;
    font-size: 1rem;
    border-radius: 10px;
    font-weight: 600;
}
.wizard-nav .btn-success { background: var(--ng-green); border-color: var(--ng-green); }
.wizard-nav .btn-success:hover { background: var(--ng-green-dark); border-color: var(--ng-green-dark); }

/* ── Review summary ───────────────────────────────────────── */
.review-section {
    border-bottom: 1px solid #e5e7eb;
}
.review-section:last-child { border-bottom: none; }
.review-section-header {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ng-green-dark);
    border-bottom: 1px solid #e5e7eb;
}
.review-section-body { padding: 0 1rem; }
.review-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.82rem;
}
.review-row:last-child { border-bottom: none; }
.review-key { min-width: 200px; font-weight: 600; color: #4b5563; flex-shrink: 0; }
.review-val { color: #1f2937; word-break: break-word; line-height: 1.5; }

/* ── Declaration box ──────────────────────────────────────── */
.declaration-box .form-check-input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex-shrink: 0;
}
.declaration-box .form-check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-body {
    background: #f0f2f5;
}

.admin-sidebar {
    min-height: 100vh;
    width: 240px;
    min-width: 240px;
    background: var(--sidebar-bg);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-link {
    color: rgba(255,255,255,0.75) !important;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--ng-green) !important;
    color: #fff !important;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    height: 52px;
}

/* ── Admin stat cards ─────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border-left: 4px solid var(--ng-green);
}
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ng-green-dark);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted-gov);
    margin-top: 0.25rem;
}

/* ── Admin table ──────────────────────────────────────────── */
.admin-table th {
    background: var(--ng-green);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.admin-table tbody tr:hover {
    background: var(--ng-green-light);
}

/* ── Thank you page ───────────────────────────────────────── */
.thankyou-icon {
    font-size: 4rem;
    color: var(--ng-green);
}

/* ── View submission detail ───────────────────────────────── */
.detail-section {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.detail-header {
    background: var(--ng-green);
    color: #fff;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.detail-body {
    padding: 1rem 1.25rem;
}
.detail-row {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-key {
    min-width: 220px;
    font-weight: 600;
    color: #4b5563;
}
.detail-val {
    color: #1f2937;
}

/* ── Mobile-first overrides ────────────────────────────────── */
@media (max-width: 575px) {
    body { font-size: 0.95rem; }

    .gov-logo { height: 40px; }
    .gov-title-main { font-size: 0.85rem; }

    /* Full-width container on phones */
    .container { padding-left: 12px; padding-right: 12px; }

    .q-section-body { padding: 1rem 0.875rem; }
    .q-section-header { padding: 0.75rem 0.875rem; font-size: 0.88rem; }
    .q-label { font-size: 0.88rem; }

    .radio-card-group { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .radio-card-inner  { padding: 0.75rem 0.25rem; font-size: 0.85rem; min-height: 50px; }

    .radio-row, .check-row { padding: 0.7rem 0.75rem; font-size: 0.85rem; }

    .wizard-nav .btn { font-size: 0.95rem; min-height: 50px; }
    .btn-submit-gov   { font-size: 0.95rem; min-height: 50px; padding: 0.875rem 1rem; }

    .review-key { min-width: 120px; font-size: 0.78rem; }
    .review-val { font-size: 0.78rem; }
}

/* ── Responsive admin ─────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .gov-topbar, .wizard-topbar, .wizard-nav,
    .form-hero, .btn-submit-gov, footer, nav { display: none !important; }
    .q-section { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
}
