/* ===========================
   FULLSCREEN LOGIN CANVAS
=========================== */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ===========================
   PAGE WRAPPER (FOOTER SAFE)
=========================== */
.page-wrapper {
    min-height: calc(100vh - 72px);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ===========================
   LOGIN PAGE LAYOUT
=========================== */
.login-layout {
    width: 100%;
    max-width: 1400px;
    padding: clamp(24px, 5vw, 48px);

    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    gap: clamp(40px, 6vw, 120px);
}

/* ===========================
   LOGO AREA
=========================== */
.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-area img {
    width: clamp(220px, 30vw, 520px);
    height: auto;
    filter:
        drop-shadow(0 20px 60px rgba(0,0,0,0.6))
        drop-shadow(0 0 40px rgba(155,77,255,0.35));
}

/* ===========================
   LOGIN BOX
=========================== */
.login-box {
    width: clamp(360px, 45vw, 780px);
    padding: clamp(40px, 5vw, 100px);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(28px, 3vw, 44px);

    border-radius: clamp(26px, 3vw, 40px);
    backdrop-filter: blur(20px);
}

/* ===========================
   LOGIN FORM
=========================== */
.login-box form {
    width: 100%;
}

.login-box .input-container {
    margin-bottom: 28px;
}

/* ===========================
   INPUT TEXT OFFSET
=========================== */
.login-box .input-container i {
    margin-right: 18px;
}

.login-box .input-container input {
    padding-left: 10px;   /* moves text away from icon edge */
}

/* ===========================
   AUTOFILL FIX
=========================== */
.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus,
.login-box input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
    background-color: rgba(60,60,100,0.75) !important;
    box-shadow: 0 0 0px 1000px rgba(60,60,100,0.75) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===========================
   LOGIN ERROR
=========================== */
.login-error-plain {
    max-width: 520px;
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;

    text-align: center;
}

.login-error-plain h2 {
    font-size: clamp(2.4rem, 3vw, 3rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ff6b6b;

    text-shadow:
        0 0 12px rgba(255,80,80,0.6),
        0 0 30px rgba(255,80,80,0.4);
}

.login-error-plain p {
    font-size: clamp(1.3rem, 1.5vw, 1.5rem);
    color: #ffd0d0;
    max-width: 420px;
}

/* ===========================
   FOOTER
=========================== */
.footer {
    height: 72px;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 10;

    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.footer-content {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #bbb;
    margin-bottom: 6px;
}

.footer-logo {
    width: 28px;
    height: 28px;
}

/* ===========================
   MOBILE
=========================== */
@media (orientation: portrait) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .logo-area img {
        width: clamp(280px, 80vw, 520px);
    }

    .login-box {
        width: clamp(500px, 90vw, 700px);
    }

    .login-box input {
        font-size: clamp(1.8rem, 6vw, 2.2rem);
    }

    .login-box .input-container i {
        font-size: 2.2rem;
    }

    .login-box button[type="submit"],
    .login-error-plain .btn-primary {
        font-size: clamp(1.9rem, 6.5vw, 2.4rem);
        padding: 26px;
        letter-spacing: 0.08em;
    }
}


@media (orientation: landscape) and (max-height: 500px) {
    /* Enable vertical scrolling */
    body {
        overflow-y: auto;        /* allow vertical scroll */
        display: flex;
        justify-content: center; /* center horizontally */
        align-items: flex-start; /* start from top vertically */
        padding-top: 12px;       /* optional top spacing */
    }

    .page-wrapper {
        min-height: auto;
        width: 100%;
        display: flex;
        flex-direction: column;   /* stack logo + login box */
        align-items: center;      /* horizontal centering */
        padding-bottom: 12px;
    }

    .login-layout {
        display: flex;
        flex-direction: column;   /* vertical stack */
        justify-content: flex-start;
        align-items: center;      /* horizontal centering */
        gap: 8px;                 /* smaller gap between logo & form */
        width: 100%;
        max-width: 700px;
        padding: 8px 12px;
    }

    .logo-area {
        display: flex;
        justify-content: center;
        margin-bottom: 4px;       /* bring logo closer to form */
    }

    .logo-area img {
        width: 40vw;              /* slightly smaller logo */
        max-width: 240px;
        height: auto;
    }

    .login-box {
        width: 90%;
        max-width: 700px;
        padding: 16px;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: stretch;     /* inputs fill width */
        gap: 12px;
    }

    .login-box input {
        height: 36px;
        font-size: 1rem;
        padding: 4px 8px;
    }

    .login-box .input-container i {
        font-size: 1.2rem;
        margin-right: 6px;
    }

    .footer {
        display: none;            /* hide footer */
    }
}
