/**
 * Custom Login - Frontend Login Page Styles
 *
 * @package Custom_Login
 */

/* Login page layout — fully centred */
body.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Logo container */
#login h1 a,
.login h1 a {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    margin: 0 auto 25px;
    padding: 0;
    text-indent: -9999px;
    outline: none;
}

/* Login form wrapper — centred */
#login {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 0;
    position: relative;
    left: 0;
    top: 0;
    transform: none;
}

/* Form styling */
#loginform,
#registerform,
#lostpasswordform {
    padding: 26px 24px;
    margin-top: 20px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

#loginform:hover,
#registerform:hover,
#lostpasswordform:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Input fields */
#loginform input[type="text"],
#loginform input[type="password"],
#registerform input[type="text"],
#registerform input[type="email"],
#lostpasswordform input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
#registerform input[type="text"]:focus,
#registerform input[type="email"]:focus,
#lostpasswordform input[type="text"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
    outline: none;
}

/* Labels */
#loginform label,
#registerform label,
#lostpasswordform label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Submit button */
.wp-core-ui .button-primary {
    width: 100%;
    height: auto;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.1s ease;
    text-shadow: none;
    box-shadow: none;
}

.wp-core-ui .button-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.wp-core-ui .button-primary:active {
    transform: translateY(0);
}

/* Remember me checkbox */
.forgetmenot {
    margin-top: 8px;
}

.forgetmenot label {
    font-size: 13px;
    font-weight: normal;
}

/* Navigation links */
#nav,
#backtoblog {
    text-align: center;
    margin-top: 16px;
    padding: 0;
}

#nav a,
#backtoblog a {
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.3s ease;
}

#nav a:hover,
#backtoblog a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Error messages */
#login_error,
.message,
.success {
    border-radius: 4px;
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 13px;
}

#login_error {
    border-left-color: #dc3232;
    background: #fbeaea;
}

.message {
    border-left-color: #0073aa;
    background: #e8f4fd;
}

.success {
    border-left-color: #46b450;
    background: #ecf7ed;
}

/* Privacy policy link */
.privacy-policy-page-link {
    text-align: center;
    margin-top: 16px;
}

/* Override WP core login positioning defaults */
body.login #login {
    padding-top: 0;
    padding-bottom: 0;
}

body.login .language-switcher {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    #login {
        max-width: 100%;
        padding: 0 10px;
    }

    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 20px 16px;
    }

    #login h1 a,
    .login h1 a {
        width: 200px !important;
    }
}

/* Accessibility: Focus visible indicator */
a:focus-visible,
input:focus-visible,
button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color, box-shadow, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}
