/* MAIN PAGE LAYOUT */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto;       /* Allow vertical scroll */
    overflow-x: hidden;     /* Prevent sideways scroll */
    scroll-behavior: smooth;
    background-color: #f7f8ff;
}

/* Prevent upward scroll “bounce” on some browsers */
body {
    overscroll-behavior-y: contain;
}

/* HEADER LOGO AREA */
#header {
    background-color: #002366;
    text-align: center;
    padding: 15px 0;
}

#header img {
    max-width: 120px;
}

/* LOGIN BOX */
.loginbox {
    max-width: 480px;
    width: 90%;
    background: rgba(200, 202, 255, 0.5);
    color: #616161;
    border-radius: 10px;
    padding: 20px 15px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    margin: 50px auto 100px; /* ↓ reduced from 80px to 40px to push up */
    position: relative;
    z-index: 10;
}


.user {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: absolute;
    top: calc(-80px / 2);
    left: calc(50% - 40px);
}

/* TEXTS */
h2 {
    margin: 0;
    color: #515151;
    text-align: center;
}

.loginbox p {
    margin: 0;
    padding: 0;
    font-weight: bold;
    color: #FF2c2c;
}

/* INPUT FIELDS */
.loginbox input {
    width: 100%;
    margin-bottom: 20px;
}

.loginbox input[type="text"],
.loginbox input[type="password"] {
    border: 0.25px solid #FF2c2c;
    background-color: #f2f2f2;
    outline: none;
    height: 30px;
    color: #333333;
    font-size: 16px;
    padding: 8px 10px;
    border-radius: 5px;
    box-sizing: border-box;
}

input::placeholder {
    color: rgba(71, 99, 255, 0.5);
}

.loginbox input[type="submit"] {
    border: none;
    outline: none;
    height: 40px;
    color: #fff;
    font-size: 16px;
    background: #FF2c2c;
    cursor: pointer;
    border-radius: 20px;
}

.loginbox input[type="submit"]:hover {
    background: #fff;
    color: #262626;
}

.loginbox a {
    color: #515151;
    font-size: 1.0em;
    font-weight: normal;
    text-decoration: none;
}

/* ADS AREA FIXED AT BOTTOM */
.ads-container {
    width: 100%;
    text-align: center;
    background: #fefefe;
    position: relative;
    padding: 20px 0;
}

/* MOBILE OPTIMIZATION */
@media screen and (max-width: 768px) {
    .loginbox {
        width: 90%;
        padding: 40px 15px;
        margin: 40px auto 120px; /* reduced from 60px to 30px */
    }


    .user {
        width: 60px;
        height: 60px;
        top: calc(-60px / 2);
        left: calc(50% - 30px);
    }

    h2 {
        font-size: 1.5em;
    }

    .loginbox input[type="submit"] {
        font-size: 14px;
    }
}
