/* ==========================================================================
   1. GLOBAL / BASE LAYOUT & RESETS
   ========================================================================== */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* Rich solid black fallback color */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Centering Engine Wrapper with Immersive Tinted Background Picture */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    
    /* Premium dark tint overlay protects text readability over your custom image asset */
    background-image: linear-gradient(rgba(0, 0, 0, 0.57), rgba(0, 0, 0, 0.5)), url('../img/bd_1.jpg');
    background-size: 100% 100%;          
    background-position: center;     
    background-repeat: no-repeat;    
    background-attachment: fixed;    
}

/* Premium White Login Container Box */
.login-container {
    background: #ffffff !important;
    width: 100%;
    max-width: 420px; 
    padding: 40px;
    border-radius: 8px; /* Clean corporate sharp corners */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    border-top: 4px solid #dc2626; /* Crimson Red Top Accent Stripe */
}

/* Glassmorphism blur integration for desktop displays */
@media screen and (min-width: 481px) {
    .login-container {
        background: rgba(255, 255, 255, 0.96) !important; 
        backdrop-filter: blur(8px); 
        -webkit-backdrop-filter: blur(8px);
    }
}

/* ==========================================================================
   2. BRANDING HEADERS & LOGO CONFIGURATION
   ========================================================================== */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.brand-logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.brand-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #000000; /* Deep Obsidian Black Title */
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.brand-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #4b5563; /* Refined Charcoal Sub-text */
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-container h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   3. FORM FIELDS & INTERACTION STATES
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #000000; /* Solid Black Labels */
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100% !important;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: #000000;
    background-color: #ffffff;
    border: 2px solid #e5e7eb; /* Sleek modern border rules */
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Strong Black Boundary Focus Ring */
.login-container input:focus {
    border-color: #000000 !important; 
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

/* Crimson Red Validation Overrides on Errors */
.login-container input.is-invalid {
    border-color: #dc2626 !important;
    background-color: #fff5f5;
}

.invalid-feedback {
    font-size: 12px;
    color: #dc2626; /* Crimson text feedback */
    font-weight: 600;
    margin-top: 4px;
}

/* Error Notification Callout Box */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   4. BLACK TO RED INTERACTIVE ACTION TRIGGER BUTTON
   ========================================================================== */
.login-btn {
    width: 100%;
    height: 46px;
    background-color: #000000; /* Solid Black base view */
    color: #ffffff;            /* White Text label */
    border: 2px solid #000000;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease-in-out;
}

/* Smooth color morph to Crimson Red upon interaction */
.login-btn:hover {
    background-color: #dc2626; 
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* ==========================================================================
   5. NAVIGATION ANCHORS & DATA FOOTERS
   ========================================================================== */
.auth-links-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    font-size: 13px;
}

.auth-links-grid a {
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.link-secondary { 
    color: #4b5563; 
}
.link-secondary:hover { 
    color: #dc2626; /* Shifts to red on hover */
}

.link-primary { 
    color: #000000; 
    font-weight: 700; 
    border-bottom: 2px solid transparent;
}
.link-primary:hover { 
    color: #dc2626; 
    border-color: #dc2626; 
}

.auth-footer {
    margin-top: 32px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    text-align: center;
}

.auth-footer p {
    margin: 0;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* ==========================================================================
   6. MOBILE VIEWPORT BREAKPOINTS TRANSFORMATIONS
   ========================================================================== */
@media screen and (max-width: 480px) {
    .auth-wrapper {
        padding: 0;
        background: #ffffff; /* Strip background picture on mobile for quick data delivery */
    }

    .login-container {
        padding: 40px 24px;
        box-shadow: none; 
        border-radius: 0;
        border-top: none; /* Let content fill the mobile canvas completely */
    }

    .brand-header h1 { font-size: 24px; }
    .brand-logo { height: 52px; }
    .login-btn { height: 50px; font-size: 15px; } /* Enlarge click boundary box */
    
    /* Stack links vertically on small mobile phone form factors */
    .auth-links-grid {
        flex-direction: column-reverse; 
        gap: 16px;
        text-align: center;
    }

    .auth-links-grid a {
        width: 100%;
        padding: 8px 0;
    }
}
/* ==========================================================================
   7. REGISTRATION COMPONENT EXTENSIONS & RESET
   ========================================================================== */
.register-container {
    max-width: 500px !important; /* Slightly wider layout box space allocation to handle row inputs cleanly */
}

.auth-subtitle {
    font-size: 13px; 
    color: #6b7280; 
    margin-top: -15px; 
    margin-bottom: 20px;
    text-align: center;
}

.form-row-split {
    display: flex;
    gap: 16px;
    width: 100%;
}

.form-row-split .form-group {
    flex: 1;
}

/* Custom styled dropdown select to match text input properties */
.login-container select {
    width: 100% !important;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: #000000;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-container select:focus {
    border-color: #000000 !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.center-links {
    justify-content: center !important; 
    margin-top: 24px;
}

/* Collapse multi-column row fields on small mobile phone breakpoints */
@media screen and (max-width: 480px) {
    .form-row-split {
        flex-direction: column;
        gap: 0;
    }
}