/* Styles moved from login.html - visual and responsive rules for the login page */

/* Base styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* base unit used to scale logo and tagline together */
    --login-logo-base: clamp(18px, 2.8vw, 36px);
    /* max width for logo+tagline block on desktop; mobile overrides below */
    --login-content-max: 520px;
}

.container {
    display: flex;
    min-height: calc(var(--vh, 1vh) * 100);
    align-items: stretch;
    width: 100%;
    gap: 1rem;
}

/* Left visual panel */
.image {
    position: relative;
    flex: 0 0 clamp(220px, 35%, 622px);
    max-width: 622px;
    min-width: 180px;
    min-height: calc(var(--vh, 1vh) * 100);
    background-image: url('../Images/leftpanellogin.svg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    max-width: var(--login-content-max);
}

/* Ensure .logo and .tagline occupy the same lateral width inside the overlay */
.overlay-content .logo {
    width: 100%;
    max-width: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.overlay-content .logo img {
    /* let the img scale within the container but with an upper limit */
    max-width: 100%;
    width: auto;
    height: auto;
    touch-action: manipulation;
    display: block;
}

.tagline.text {
    /* Desktop: make the text slightly smaller so it visually matches the logo */
    font-size: calc(var(--login-logo-base) * 0.65);
    font-family: "Noto Sans", sans-serif;
    line-height: 1.2;
    max-width: inherit;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin-top: 12px;
}

.right-panel {
    flex: 1;
    background-color: #fefefe;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(16px, 3vw, 40px);
    box-sizing: border-box;
    min-width: 260px;
    /* anchor for absolutely positioned children inside the panel */
    position: relative;
}

.login-box button,
.login-button {

    /* Constrain login card on desktop to avoid overly wide fields */
    .login-box {
        position: relative;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }

    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    box-sizing: border-box;
    line-height: 1;
    background: linear-gradient(180deg, #3b7bff 0%, #2a63f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 6px 14px rgba(42, 99, 246, 0.14);
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.2px;
    text-align: center;
    vertical-align: middle;
    transition: transform .12s ease,
    box-shadow .12s ease,
    filter .12s ease;
}

.login-button:active,
.login-box button:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(42, 99, 246, 0.10);
}

.login-button:focus,
.login-box button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 123, 255, 0.12);
}

.login-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.login-box input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    display: block;
}

.cardLogin {
    width: min(300px, 90%);
    max-width: 100%;
    height: 45px;
    background-color: #ffffff;
    border-radius: 44.48px;
    border: 2px solid #ececec;
    box-sizing: border-box;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
}

.cardLogin img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.cardLogin span {
    font-weight: bold;
    font-family: inherit;
    font-size: 1rem;
}

.local-time {
    position: absolute;
    right: 16px;
    bottom: 24px;
    font-size: clamp(12px, 1.6vw, 14px);
    color: #666;
    white-space: nowrap;
}

/* add a subtle separator after the local time */
.local-time::after {
    content: '';
    display: block;
    height: 1px;
    margin-top: 6px;
    background: #e3e3e3;
    width: 120px;
}

.textIconsLogin {
    color: #000000;
    font-size: 12px;
    font-family: 'Rubik', Arial, sans-serif;
    font-weight: 500;
    line-height: 16px;
}

/* Stacked modifier (JS adds class 'stacked' to container) */
.stacked .container,
.container.stacked {
    flex-direction: column;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .image {
        width: 100%;
        min-width: 0;
        height: 300px;
        min-height: 300px;
    }

    .overlay-content {
        position: static;
        transform: none;
        padding: 10px;
    }

    .tagline.text {
        font-size: calc(var(--login-logo-base) * 0.65);
        line-height: 1.3;
        max-width: 90%;
        white-space: normal;
    }

    .overlay-content .logo img {
        width: calc(var(--login-logo-base) * 10);
        margin-bottom: 10px;
    }

    .right-panel {
        padding: 18px;
    }

    /* allow the overlay to fill more of the mobile width */
    :root {
        --login-content-max: 95%;
    }

    /* ensure stacked mobile logo matches the desktop tagline proportion (use a larger base) */
    .stacked .logo-mobile {
        /* keep at least same size as desktop tagline — increase to 1x base for readability */
        font-size: calc(var(--login-logo-base) * 1) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .image {
        flex: 0 0 45%;
    }

    .login-box {
        max-width: 420px;
    }
}

/* iPad Air 5 / tablet portrait - stack provider buttons vertically and center text */
@media (min-width: 768px) and (max-width: 834px) {
    .providers {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .providers .cardLogin {
        width: 100% !important;
        max-width: 420px !important;
        display: flex !important;
        justify-content: center !important;
    }

    .providers .cardLogin span {
        font-size: 0.98rem !important;
        text-align: center !important;
    }
}

@media (max-width: 360px) {

    /* Desktop defaults: allow provider buttons to wrap on narrower desktops */
    @media (min-width: 769px) {
        .providers {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
            /* allow wrap to avoid overflow in Opera */
        }

        .cardLogin {
            width: 300px;
            max-width: 100%;
        }
    }

    .tagline.text {
        font-size: calc(var(--login-logo-base) * 0.65);
    }

    .overlay-content .logo img {
        width: calc(var(--login-logo-base) * 10);
    }

    .login-box {
        padding: 0 8px;
    }
}

/* Compact/stac ked mobile overrides (scoped under .stacked) */
.stacked .image {
    min-height: 180px !important;
    height: auto !important;
    background-position: center center !important;
}

.stacked .right-panel {
    width: 100% !important;
    padding: 14px !important;
    align-items: stretch !important;
}

.stacked .login-box {
    width: 100% !important;
    max-width: 420px !important;
    margin: 6px auto !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    max-height: calc(var(--vh, 1vh) * 72) !important;
    overflow-y: auto !important;
}

.stacked .overlay-content {
    position: static !important;
    transform: none !important;
    padding: 8px !important;
    text-align: center !important;
}

.stacked .login-button,
.stacked .login-box input {
    font-size: 16px !important;
    min-height: 48px !important;
    padding: 12px !important;
}

/* Hide the decorative left image on mobile when stacked and surface a mobile logo box */
.stacked .image {
    display: none !important;
}

.logo-mobile {
    display: none;
}

/* Consolidated stacked mobile logo block: make background edge-to-edge and scale logo larger than text */
.stacked .logo-mobile {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    /* use full container width (not 100vw) to avoid creating horizontal scrollbars */
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 22px 12px !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background-image: url('../Images/leftpanellogin.svg');
    background-position: top center !important;
    /* slight overscan to avoid showing white side edges on small devices */
    background-size: 104% auto !important;
    background-repeat: no-repeat !important;
    /* increase container font-size so the logo and tagline are readable on mobile */
    font-size: calc(var(--login-logo-base) * 1.2) !important;
}

.stacked .logo-mobile img {
    /* responsive: allow width to auto-size, cap height to avoid vertical scroll and cap width to prevent horizontal scroll */
    width: auto !important;
    max-width: 100% !important;
    max-height: 36vh !important;
    height: auto !important;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.04));
}

.tagline-mobile {
    color: #fff !important;
    /* text size matches container font-size (1em) which we've increased above) */
    font-size: 1em !important;
    /* equal to the logo img size */
    margin-top: 8px !important;
    opacity: 0.95 !important;
    text-align: center !important;
}

.stacked .signup {
    text-align: center;
    margin-bottom: 6px;
}

.stacked .login-box label {
    margin-bottom: 4px !important;
    font-size: 0.95rem !important;
}

.stacked .cardLogin {
    width: 100% !important;
    max-width: 420px !important;
    margin: 8px auto !important;
    justify-content: flex-start !important;
}

.stacked .cardLogin span {
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.stacked .cardLogin img {
    width: 18px !important;
    height: 18px !important;
    margin-right: 8px !important;
}

.stacked .cardLogin {
    padding: 10px 12px !important;
    align-items: center !important;
}

/* Providers stacked vertically */
.stacked .providers {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    align-items: center !important;
    margin-top: 6px !important;
}

/* Mobile input wrapper to reduce lateral size without affecting desktop
   Applied by JS on very small screens via the 'inputFieldMobile' class */
.inputFieldMobile {
    width: calc(100% - 48px);
    max-width: 360px;
    margin: 0 auto;
    padding: 0 6px;
    box-sizing: border-box;
}

.stacked .inputFieldMobile input {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
}

/* Consolidated mobile/stacked rules (single authoritative block) */
@media (max-width: 480px) {

    /* avoid horizontal scroll globally on very small screens */
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0;
        padding: 0;
    }

    .container {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* centralize stacked layout and ensure it fills the viewport vertically */
    .stacked,
    .stacked .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        min-height: calc(var(--vh, 1vh) * 100) !important;
        gap: 0 !important;
    }

    /* login-box tweaks for mobile */
    .stacked .login-box {
        width: 100% !important;
        max-width: 360px !important;
        margin: 6px auto !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Show the mobile logo block as a full-width band that is centered and avoids scrollbars */
    .stacked .logo-mobile {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 18px 12px !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
        background-image: url('../Images/leftpanellogin.svg') !important;
        background-position: top center !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
        /* Make the mobile text equal to the desktop tagline size (user requested same proportion)
           and allow the logo to scale relative to that text */
        font-size: calc(var(--login-logo-base) * 1) !important;
        height: auto !important;
        min-height: 88px !important;
    }

    /* Make the logo image visually larger and proportional to the tagline */
    .stacked .logo-mobile img {
        /* mobile within narrow viewports: allow width auto but cap height so the band never forces page scroll */
        width: auto !important;
        max-width: 92% !important;
        max-height: 36vh !important;
        height: auto !important;
        filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.04));
    }

    .tagline-mobile {
        color: #fff !important;
        font-size: 1em !important;
        margin-top: 8px !important;
        text-align: center !important;
    }

    /* Center provider button text on very small screens */
    .stacked .providers .cardLogin span,
    .stacked .providers .cardLogin {
        text-align: center !important;
    }

    /* Slightly reduce provider button font-size on very small screens to keep text inside the pill */
    .stacked .providers .cardLogin span {
        font-size: 0.95rem !important;
        display: block !important;
        width: 100% !important;
    }

    /* ensure providers, inputs and cards never overflow on tiny screens */
    .stacked .providers .cardLogin,
    .stacked .login-box .inputField,
    .stacked .login-box .inputFieldMobile,
    .stacked .providers .cardLogin span {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ensure local-time moves out of the way */
    .stacked .local-time {
        position: static !important;
        margin-top: 12px !important;
        text-align: center !important;
    }
}

/* Browser-specific small fixes for Edge where rendering differs */
.edge-mobile-fix html,
.edge-mobile-fix body,
.edge-mobile-fix .container,
.edge-mobile-fix .stacked {
    width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.edge-mobile-fix .stacked .login-box {
    padding-left: 6px !important;
    padding-right: 6px !important;
    max-width: 300px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.edge-mobile-fix .stacked .logo-mobile {
    background-position: top center !important;
    /* reduce vertical padding on Edge so the logo + background fit the viewport without scrollbars */
    padding-top: calc(var(--login-logo-base) * 0.6) !important;
    padding-bottom: calc(var(--login-logo-base) * 0.4) !important;
    min-height: auto !important;
}

.edge-mobile-fix .stacked .logo-mobile img {
    /* Edge-specific: allow adaptive width and cap height to avoid scrollbars */
    width: auto !important;
    max-width: 72% !important;
    max-height: 32vh !important;
    height: auto !important;
}

/* small layout tweaks moved from inline styles */
.login-box h2 {
    margin-top: 12px;
}

/* Final authoritative mobile stacked sizing: enforce proportional logo <-> tagline relationship
   Use em-based sizing so the img scales relative to container font-size (which is tied to --login-logo-base).
   This block is intentionally last to override earlier duplicates. */
.stacked .logo-mobile {
    /* full-bleed background, centered, no scroll */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px 12px !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background-image: url('../Images/leftpanellogin.svg') !important;
    background-position: top center !important;
    /* final authoritative overscan for mobile header band */
    background-size: 104% auto !important;
    background-repeat: no-repeat !important;
    /* Make container font-size equal to the base so tagline and desktop match proportionally */
    font-size: calc(var(--login-logo-base) * 1) !important;
}

.stacked .logo-mobile img {
    /* Final: ensure image never exceeds a portion of viewport height to avoid vertical scrollbar
       and allow width to adapt so it also fits horizontally across browsers (Chrome, Edge, Firefox, Opera). */
    width: auto !important;
    max-width: 100% !important;
    max-height: 36vh !important;
    height: auto !important;
}

.stacked .tagline-mobile {
    font-size: 1em !important;
    /* matches container font-size */
}

.imageLogo2 {
    top: 39px;
    left: 63px;
    width: 249px;
    height: 53px;
    border-radius: 8px;
    background-image: url(./Images/VMDLogo2.svg);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}



#app-version {
    position: fixed;
    right: 16px;
    bottom: 16px;
    font-size: 12px;
    color: #8a8a8a;
    text-align: right;
    z-index: 1000;
}

/* when stacked on mobile, make the separator span full width */
.stacked .local-time {
    position: static !important;
    margin-top: 12px !important;
    text-align: center !important;
}

.stacked .local-time::after {
    width: 100% !important;
}

.leftboardMiddle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../Images/leftpanellogin2Meio.svg');
    background-position: center 45%;
    /* shift slightly to align wave mid section */
    background-size: 120% auto;
    /* slight zoom for dynamic feel */
    background-repeat: no-repeat;
    opacity: .85;
    /* let fundo show */
    filter: saturate(115%) contrast(105%);
    animation: waveDrift 18s linear infinite alternate;
    /* subtle movement */
}

@keyframes waveDrift {
    from {
        background-position: center 48%;
    }

    to {
        background-position: center 42%;
    }
}

.leftboardArround {
    position: relative;
    flex: 0 0 clamp(280px, 36%, 640px);
    max-width: 640px;
    min-width: 240px;
    min-height: calc(var(--vh, 1vh) * 100);
    background-image: url('../Images/leftpanellogin2Fundo.svg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* clip middle layer overflow */
}

.leftboardArround::after {
    /* subtle gradient vignette for depth */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    mix-blend-mode: overlay;
}

.leftboardArround .overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    padding: 16px 20px;
    backdrop-filter: none;
}

.leftboardArround .overlay-content .logo img {
    max-width: 548px;
    width: 100%;
}

.leftboardArround .overlay-content .tagline.text {
    font-size: clamp(23.04px, 1.512vw, 31.68px);
    margin-top: 14px;
    letter-spacing: .3px;
}

@media (max-width: 1200px) {
    .leftboardArround .overlay-content .logo img {
        max-width: 490px;
    }
}

@media (max-width: 992px) {
    .leftboardArround {
        flex: 0 0 48%;
    }
}

@media (max-width: 840px) {
    .leftboardArround {
        flex: 0 0 50%;
    }
}

@media (max-width: 768px) {
    .leftboardArround {
        display: none !important;
    }
}
