@import url(https://fonts.googleapis.com/css?family=Open+Sans);

/* --- Base Layout --- */
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; margin: 0; }

body {
    font-family: 'Open Sans', sans-serif;
    background: #092756;
    background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104, 128, 138, .4) 10%, rgba(138, 114, 76, 0) 40%), 
                linear-gradient(to bottom, rgba(57, 173, 219, .25) 0%, rgba(42, 60, 87, .4) 100%), 
                linear-gradient(135deg, #670d10 0%, #092756 100%);
}

/* --- Centering Fix --- */
#content {
    width: 300px; /* Lock to form width to ensure logo/fields align */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column; /* Stack logo above form */
    align-items: center;    /* Center them both horizontally */
}

form { width: 100%; }

/* --- Status Classes (Restored) --- */
#LOGIN_ERROR_DIV {
    margin: 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    text-align: center;
    font-family: "Courier New", monospace;
    z-index: 1000;
}

.LOGIN_OK {
    border-top: 3px solid #035c00;
    border-bottom: 3px solid #035c00;
    background-color: rgba(3, 92, 0, 0.5);
}

.LOGIN_BAD {
    border-top: 3px solid #590505;
    border-bottom: 3px solid #590505;
    background-color: rgba(89, 5, 5, 0.5);
}

#LOGIN_ERROR_MESSAGE {
    color: #ffffff;
    text-transform: uppercase;
    margin: 20px;
    font-size: 3.5vw;
    text-shadow: #ffffff 0 0 10px;
}

/* --- Input Fields --- */
input {
    width: 100%;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.3);
    outline: none;
    padding: 10px;
    font-size: 13px;
    color: #fff;
    border-radius: 4px;
    box-shadow: inset 0 -5px 45px rgba(100, 100, 100, 0.2), 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: box-shadow .5s ease;
    font-family: 'Courier New', monospace;
}

/* --- Animation & Stability --- */
.login-anim-container {
    width: 100%;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(.4, 2, .6, 1), opacity 0.5s;
    max-height: 0;
    opacity: 0;
}

.login-anim-container.revealed {
    max-height: 400px;
    opacity: 1;
}

.login-fields {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Prevent layout jump when switching to Step 2 */
.login-anim-container.step2 #httpd_username,
.login-anim-container.step2 #httpd_password {
    display: none !important;
}

.login-anim-container.step2 .totp-field {
    display: block !important;
}

/* --- Modern Glass Button --- */
.login-svg-btn {
    background: rgba(30, 34, 45, 0.85);
    color: #fff;
    border: 1px solid rgba(80, 90, 120, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.25), 0 1.5px 4px 0 rgba(80, 90, 120, 0.10) inset;
    backdrop-filter: blur(2px);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.login-svg-btn:hover {
    background: rgba(40, 44, 60, 0.95);
    border: 1px solid rgba(120, 140, 180, 0.5);
}


      /* Container for the fields */
        .login-fields {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: 1fr;
            align-items: center;
            /* Vertically centers content */
            min-height: 120px;
            /* Set this to the height of your two initial inputs + margins */
            margin-bottom: 20px;
        }

        /* Stack both field groups in the same grid cell */
        .step1-fields,
        .totp-field {
            grid-column: 1;
            grid-row: 1;
            display: flex;
            flex-direction: column;
            transition: opacity 0.3s ease-in-out;
        }

        /* Hide/Show Logic */
        .login-anim-container.step2 .step1-fields {
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
        }

        .login-anim-container:not(.step2) .totp-field {
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
        }

        .login-anim-container.step2 .totp-field {
            opacity: 1;
            visibility: visible;
        }