﻿/* ==========================================================================
   login-mobile.css  —  responsive / mobile overrides for the VPP login page
   Load AFTER login.css (and base.css). Safe to remove: desktop is untouched.
   Breakpoints: <=991 tablet, <=767 large phone, <=575 phone, <=375 small phone
   ========================================================================== */

html {
    -webkit-text-size-adjust: 100%;
}

.btn, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ---------- Tablet & below ---------- */
@media (max-width: 991.98px) {
    html, body.vpp {
        overflow-x: hidden;
    }

    /* Header: brand + actions on row 1, scrollable nav on row 2 */
    .vpp-header .inner {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px 12px;
        height: auto !important;
        padding: 10px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)) !important;
    }

    .vpp-header .brand {
        order: 1;
        flex: 0 0 auto;
    }

        .vpp-header .brand img {
            height: 32px;
            width: auto;
            max-width: 150px;
        }

    .vpp-actions {
        order: 2;
        display: flex;
        gap: 8px;
        margin-left: auto;
    }

        .vpp-actions .btn {
            padding: 8px 14px;
            font-size: 14px;
            white-space: nowrap;
        }

    .vpp-nav {
        order: 3;
        flex: 1 0 100%;
        display: flex !important;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-top: 1px solid rgba(0, 0, 0, .08);
        margin: 0 -4px;
        padding-top: 4px;
    }

        .vpp-nav::-webkit-scrollbar {
            display: none;
        }

        .vpp-nav .nav-link {
            flex: 0 0 auto;
            padding: 10px 14px;
            white-space: nowrap;
        }

    /* Hero: single column, login card FIRST so it is above the fold */
    .hero {
        padding: 24px 0 32px !important;
    }

        .hero .inner {
            display: grid !important;
            grid-template-columns: minmax(0, 1fr) !important;
            gap: 24px !important;
            padding: 0 max(16px, env(safe-area-inset-left)) !important;
        }

            .hero .inner > div {
                min-width: 0;
            }

        .hero .card-login {
            order: -1;
            width: 100%;
            max-width: 520px;
            margin: 0 auto;
        }

        .hero h1 {
            font-size: clamp(28px, 7vw, 40px);
            line-height: 1.15;
        }

        .hero .lead {
            font-size: 15px;
            line-height: 1.55;
        }

        .hero .checks li {
            font-size: 14px;
        }

    .benefits {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .benefit {
        min-width: 0;
    }

        .benefit img {
            flex: 0 0 auto;
            width: 40px;
            height: 40px;
            object-fit: contain;
        }

    /* Page body */
    .wrap {
        padding-left: max(16px, env(safe-area-inset-left)) !important;
        padding-right: max(16px, env(safe-area-inset-right)) !important;
    }

    .stats {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .stat {
        min-width: 0;
        padding: 14px !important;
        gap: 12px;
    }

        .stat img {
            width: 40px;
            height: 40px;
            object-fit: contain;
            flex: 0 0 auto;
        }

        .stat .num {
            font-size: 24px;
        }

        .stat .lbl {
            font-size: 12px;
            line-height: 1.3;
        }

    .section {
        margin-top: 28px;
    }

        .section h3 {
            font-size: 20px;
        }

    .countries {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .events {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    .event {
        display: flex !important;
        flex-direction: column;
        min-width: 0;
    }

        .event img {
            width: 100% !important;
            height: auto !important;
            max-height: 220px;
            object-fit: cover;
        }

        .event h5 {
            font-size: 16px;
            line-height: 1.35;
        }

        .event ul li {
            word-break: break-word;
        }

    .video-card {
        display: block;
        position: relative;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 16 / 9;
        background-size: cover !important;
        background-position: center !important;
    }

        .video-card .play {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

    .vpp-footer {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) !important;
        text-align: center;
        font-size: 12px;
    }
}

/* ---------- Large phone ---------- */
@media (max-width: 767.98px) {
    .countries {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .vmodal .box {
        width: calc(100vw - 24px) !important;
        max-width: 900px;
    }

    .vmodal iframe {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    .vmodal .x {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ---------- Phone ---------- */
@media (max-width: 575.98px) {
    /* The welcome card already has Login / Join buttons, so drop the duplicates in the header */
    .vpp-actions {
        display: none !important;
    }

    .vpp-nav {
        margin: 0;
    }

        .vpp-nav .nav-link {
            flex: 1 1 0;
            text-align: center;
            padding: 10px 6px;
        }

    .hero {
        padding: 16px 0 24px !important;
    }

    .benefits {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Login card */
    .card-login {
        padding: 20px 16px !important;
        border-radius: 14px;
    }

        .card-login h2 {
            font-size: 22px;
        }

        .card-login p {
            font-size: 14px;
        }

    .login-box form.p10 {
        padding: 0 !important;
    }

    .logintitle img {
        width: 28px;
        height: 28px;
        margin-right: 8px;
        vertical-align: middle;
    }

    .logintitle {
        font-size: 18px;
    }

    /* Inputs: 16px stops iOS Safari zooming on focus; 46px+ tap targets */
    .form-control, .form-control-sm {
        font-size: 16px !important;
        height: 46px !important;
        padding: 8px 12px;
    }

    .btn-md, .card-login .btn {
        min-height: 46px;
        font-size: 15px;
    }

    .card-login .mb10 .btn {
        display: block;
        width: 100%;
        margin: 0 0 10px !important;
    }

    .login-box label {
        font-size: 14px;
    }

    .login-box .form-group > .p10 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0 0 !important;
    }

        .login-box .form-group > .p10 small {
            font-size: 13px;
        }

        .login-box .form-group > .p10 input[type=checkbox] {
            width: 18px;
            height: 18px;
            vertical-align: middle;
        }

    /* Cancel / OK buttons: equal width, side by side */
    .actions {
        display: flex;
        gap: 10px;
    }

        .actions .btn {
            flex: 1 1 0;
            width: auto !important;
            margin: 0 !important;
        }

    /* OTP boxes shrink to fit instead of overflowing */
    #divOTP .c1 {
        flex: 1 1 0;
        min-width: 0;
        max-width: 48px;
        width: auto !important;
        margin: 0 3px !important;
        height: 48px !important;
        padding: 0 !important;
        font-size: 20px !important;
    }

    /* Password-rules popup must stay on screen */
    .pr-viewport {
        max-width: calc(100vw - 32px) !important;
    }

    /* Stats / brochure / events */
    .stat {
        flex-direction: row;
        padding: 12px !important;
    }

        .stat .num {
            font-size: 20px;
        }

    .countries {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .country {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        text-align: left;
    }

        .country img {
            width: 32px;
            height: auto;
            flex: 0 0 auto;
        }

        .country b {
            flex: 1 1 auto;
        }

        .country a {
            margin-left: auto;
            white-space: nowrap;
            padding: 8px 12px;
        }

    .events {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ---------- Small phone: shrink the fixed-width (304px) reCAPTCHA ---------- */
@media (max-width: 375px) {
    .hero .inner, .wrap {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    #rcaptcha {
        transform: scale(.9);
        transform-origin: 0 0;
        margin-bottom: -8px;
    }

    .hero h1 {
        font-size: 26px;
    }
}

@media (max-width: 340px) {
    #rcaptcha {
        transform: scale(.78);
        margin-bottom: -17px;
    }
}

/* ---------- Landscape phones: avoid a giant hero ---------- */
@media (max-height: 480px) and (orientation: landscape) {
    .hero {
        padding: 12px 0 !important;
    }

        .hero .inner {
            gap: 16px !important;
        }
}
