@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* =======================
   General & Global Styles
   ======================= */

.form-errors {
    color: rgb(255, 0, 0);
    font-size: 0.9em;
    font-weight: 600;
    animation: flash 1s infinite;
    animation-iteration-count: 4;
}

@keyframes flash {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        opacity: 1;
    }
}

html, body {
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    padding: 0;
    margin:0;
    color: #000;
    background-color: #ECF3F8;
    background-repeat: no-repeat;
    background-size: cover;
    max-width: 100%;
    /* Mobile-first layout */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    /* Prevent horizontal scroll unless necessary */
    overflow-x: hidden;
}

Ensure box-sizing applies to all elements
*, *::before, *::after {
    box-sizing: inherit;
} 

body {
    line-height: 1.5; /* A comfortable line height for mobile */
}

/* =========================
   Main & Center Container
   ========================= */

main {
    /* Mobile-first: stack content, center align, and fill available space */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* centers vertically */
    margin: 0 auto;
    width: 100%;
    max-width: 100%; /* For mobile, full width */
    
}

.center-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 9;
    margin-top:150px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}


.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

/* ===================
   Flash Messages
   =================== */

.flashes {
    list-style: none;
    padding: 0;
    margin: 0;

    /* For mobile, place them near the top */
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
        display: none;
    }
}

.flashes li {
    background: #FFD700;
    color: #2C2C2C;
    animation-name: fadeOut;
    animation-fill-mode: forwards;
    position: relative;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Green flash messages - 2.5 seconds */
.flashes li.success {
    background: #1DB954;
    color: #fff;
    border: 1px solid #c3e6cb;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

/* Red flash messages - 5 seconds */
.flashes li.danger {
    background: #FF3B30;
    color: #fff;
    border: 1px solid #f5c6cb;
    animation-duration: 5s;
    animation-delay: 0.5s;
}

.flashes li.hide {
    display: none;
}

/* ====================
   reCAPTCHA & Errors
   ==================== */

.g-recaptcha {
    margin: 10px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 78px;
}

.error-message {
    color: red;
}

/* =========================
   Scrollable Container
   ========================= */

.scrollable-container {
    /* Mobile-first settings */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Scrolling & scrollbar handling */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* momentum scrolling iOS */
    -ms-overflow-style: none;          /* IE and Edge hide scrollbar */
    scrollbar-width: none;             /* Firefox hide scrollbar */

    /* Force full viewport width if needed */
    width: 100vw !important;
    margin-top:10px;
}

/* Hide scrollbar for WebKit browsers */
.scrollable-container::-webkit-scrollbar {
    display: none;
}

/* ========================
   Tablet (min-width: 768px)
   ======================== */
@media (min-width: 768px) {

    main {
        max-width: 700px;
    }

    .center-container{
        margin-top:150px;
    }

    .flashes {
        top: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        max-width: 600px;
    }

    .center-container {
        max-width: 700px; 
    }
}

@media (max-width: 383px) {
    .center-container{
        margin-top: -20px;
    }
}


/* =========================
   Desktop (min-width: 1024px)
   ========================= */
@media (min-width: 915px) {

    .scrollable-container {
        /* Mobile-first settings */
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-grow: 1;
    
        /* Scrolling & scrollbar handling */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* momentum scrolling iOS */
        -ms-overflow-style: none;          /* IE and Edge hide scrollbar */
        scrollbar-width: none;             /* Firefox hide scrollbar */
    
        /* Force full viewport width if needed */
        width: 100vw !important;
        margin-top:10px;
    }

    main {
        max-width: 900px;
        margin-top: 100px;
    }

    /* html, body {
        padding-bottom: 50px;
    } */

    .center-container {
        display: flex;
        flex-direction: column;
        height: 85vh; /* Full viewport height */
        max-width: 700px;
        margin: 0 auto;
    }

    .flashes {
        width: 50%;
        max-width: 600px;
    }
}

    /* =========================
   verify codep page adjustments
   ========================= */

   .digit-input{
    width: 8vw; 
    height: 9vw;
    max-width: 40px;
    max-height: 45px;
    font-size: 1.2em;
    text-align: center;
    border: 1px solid #E94D8C;
    border-radius: 4px;
   }


   .btn-primary{   
    width: 100%; /* Full width on mobile */
    background: #061A9A;
    border-radius: 30px;
    color: #fff;
    font-size: 1em; /* Slightly smaller on mobile */
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    position: relative;
    transition: background 0.3s, transform 0.1s;
    margin-top: 30px;
    border: none;
    padding: 12px;
    }
    .verify-container{
        margin-top:20%;
    }

    @media (max-width: 750px) {
        .verify-container{
            margin-top:30%;
        }
    }

    @media (max-width: 440px) {
        .verify-container{
            margin-top:50%;
        }
    }
    

/* Profile Modal Button Styles */
.profile-btn, .logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;                 /* Space between icon and text */
    padding: 5px 10px;
    border-radius: 25px;
    background-color: #fff;   /* Start with white background */
    color: #061A9A;           /* Text color */
    text-decoration: none;    /* Remove underlines */
    font-weight: 700;
    transition: 
        background-color 0.3s ease, 
        color 0.3s ease, 
        filter 0.3s ease;
    border: 2px solid #061A9A; /* Optional border to match color */
    justify-content: center;
    min-width: 15vh;              /* Full width for better alignment */
    text-align: center;
}

.profile-btn:hover, .logout-btn:hover {
    background-color: #061A9A; /* On hover, switch background to #061A9A */
    color: #fff;               /* Text color to white */
}

/* Icon Styles */
.profile-btn .profile-icon, .logout-btn .logout-icon {
    width: 20px;
    height: auto;
    display: inline-block;
    transition: filter 0.3s ease;
}

.profile-btn:hover .profile-icon, .logout-btn:hover .logout-icon {
    filter: brightness(0) invert(1);
}
