﻿/* =============================================================================
   LoginMobile.css
   Styles for the Empower mobile login page presentation.

   Loaded conditionally via <link> in Login.razor only when a phone is detected.
   Served from the Resources RCL project (wwwroot/css/).

   Sections:
     1.  Page Foundation        (full-viewport layout, no scroll)
     2.  Seasonal Background    (full-screen image + dark overlay)
     3.  Logo / Brand Area
     4.  Login Card             (frosted white panel)
     5.  Form Inputs            (large touch targets, WCAG 2.5.5)
     6.  Buttons                (login, show/hide password)
     7.  Links & Divider
     8.  Error Banner
     9.  Bottom Links           (Privacy, User Guide)
    10.  Accessibility           (focus rings, reduced motion)
   ============================================================================= */


/* =============================================================================
   1. PAGE FOUNDATION
   Force full-viewport height so the seasonal background fills the screen.
   Overrides any Bootstrap container padding on mobile.
   ============================================================================= */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}



/* The outermost wrapper — fills viewport, stacks logo + card vertically */
.mobile-login-page {
    min-height: 100dvh; /* dvh accounts for mobile browser chrome */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top, 16px) 20px env(safe-area-inset-bottom, 16px) 20px;
    position: relative;
    overflow: hidden;
}


/* =============================================================================
   2. SEASONAL BACKGROUND
   Full-screen image behind everything, darkened for text contrast.
   Same seasonal images used on the desktop login.
   ============================================================================= */

.mobile-login-bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

    /* Dark overlay improves text/input contrast over any seasonal image */
    .mobile-login-bg::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(10, 35, 60, 0.45);
    }

    /* Portrait phones: small portrait crops */
    .mobile-login-bg.season-spring {
        background-image: url('../images/Login/spring-sm.webp');
    }

    .mobile-login-bg.season-summer {
        background-image: url('../images/Login/summer-sm.webp');
    }

    .mobile-login-bg.season-fall {
        background-image: url('../images/Login/fall-sm.webp');
    }

    .mobile-login-bg.season-winter {
        background-image: url('../images/Login/winter-sm.webp');
    }

/* Landscape (tablets, rotated phones): portrait crop would blur, use desktop images */
@media (orientation: landscape) {
    .mobile-login-bg.season-spring {
        background-image: url('../images/Login/spring.webp');
    }

    .mobile-login-bg.season-summer {
        background-image: url('../images/Login/summer.webp');
    }

    .mobile-login-bg.season-fall {
        background-image: url('../images/Login/fall.webp');
    }

    .mobile-login-bg.season-winter {
        background-image: url('../images/Login/winter.webp');
    }
}



/* =============================================================================
   3. LOGO / BRAND AREA
   Empower "E" badge + app name + city subtitle above the card.
   ============================================================================= */

.mobile-login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}

.mobile-login-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

    .mobile-login-card-header img {
        margin-top: 4px;
        flex-shrink: 0;
    }



/*.mobile-login-logo-badge {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;*/
    /* Subtle shadow so badge lifts off the background image */
    /*box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    line-height: 0;*/ /* prevents gap under img */
/*}*/

/*.mobile-login-logo-badge {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    line-height: 0;
    padding: 12px 16px;
    background: white;
}
*/

.mobile-login-card-logo {
    text-align: center;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.mobile-login-logo-badge {
    margin-bottom: 10px;
    line-height: 0;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.6));
}

.mobile-login-app-name {
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.mobile-login-city-name {
    font-size: 13px;
    color: #ffffff; /* full white; 0.85 alpha lost contrast on bright seasons */
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); /* WCAG 1.4.3: keeps text legible over any photo */
    margin-top: 2px;
    text-align: center;
    line-height: 1.4;
}


/* =============================================================================
   4. LOGIN CARD
   Semi-opaque white card — "frosted" effect over the seasonal background.
   Width is capped and centered; border-radius matches mobile app conventions.
   ============================================================================= */

.mobile-login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.97);


    /*background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);*/ /* Safari */

    border-radius: 18px;
    padding: 24px 20px 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.mobile-login-card-title {
    /*font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 16px;*/

    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1a3a5c;
    /* Shift left slightly to visually center against full width, not just remaining space */
    margin-right: 60px;
}


/* =============================================================================
   5. FORM INPUTS
   Minimum 44px height satisfies WCAG 2.5.5 (target size).
   Input group wraps icon + input in a single styled row.
   ============================================================================= */

.mobile-input-group {
    display: flex;
    align-items: center;
    background: #f4f7fb;
    border: 1.5px solid #c8d8ea;
    border-radius: 10px;
    height: 48px; /* WCAG 2.5.5 minimum touch target */
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.15s;
}

    /* Highlight border on focus-within (keyboard and touch) */
    .mobile-input-group:focus-within {
        border-color: #5AABF5;
        outline: none;
    }

    /* Error state — red border when login fails */
    .mobile-input-group.input-error {
        border-color: #d9534f;
    }


.mobile-input-icon {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a8ab5;
    flex-shrink: 0;
}

/* The actual Blazor InputText — transparent, fills remaining width */
.mobile-input-group .form-control {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
    color: #1a2a3a;
    padding: 0;
    padding-left: 8px;
    height: 100%;
    outline: none;
    box-shadow: none;
}

    .mobile-input-group .form-control:focus {
        box-shadow: none;
        border: none;
        background: transparent;
    }

    /* Chrome/Safari autofill background fix (matches .mobile-input-group background) */
    .mobile-input-group .form-control:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 1000px #f4f7fb inset;
        -webkit-text-fill-color: #1a2a3a;
    }


/* Show/hide password toggle button inside the input group */
.mobile-pw-toggle {
    background: none;
    border: none;
    padding: 0 12px;
    color: #3a5a7a; /* was #5a8ab5 (~3.7:1); this passes WCAG 1.4.3 */
    font-size: 13px;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

    .mobile-pw-toggle:focus-visible {
        outline: 2px solid #5AABF5;
        outline-offset: -2px;
    }

/* Caps lock warning */
.mobile-caps-warning {
    font-size: 12px;
    color: #c05000;
    margin-top: -8px;
    margin-bottom: 8px;
}

/* Validation messages */
.mobile-validation {
    font-size: 12px;
    color: #d9534f;
    margin-top: -8px;
    margin-bottom: 8px;
}

/* Caps warning is always in the DOM (live region); collapse it when empty */
#capsWarning:empty {
    margin: 0;
}


/* =============================================================================
   6. REMEMBER ME + FORGOT LINKS ROW
   ============================================================================= */

.mobile-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Touch-friendly checkbox wrapper — 44×44 tap target */
.mobile-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 44px; /* WCAG 2.5.5 */
}

    .mobile-remember input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: #1a6fad;
        cursor: pointer;
        flex-shrink: 0;
    }

.mobile-remember-label {
    font-size: 13px;
    color: #3a5a7a;
    user-select: none;
}

.mobile-forgot-link {
    font-size: 13px;
    color: #1a6fad;
    text-decoration: none;
    white-space: nowrap;
}

    .mobile-forgot-link:hover,
    .mobile-forgot-link:focus-visible {
        text-decoration: underline;
    }



 /* Recovery links below the Log in button: small and quiet but full contrast.
    Prominence is reduced by size, not color (#3a5a7a passes WCAG 1.4.3). */
 .mobile-forgot-row {
     text-align: center;
     font-size: 13px;
     color: #3a5a7a;
     margin: -6px 0 14px; /* tuck under the button's 16px bottom margin */
    
}


 /* Vertical padding enlarges the tap area without shifting the layout */
 .mobile-forgot-row .mobile-forgot-link {
     padding: 6px 2px;
}


/* =============================================================================
   7. BUTTONS
   ============================================================================= */

/* Primary login button */
.mobile-btn-login {
    width: 100%;
    height: 48px; /* WCAG 2.5.5 */
    border-radius: 10px;
    background: #1a6fad;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.15s;
    letter-spacing: 0.2px;
}

    .mobile-btn-login:hover {
        background: #155d94;
    }

    .mobile-btn-login:active {
        background: #0f4a78;
    }

    .mobile-btn-login:focus-visible {
        outline: 3px solid #9CCBFA;
        outline-offset: 2px;
    }


/* =============================================================================
   8. DIVIDER + SIGN UP + LEARN MORE LINKS
   ============================================================================= */

.mobile-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mobile-divider-line {
    flex: 1;
    height: 1px;
    background: #d0dcea;
}

.mobile-divider-text {
    font-size: 12px;
    color: #8a9ab5;
}

.mobile-signup-row {
    text-align: center;
    font-size: 14px;
    color: #3a5a7a;
    margin-bottom: 12px;
}

    .mobile-signup-row a {
        color: #1a6fad;
        font-weight: 600;
        text-decoration: none;
    }

        .mobile-signup-row a:hover,
        .mobile-signup-row a:focus-visible {
            text-decoration: underline;
        }

/* "Learn more about Empower" — subtle, below sign up */
.mobile-learn-more {
    text-align: center;
    font-size: 12px;
}

    .mobile-learn-more a {
        color: #5a8ab5;
        text-decoration: none;
    }

        .mobile-learn-more a:hover,
        .mobile-learn-more a:focus-visible {
            text-decoration: underline;
            color: #1a6fad;
        }


/* =============================================================================
   9. ERROR BANNER
   Shown above the form when login fails.
   ============================================================================= */

.mobile-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fce8e8;
    border: 1px solid #e8b0b0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #7a1a1a;
    margin-bottom: 12px;
}

.mobile-error-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #d9534f;
}


/* =============================================================================
   10. BOTTOM LINKS (Privacy Policy, User Guide)
   Float below the card, over the seasonal image.
   ============================================================================= */

.mobile-bottom-links {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

    .mobile-bottom-links a {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
    }

        .mobile-bottom-links a:hover,
        .mobile-bottom-links a:focus-visible {
            color: #ffffff;
            text-decoration: underline;
        }


/* =============================================================================
   11. ACCESSIBILITY
   ============================================================================= */

/* Skip link for screen readers (visually hidden until focused) */
.mobile-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #1a6fad;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 100;
    transition: top 0.15s;
}

    .mobile-skip-link:focus {
        top: 16px;
    }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mobile-btn-login,
    .mobile-input-group {
        transition: none;
    }
}


/* =============================================================================
   INFO ACCORDION + CAROUSEL
   ============================================================================= */

.mobile-info-accordion {
    margin-top: 12px;
    border-top: 0.5px solid #d0dce8;
    padding-top: 8px;
}

.mobile-info-toggle {
    width: 100%;
    background: none;
    border: 0.5px solid #1a6fad;
    border-radius: 20px;
    color: #1a6fad;
    font-size: 13px;
    padding: 6px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .mobile-info-toggle:focus-visible {
        outline: 3px solid #9CCBFA;
        outline-offset: 2px;
    }

.mobile-info-chevron {
    transition: transform 0.25s ease;
    display: inline-block;
}

.mobile-info-toggle[aria-expanded="true"] .mobile-info-chevron {
    transform: rotate(180deg);
}

.mobile-info-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

    .mobile-info-panel.open {
        max-height: 300px;
    }

.mobile-info-track {
    display: flex;
    transition: transform 0.3s ease;
}

.mobile-info-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 12px 4px 4px;
}

.mobile-info-card {
    background: #eef4fb;
    border-radius: 10px;
    padding: 12px 14px;
}

.mobile-info-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 6px;
}

.mobile-info-card-body {
    font-size: 12px;
    color: #3a5a7a;
    line-height: 1.5;
    margin: 0;
}

    .mobile-info-card-body a {
        color: #1a6fad;
        text-decoration: none;
        white-space: nowrap;
    }

.mobile-info-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0 12px;
}

.mobile-info-prev,
.mobile-info-next {
    background: none;
    border: 0.5px solid #1a6fad;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    color: #1a6fad;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

    .mobile-info-prev:disabled,
    .mobile-info-next:disabled {
        opacity: 0.3;
        cursor: default;
    }

    .mobile-info-prev:focus-visible,
    .mobile-info-next:focus-visible {
        outline: 3px solid #9CCBFA;
        outline-offset: 2px;
    }

.mobile-info-dots {
    display: flex;
    gap: 6px;
}

.mobile-info-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c0cfe0;
    transition: background 0.2s;
}

    .mobile-info-dot.active {
        background: #1a6fad;
    }


/* Collapsed maintenance notice: summary bar matches Bootstrap's warning colors */
.mobile-maintenance summary {
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #664d03;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 8px;
    margin-bottom: 1rem;
    list-style: none; /* hide default marker */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    /* Safari still shows the marker without this */
    .mobile-maintenance summary::-webkit-details-marker {
        display: none;
    }

/* Chevron on the right; flips when open */
.mobile-maintenance .maintenance-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.mobile-maintenance[open] .maintenance-chevron {
    transform: rotate(180deg);
}

/* When open, summary and stored alert join into one box */
.mobile-maintenance[open] summary {
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;    
    border-bottom-color: rgba(102, 77, 3, 0.25); /* the text brown, faded: visible but subtle */
}

.mobile-maintenance .alert {
    margin: 0 0 1rem 0; /* removes the gap under the summary (that rule was missing) */
    border-top: 0;
    border-radius: 0 0 8px 8px;
    font-size: 0.875rem; /* slightly smaller body text on phones */
}
