/* =========================================================================
   BPIC TENDERS PORTAL — mobile.css
   Responsive layer for every page. Load it LAST, after all other CSS.

   HOW THIS FILE IS ORGANISED
   --------------------------
   PART A — GENERIC RESIZER (works on any page, any device)
     A1. Breakpoint tokens
     A2. Global safety (nothing wider than the screen)
     A3. Large screens            1600px and up
     A4. Small laptops            1081px – 1240px   (compact nav)
     A5. Tablets                  1080px and below  (hamburger nav)
     A6. Tablet layout            769px – 1080px
     A7. Phones                   768px and below
     A8. Small phones             480px and below
     A9. Very small phones        360px and below
     A10. Phones held sideways    short + landscape
     A11. Touch screens           no hover

   PART B — SHARED COMPONENTS ON MOBILE
     B1. Footer
     B2. CTA box ("Need help applying for a tender?")
     B3. Chatbot
     B4. Terms / Privacy modals

   PART C — PAGE BY PAGE
     C1. Home            (index.html)
     C2. Browse Tenders  (tenders.html)
     C3. Tender Details  (tender-details.html)
     C4. Services        (services.html)
     C5. About           (about.html)
     C6. Contact         (contact.html)
     C7. Login/Register  (login.html, register.html)

   BREAKPOINTS USED (same numbers everywhere, so they are easy to find)
     1600 / 1240 / 1080 / 960 / 768 / 600 / 480 / 360
   ========================================================================= */


/* =========================================================================
   PART A — GENERIC RESIZER
   ========================================================================= */

/* A1. Breakpoint tokens ---------------------------------------------------
   --m-gutter is the space between the screen edge and the content.
   It gets smaller on smaller screens. */

:root {
    --m-gutter: 1rem;
    --m-tap: 44px;           /* minimum finger-friendly button height */
}

@media (max-width: 768px) {
    :root {
        --m-gutter: 1rem;
    }
}

@media (max-width: 360px) {
    :root {
        --m-gutter: 0.75rem;
    }
}


/* A2. Global safety (all screen sizes) ------------------------------------ */

img,
video,
iframe,
canvas {
    max-width: 100%;
    height: auto;
}

/* The Union Territory row on the home page has class="Union Territory-row",
   which the browser reads as two classes: "Union" and "Territory-row".
   Neither had any style, so the chips had no spacing. This gives it the
   same layout as the state row. */
.Territory-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

/* Tenders page, card view: the empty table box still showed its border
   as a thin line above the cards. Hide the whole box in card view. */
.card-view .table-wrapper {
    display: none;
}

/* Filter button on the tenders page is hidden on desktop. */
.mobile-filter-btn {
    display: none;
}


/* A3. Large screens (1600px and up) ---------------------------------------
   Let the content use a little more of a big monitor. */

@media (min-width: 1600px) {
    :root {
        --max-width: 1360px;
    }
}


/* A4. Small laptops (1081px – 1240px) --------------------------------------
   The full desktop nav needs about 1150px. Tighten it so it still fits. */

@media (min-width: 1081px) and (max-width: 1240px) {
    .nav-shell {
        gap: 0.6rem;
    }

    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .nav-actions .btn {
        padding: 0.7rem 1rem;
    }

    .lang-icon {
        display: none;
    }
}


/* A5. Tablets and phones (1080px and below) — HAMBURGER NAV ---------------
   How it works:
   - The nav row is allowed to wrap onto new lines.
   - Row 1: logo on the left, ☰ button on the right.
   - When ☰ is tapped, main.js adds .mobile-open to .nav-links and
     .nav-actions. They then appear as full-width rows under the logo.
   - No absolute positioning, so the menu never overlaps itself even when
     the user is logged in or the site is switched to Hindi. */

@media (max-width: 1080px) {

    .nav-shell {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.6rem 0;
    }

    .brand {
        flex: 1;
        min-width: 0;
    }

    .brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Show the ☰ button */
    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--m-tap);
        height: var(--m-tap);
        padding: 0;
        flex-shrink: 0;
        font-size: 1.25rem;
        cursor: pointer;
    }

    /* Highlight ☰ while the menu is open */
    .nav-shell:has(.nav-links.mobile-open) .mobile-toggle {
        background: var(--primary-soft);
        border-color: rgba(21, 159, 219, 0.35);
        color: var(--primary-dark);
    }

    /* Hidden until ☰ is tapped */
    .nav-links,
    .nav-actions {
        display: none;
    }

    /* --- Open menu: links --- */
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        flex-basis: 100%;
        margin-top: 0.4rem;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.mobile-open a {
        display: block;
        padding: 0.8rem 1rem;
        border-radius: 12px;
        font-size: 1rem;
    }

    /* --- Open menu: language + login/register (or name + logout) --- */
    .nav-actions.mobile-open {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.6rem;
        flex-basis: 100%;
        padding: 0.75rem;
        margin-bottom: 0.4rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
    }

    .nav-actions.mobile-open .lang-switch {
        flex-basis: 100%;
        justify-content: center;
    }

    .nav-actions.mobile-open .btn,
    .nav-actions.mobile-open .small-note {
        flex: 1;
        min-height: var(--m-tap);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* If the open menu is taller than the screen (phone held sideways),
       let the header scroll instead of cutting the menu off. */
    .site-nav:has(.mobile-open) {
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
    }
}


/* A6. Tablet layout (769px – 1080px) --------------------------------------- */

@media (min-width: 769px) and (max-width: 1080px) {

    .section {
        padding: 3.25rem 0;
    }

    .hero {
        padding: 2.5rem 0 1.5rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem;
    }
}

@media (min-width: 769px) and (max-width: 960px) {

    /* Home: the two big panels are too narrow side by side */
    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* A7. Phones (768px and below) ---------------------------------------------- */

@media (max-width: 768px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: calc(100% - 2 * var(--m-gutter));
    }

    /* Grid and flex children are allowed to shrink below their content */
    .container > *,
    .hero-grid > *,
    .showcase-grid > *,
    .footer-grid > *,
    .page-main > * {
        min-width: 0;
    }

    /* Long words, e-mails and reference numbers wrap instead of
       pushing the page sideways */
    h1, h2, h3, h4, p, li, a, strong, span, label {
        overflow-wrap: break-word;
    }

    /* --- Section spacing: tighter than desktop --- */
    .section {
        padding: 2.25rem 0;
    }

    .section-header {
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 0.75rem;
        margin-bottom: 1.1rem;
    }

    .section-title {
        font-size: clamp(1.35rem, 5.6vw, 1.7rem);
    }

    .eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.1em;
        margin-bottom: 0.6rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* --- Buttons: finger-sized, text centred --- */
    .btn {
        min-height: var(--m-tap);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 1.15rem;
    }

    .btn-ghost {
        padding-inline: 0;
    }

    /* --- Forms ---
       16px text stops iPhone Safari from zooming in when an input is tapped */
    input,
    select,
    textarea {
        font-size: 16px;
        min-height: var(--m-tap);
        width: 100%;
    }

    textarea {
        min-height: 120px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: auto;
        min-height: 0;
    }

    /* --- Page title block used by inner pages --- */
    .page-shell {
        padding: 1rem 0 2rem;
    }

    .page-intro {
        padding: 1.25rem 0 1rem;
    }

    .page-intro h1 {
        font-size: clamp(1.6rem, 7vw, 2rem);
        line-height: 1.2;
    }

    /* --- Cards: slightly less padding --- */
    .panel-card,
    .detail-card,
    .service-card,
    .contact-card,
    .info-card,
    .feature-card {
        padding: 1.1rem;
    }

    /* Background grid: drop the fixed attachment (janky on phones) */
    body::before {
        background-attachment: scroll;
    }
}


/* A8. Small phones (480px and below) --------------------------------------- */

@media (max-width: 480px) {

    .brand {
        gap: 0.6rem;
        font-size: 0.95rem;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .section {
        padding: 1.9rem 0;
    }

    /* Buttons share the row and grow to fill it. If their text doesn't
       fit side by side, a button drops to its own full-width line
       (text is never split inside a button). */
    .hero-actions {
        gap: 0.6rem;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
        white-space: nowrap;
        padding-inline: 1rem;
    }
}


/* A9. Very small phones (360px and below) ---------------------------------- */

@media (max-width: 360px) {

    .brand span {
        font-size: 0.88rem;
    }

    /* Buttons stack instead of squeezing */
    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section-title {
        font-size: 1.3rem;
    }
}


/* A10. Phones held sideways ------------------------------------------------
   Short, wide screens: keep the header small so content is visible. */

@media (max-height: 500px) and (orientation: landscape) {

    .nav-shell {
        padding: 0.35rem 0;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .hero {
        padding: 1.25rem 0 1rem;
    }

    .hero-grid {
        padding: 0.5rem 0;
    }

    .auth-shell {
        min-height: auto;
    }
}


/* A11. Touch screens ------------------------------------------------------
   Phones have no mouse. Hover effects "stick" after a tap and cards jump
   up and stay there. Turn the movement off; keep colour changes. */

@media (hover: none) {

    .btn:hover,
    .stat-card:hover,
    .info-card:hover,
    .feature-card:hover,
    .service-card:hover,
    .panel-card:hover,
    .tender-card:hover,
    .field-grid > .field:hover,
    .chatbot-toggle:hover,
    .chatbot-body button:hover {
        transform: none;
    }

    .btn:hover::before {
        left: -60%;
    }

    a,
    button {
        -webkit-tap-highlight-color: rgba(21, 159, 219, 0.15);
    }
}


/* =========================================================================
   PART B — SHARED COMPONENTS ON MOBILE
   ========================================================================= */

/* B1. Footer ---------------------------------------------------------------- */

@media (max-width: 768px) {

    .footer {
        margin-top: 1rem;
        /* extra space at the bottom so the chat button doesn't cover text */
        padding: 2rem 0 5.5rem;
    }

    /* About spans the full row, the three link lists sit side by side */
    .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem 1rem;
    }

    .footer-grid > div:first-child {
        grid-column: 1 / -1;
    }

    .footer h4 {
        margin-bottom: 0.5rem;
    }

    .footer a {
        padding: 0.3rem 0;
        margin-bottom: 0.2rem;
        overflow-wrap: anywhere;
    }

    /* "BPIC Tender Platform — Beta Version 3" sits outside the container */
    .footer > p {
        width: calc(100% - 2 * var(--m-gutter));
        margin: 1.5rem auto 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
        font-size: 0.85rem;
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Contact column (e-mail is long) gets its own row */
    .footer-grid > div:last-child {
        grid-column: 1 / -1;
    }
}


/* B2. CTA box ------------------------------------------------------------- */

@media (max-width: 768px) {

    .cta-box {
        margin-top: 0;
        padding: 1.35rem 1.15rem;
        border-radius: var(--radius-md);
    }

    .cta-box .hero-actions {
        margin-bottom: 0;
    }
}


/* B3. Chatbot --------------------------------------------------------------
   chatbot.js shows/hides the window with an inline style="display:…".
   On phones the window becomes a panel that fills the width of the screen,
   sitting just above the round chat button. */

/* The close ✕ is injected by chatbot.js without its .chatbot-close class,
   so it showed as a plain grey browser button. Style it by position. */
.chatbot-header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

.chatbot-header button:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 600px) {

    .bpic-chatbot {
        right: 14px;
        bottom: 14px;
    }

    .chatbot-toggle {
        width: 54px;
        height: 54px;
        font-size: 24px;
    }

    .chatbot-window {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 78px;
        width: auto;
        height: min(72vh, 560px);
        margin: 0;
        border-radius: 16px;
    }

    .chatbot-header {
        padding: 14px 16px;
    }

    /* Window height minus the header and the input bar */
    .chatbot-body {
        height: calc(100% - 128px);
    }

    .chatbot-input input {
        font-size: 16px;
        min-height: 0;
    }

    .chatbot-input button {
        width: var(--m-tap);
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .chatbot-window {
        height: calc(100vh - 100px);
    }
}


/* B4. Terms / Privacy modals -----------------------------------------------
   On phones the modal slides up from the bottom like an app sheet. */

@media (max-width: 600px) {

    .terms-modal-overlay {
        align-items: flex-end;
        padding: 0.5rem;
    }

    .terms-modal-card {
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 18px;
    }

    .terms-modal-header,
    .terms-modal-body,
    .terms-modal-footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .terms-modal-header h2 {
        font-size: 1.15rem;
    }

    .terms-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .terms-checkbox-label {
        align-items: flex-start;
        font-size: 0.88rem;
    }

    .terms-agree-btn {
        width: 100%;
        min-height: var(--m-tap);
    }
}


/* =========================================================================
   PART C — PAGE BY PAGE
   ========================================================================= */

/* C1. HOME (index.html) ---------------------------------------------------- */

@media (max-width: 768px) {

    /* Hero: text first, stats card underneath */
    .hero {
        padding: 1.25rem 0 0.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0.5rem 0;
    }

    .hero-copy h1 {
        font-size: clamp(1.75rem, 8vw, 2.4rem);
        line-height: 1.15;
    }

    .hero-copy p {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-actions {
        margin-bottom: 0;
    }

    .hero-visual {
        padding: 0.9rem;
        gap: 0.9rem;
        border-radius: var(--radius-md);
    }

    .engagement-card {
        padding: 1rem;
    }

    .hero-card {
        padding: 0.4rem 1rem;
    }

    /* Platform overview: 2 × 2 grid */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.4rem;
    }

    .stat-card .label {
        font-size: 0.88rem;
    }

    /* State chips: wrap onto new lines (no sideways scrolling).
       Slightly smaller chips so more fit on each line. */
    .state-row {
        gap: 0.5rem;
    }

    .state-chip {
        min-height: 40px;
        padding: 0.5rem 0.85rem;
        font-size: 0.92rem;
    }

    .Territory-row {
        gap: 0.5rem;
    }

    /* Featured + upcoming panels stacked */
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .panel-card {
        border-radius: var(--radius-md);
    }

    .panel-card .section-header {
        align-items: center;
    }

    .feature-grid {
        gap: 0.75rem;
    }

    .feature-card h4 {
        margin: 0.4rem 0 0.2rem;
    }
}

/* Mid-size phones / small tablets: upcoming capabilities in 2 columns */
@media (min-width: 481px) and (max-width: 768px) {
    .showcase-grid .panel-card:last-child .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 360px) {
    .stat-card .value {
        font-size: 1.2rem;
    }

    .metric-number {
        font-size: 1.25rem;
    }
}


/* C2. BROWSE TENDERS (tenders.html) ---------------------------------------- */

@media (max-width: 768px) {

    .page-main {
        display: block;
    }

    /* --- Filters button ---
       Same colour and pill shape as the "Apply Filters" button
       (.btn-primary in styles.css). Only as wide as its text. */
    .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: auto;
        min-height: var(--m-tap);
        margin: 0.25rem 0 1.25rem;
        padding: 0.7rem 1.4rem;
        border: 1px solid rgba(255, 233, 175, 0.8);
        border-radius: 999px;
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 45%),
            linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
        background-blend-mode: overlay, normal;
        color: #3a2405;
        font-size: 1rem;
        font-weight: 700;
        box-shadow:
            0 8px 20px rgba(244, 197, 66, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        cursor: pointer;
        /* Must stay BELOW the sticky header (z-index 50) when scrolling */
        position: relative;
        z-index: 1;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .mobile-filter-btn:active {
        transform: scale(0.97);
    }

    /* --- Filter panel: hidden until the button is tapped --- */
    .page-main > .filter-card {
        display: none;
        margin-bottom: 1.5rem;
        padding: 1.1rem;
        border-radius: 20px;
    }

    .page-main > .filter-card.mobile-filter-open {
        display: block;
    }

    .filter-card form {
        gap: 0.8rem;
    }

    .filter-card input,
    .filter-card select {
        font-size: 16px;
        padding: 0.6rem 0.8rem;
    }

    /* Apply + Clear: same height and text size */
    .filter-card .filter-actions .btn {
        min-height: var(--m-tap);
        margin-top: 0;
        font-size: 1rem;
    }

    /* When the page scrolls to the tender list after "Apply Filters",
       stop a little below the sticky header so the heading is visible */
    .page-main > section {
        scroll-margin-top: 80px;
    }

    /* --- "Tender list" heading + Table/Cards switch --- */
    .page-main > section > .section-header {
        align-items: center;
        justify-content: space-between;
    }

    .toggle-group {
        flex-shrink: 0;
    }

    .toggle-btn {
        min-height: 40px;
        padding: 0.45rem 0.9rem;
    }

    [data-filter-result] {
        margin-bottom: 0.75rem;
    }

    /* --- Table view ---
       The table has 8 columns, so it scrolls sideways inside its box.
       The tender title column stays pinned on the left while scrolling. */
    .table-wrapper {
        border-radius: var(--radius-sm);
        -webkit-overflow-scrolling: touch;
    }

    .tender-table th,
    .tender-table td {
        padding: 0.75rem 0.7rem;
        font-size: 0.88rem;
    }

    .tender-table th:first-child,
    .tender-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        min-width: 170px;
        max-width: 210px;
        white-space: normal;
        background: #fbfcfe;
        box-shadow: 1px 0 0 var(--border);
    }

    .tender-table th:first-child {
        background: #f3f5f8;
    }

    .tender-table .btn {
        min-height: 38px;
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }

    /* --- Card view --- */
    .tender-list {
        gap: 0.85rem;
    }

    .tender-card {
        padding: 1rem 1.05rem;
        border-radius: var(--radius-md);
    }

    .tender-card .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    /* Tender title inside the card */
    .tender-card .meta > span:first-child {
        color: var(--text);
        font-weight: 700;
        font-size: 1rem;
        line-height: 1.35;
    }

    .tender-card p {
        margin: 0.3rem 0;
        font-size: 0.92rem;
        color: var(--muted);
    }

    .tender-card p strong {
        color: var(--text);
    }

    .tender-card .actions .btn {
        width: 100%;
    }

    /* --- Previous / Page 1 / Next --- */
    .load-more-wrap {
        gap: 0.6rem;
        margin-top: 1.25rem;
    }

    .load-more-wrap .btn {
        flex: 1;
        max-width: 160px;
    }

    [data-page-info] {
        flex-shrink: 0;
        font-weight: 600;
        font-size: 0.92rem;
    }

    .empty-state {
        padding: 1.25rem;
        line-height: 1.55;
    }
}

/* Tablets: the filter sidebar is only ~240px wide, so stack
   "Apply Filters" and "Clear Filters" instead of squeezing them */
@media (min-width: 769px) and (max-width: 1080px) {
    .filter-card .filter-actions {
        flex-direction: column;
    }
}

@media (max-width: 380px) {

    /* Heading and switch no longer fit on one line: stack them */
    .page-main > section > .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

}


/* C3. TENDER DETAILS (tender-details.html) ----------------------------------
   tender-details.css already stacks the grids. These rules tune spacing
   and make the main actions easy to reach with a thumb. */

/* All screen sizes: in tender-details.css the rule ".timeline-item span"
   (meant for the small grey labels) also hits the date <span>s inside
   <strong>, so date ranges showed tiny, uppercase and one per line.
   Put those dates back to normal text on one line. */
.timeline-item strong span {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    text-transform: none;
    color: inherit;
}

/* Keep each date in one piece, so a long range breaks at the arrow */
.timeline-item strong span[data-field] {
    white-space: nowrap;
}

@media (max-width: 768px) {

    .tender-detail-page {
        padding-top: 0;
    }

    .tender-detail-hero {
        margin-top: 1rem;
    }

    .tender-detail-hero h1 {
        font-size: clamp(1.45rem, 6.5vw, 2rem);
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    .detail-hero-top {
        gap: 0.75rem;
    }

    .detail-back-link {
        align-self: flex-start;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
    }

    /* Closes / Tender Value / EMD: "Closes" gets the full row,
       the two amounts share the row below */
    .detail-stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 1.25rem;
    }

    .detail-stat:first-child {
        grid-column: 1 / -1;
    }

    .detail-stat {
        padding: 0.85rem 0.95rem;
    }

    .detail-stat strong {
        font-size: 1.05rem;
    }

    .detail-reference-row {
        margin-top: 1.25rem;
        padding-top: 1rem;
        gap: 0.75rem;
    }

    .detail-section-heading {
        margin-bottom: 1rem;
    }

    .timeline-item {
        padding: 0.85rem;
    }

    .detail-long-text {
        padding: 1rem;
    }

    .detail-long-text p {
        line-height: 1.65;
    }

    .detail-source-card {
        gap: 1.25rem;
    }

    .detail-source-button {
        justify-content: center;
    }

    .detail-meta-footer {
        gap: 0.35rem;
        padding: 0 0.25rem;
    }
}

@media (max-width: 360px) {
    .detail-stat-strip {
        grid-template-columns: 1fr;
    }
}


/* C4. SERVICES (services.html) ---------------------------------------------- */

@media (max-width: 768px) {

    .service-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .service-card .section-title {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    .service-card ul {
        margin-top: 0.5rem;
        line-height: 1.55;
    }

    .service-card li {
        padding: 0.15rem 0;
    }
}

/* Large phones / small tablets: two service cards per row still fit */
@media (min-width: 601px) and (max-width: 768px) {
    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* C5. ABOUT (about.html) -----------------------------------------------------
   about.html uses inline style="" attributes for sizes and spacing.
   Inline styles always win over this file, so the few overrides below
   need !important. Everything else here is normal. */

@media (max-width: 768px) {

    .about-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        margin-bottom: 2rem !important;
    }

    .about-grid .info-card {
        padding: 1.15rem !important;
    }

    .page-intro[style] {
        margin-bottom: 1.25rem !important;
    }

    .page-intro[style] h1 {
        font-size: clamp(1.6rem, 7vw, 2rem) !important;
    }

    .page-intro[style] .lead {
        font-size: 1rem !important;
    }

    /* Capabilities grid */
    main .feature-grid[style] {
        gap: 0.75rem !important;
        margin-bottom: 2rem !important;
    }

    main .feature-grid[style] .feature-card {
        padding: 1.1rem !important;
    }
}

/* Very small phones: the inline minmax(240px) would leave one card
   squeezed; force a single column */
@media (max-width: 360px) {
    main .feature-grid[style] {
        grid-template-columns: 1fr !important;
    }
}


/* C6. CONTACT (contact.html) -------------------------------------------------
   Was 2 columns on every screen, which pushed the form off the right edge. */

@media (max-width: 768px) {

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .contact-card .lead {
        font-size: 0.98rem;
        overflow-wrap: anywhere;
        margin-top: 0.35rem;
    }

    .contact-card form .btn {
        width: 100%;
    }
}


/* C7. LOGIN / REGISTER (login.html, register.html) ------------------------- */

@media (max-width: 768px) {

    .auth-shell {
        min-height: auto;
        padding: 1.5rem 0 2.5rem;
        place-items: start center;
    }

    .auth-card {
        padding: 1.35rem 1.15rem;
        border-radius: var(--radius-md);
    }

    .auth-card h1 {
        font-size: clamp(1.5rem, 6.5vw, 1.9rem);
    }

    .auth-card .btn {
        width: 100%;
    }

    /* "BPIC Tender Platform — Beta Version 3" under the card */
    .auth-shell > p {
        margin-top: 1.25rem;
        text-align: center;
        font-size: 0.85rem;
        color: var(--muted);
    }
}
