/* --- CORE BODY FIXED HEIGHT --- */
body { 
    background: #f1ecec; 
    color: rgba(0,0,0,0.87); 
    font-family: Roboto, Helvetica, Arial, sans-serif; 
    margin: 0; 
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; 
    width: 100vw;
    overflow: hidden; 
}

body::before {
    content: ""; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../images/white-marble-pattern.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.3;
    z-index: -1;
}

/* --- THE LOGIN CARD CONTENT BOX --- */
.login-card {
    background: #ffffff;
    width: 90%; /* FIX: Ensures cards don't touch the viewport border edges on tight screens */
    max-width: 420px; 
    padding: 30px; /* FIX: Reduced baseline padding from 40px to save vertical space */
    border-radius: 8px;
    box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    
    /* Safety rule: handles scaling elegantly if the display window is incredibly short */
    display: flex;
    flex-direction: column;
    max-height: 95vh;
}

/* --- LOGO & LABELS WITHIN CONTAINER --- */
/* Ensure your logo image is sitting neatly inside the top of your login-card container */
.login-logo {
    width: 100%;
    max-width: 280px; /* FIX: Tighter restriction prevents giant branding sizes on small displays */
    margin: 0 auto 20px auto;
    display: block;
    height: auto;
}

label {
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- INPUT FIELD HEIGHT OPTIMIZATION --- */
input[type=text], input[type=password] {
    width: 100%;
    padding: 12px 14px; /* FIX: Swapped from 14px to 12px to trim empty inner container padding */
    margin: 6px 0 14px 0; /* FIX: Tighter margin spaces between inputs */
    display: block;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type=text]:focus, input[type=password]:focus {
    border-color: #b6121b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 15, 15, 0.1);
}

.submit-button {
    background-color: #b6121b;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1.05rem;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 5px;
}
.submit-button:hover { background-color: #b6121b; }
.submit-button:active { transform: scale(0.98); }

.cancel-button {
    background-color: #f0f0f0;
    color: #333;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1.05rem;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}
.cancel-button:hover { background-color: #e0e0e0; }
.cancel-button:active { transform: scale(0.98); }

.error-message {
    display: none; /* Hidden by default, switch to 'flex' or 'block' via JS when active */
    align-items: center;
    gap: 10px;
    background-color: #fdf2f2; /* Soft red tint background */
    border: 2px solid #b6121b;  /* Solid Red Hound brand red border */
    border-radius: 4px;
    padding: 12px 16px;
    margin: -5px 0 0 0;
    color: #b6121b;             /* Dark red text color */
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

@media (max-height: 680px) {
    .login-card {
        padding: 20px; /* Compresses internal spacing when vertical screen real estate is minimal */
    }
    .login-logo {
        max-width: 220px; /* Dynamically shrinks logo size so inputs lift upwards */
        margin-bottom: 12px;
    }
    input[type=text], input[type=password] {
        padding: 10px 12px;
        margin: 4px 0 10px 0;
    }
}