/* D40 Login Customizer Styles */

/* Reset default WordPress login styles and center everything */
body.login {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Override WordPress default positioning */
body.login div#login {
    position: static !important;
    width: 100% !important;
    max-width: 400px !important;
    padding: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
}

/* Hide the default WordPress logo */
body.login #login h1 a {
    display: none;
}

/* Custom header container */
.d40-login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Custom title styling */
.d40-login-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* Custom logo styling */
.d40-login-logo {
    margin-bottom: 20px;
}

.d40-login-logo img {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Login form styling */
body.login #loginform {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 0;
}

/* Form input styling */
body.login #loginform input[type="text"],
body.login #loginform input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* Form labels */
body.login #loginform label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

/* Submit button */
body.login #loginform .button-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 4px;
    border: none;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
}

body.login #loginform .button-primary:hover {
    background: #005a87;
}

/* Remember me checkbox */
body.login #loginform .forgetmenot {
    margin: 15px 0;
}

body.login #loginform .forgetmenot input[type="checkbox"] {
    margin-right: 8px;
}

/* Navigation links */
body.login #nav,
body.login #backtoblog {
    text-align: center;
    margin: 20px 0 0 0;
    padding: 0;
}

body.login #nav a,
body.login #backtoblog a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
    color: #0073aa;
}

/* Error messages */
body.login #login_error,
body.login .message {
    margin: 0 0 20px 0;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}

body.login #login_error {
    background: #fff;
    border-left: 4px solid #dc3232;
    color: #dc3232;
}

body.login .message {
    background: #fff;
    border-left: 4px solid #46b450;
    color: #46b450;
}

/* Force all body children to stack vertically and center */
body.login > * {
    width: 100% !important;
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: static !important;
    float: none !important;
}

/* Ensure language switcher and other elements are centered */
body.login .language-switcher,
body.login #language-switcher,
body.login .wpml-ls-legacy-dropdown,
body.login .wpml-ls-legacy-list-horizontal {
    display: block !important;
    text-align: center !important;
    margin: 20px auto !important;
    float: none !important;
    position: static !important;
}

/* Responsive design */
@media (max-width: 480px) {
    body.login {
        padding: 10px;
    }
    
    body.login #login {
        max-width: 100%;
    }
    
    body.login #loginform {
        padding: 20px;
    }
    
    .d40-login-title {
        font-size: 24px;
    }
    
    .d40-login-logo img {
        max-width: 150px;
        max-height: 75px;
    }
}
