/* Login Page Customization for Meridiana - Clean White Card Layout */
/* Updated based on Clean Design Mockup (Jan 2026) */

/* 1. Global Setup - Clean White Background */
html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.login {
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;

    /* Pure White Background */
    background-color: #ffffff !important;
    background-image: none !important;

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #333;
}

/* 2. Hide Unwanted Elements (Stripes, Shadows, Overlays) */
html::before,
html::after,
body.login::before,
body.login::after,
.language-switcher,
.privacy-policy-page-link,
body.login #backtoblog {
    display: none !important;
}

/* 3. Main Login Container (The Card) */
body.login div#login {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 40px 50px;
    background: #ffffff;

    /* Soft Shadow to create Card effect on white background */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);

    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.02);
    /* Very subtle border */
}

/* 4. Logo Styling */
body.login h1 {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
    margin-top: 0;
}

body.login h1 a {
    display: block;
    width: 220px !important;
    height: 110px !important;
    margin: 0 auto;
    background-image: url('../images/Logo-PNG-crop.png') !important;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    /* No filter needed on white background */
    filter: none !important;
}

/* 5. Form Styling */
body.login form#loginform,
body.login form#lostpasswordform,
body.login form#resetpassform {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
}

/* Labels */
body.login form#loginform label,
body.login form#lostpasswordform label,
body.login form#resetpassform label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    /* Dark Grey for readability */
    margin-bottom: 8px;
    text-transform: none;
    /* Modern look */
}

/* Inputs - The Key Design Element: Red Borders */
body.login form#loginform input[type="text"],
body.login form#loginform input[type="password"],
body.login form#lostpasswordform input[type="text"],
body.login form#lostpasswordform input[type="email"],
body.login form#resetpassform input[type="text"],
body.login form#resetpassform input[type="password"] {
    width: 100%;
    padding: 14px 18px !important;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
    background-color: #ffffff;

    /* BRAND RED BORDER */
    border: 1.5px solid #8e0e1b !important;
    /* Dark Red Border */
    border-radius: 12px !important;
    /* Smooth rounded corners */

    margin-bottom: 24px !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    height: 52px !important;
}

/* Input Focus State */
body.login form#loginform input:focus,
body.login form#lostpasswordform input:focus,
body.login form#resetpassform input:focus {
    background-color: #fffbfc !important;
    /* Very subtle tint */
    border-color: #ab1120 !important;
    box-shadow: 0 0 0 4px rgba(171, 17, 32, 0.1) !important;
    outline: none;
}

/* 6. Checkbox "Ricordami" */
body.login form#loginform p.forgetmenot {
    float: none !important;
    margin-bottom: 25px !important;
    display: flex;
    align-items: center;
}

body.login form#loginform input[type="checkbox"] {
    margin-right: 10px !important;
    border-radius: 4px !important;
    border: 1.5px solid #8e0e1b !important;
    background: transparent !important;
    width: 18px !important;
    height: 18px !important;
}

body.login form#loginform input[type="checkbox"]:checked {
    background: #8e0e1b !important;
    border-color: #8e0e1b !important;
}

body.login form#loginform input[type="checkbox"]:checked::before {
    color: #fff !important;
}

body.login form#loginform p.forgetmenot label {
    font-size: 15px !important;
    color: #555 !important;
    font-weight: 400 !important;
    margin: 0 !important;
}

/* "Password dimenticata?" Link inside form flow (simulated via CSS positioning if possible, otherwise Footer Nav handles it) */
/* Moving Footer Nav closer if needed, but WP keeps it outside form. Keep generic styling clean. */

/* 7. Submit Button - PILL SHAPE */
body.login form#loginform p.submit,
body.login form#lostpasswordform p.submit,
body.login form#resetpassform p.submit,
body.login .reset-pass-submit {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.login form#loginform input[type="submit"]#wp-submit,
body.login form#lostpasswordform input[type="submit"]#wp-submit,
body.login form#resetpassform input[type="submit"]#wp-submit,
body.login .reset-pass-submit .button {
    width: 100% !important;
    display: block !important;
    float: none !important;

    background-color: #8e0e1b !important;
    /* Deep Brand Red */

    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    padding: 16px !important;
    height: auto !important;
    line-height: normal !important;
    border: none !important;

    /* PILL SHAPE */
    border-radius: 50px !important;

    cursor: pointer !important;
    transition: transform 0.1s ease, background-color 0.2s;
    text-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: none !important;
    /* FLAT */
}

body.login form#loginform input[type="submit"]#wp-submit:hover,
body.login form#lostpasswordform input[type="submit"]#wp-submit:hover,
body.login form#resetpassform input[type="submit"]#wp-submit:hover,
body.login .reset-pass-submit .button:hover {
    background-color: #a0101f !important;
    box-shadow: none !important;
    transform: translateY(-1px);
}

body.login form#loginform input[type="submit"]#wp-submit:active,
body.login form#lostpasswordform input[type="submit"]#wp-submit:active,
body.login form#resetpassform input[type="submit"]#wp-submit:active,
body.login .reset-pass-submit .button:active {
    transform: translateY(0);
}

body.login .message,
body.login .notice,
body.login .success,
body.login .error,
body.login #login_error {
    display: block !important;
    background: #fff7f8 !important;
    border: 1px solid rgba(142, 14, 27, 0.18) !important;
    border-left: 4px solid #8e0e1b !important;
    box-shadow: none !important;
    color: #5f1820 !important;
    border-radius: 12px !important;
    margin: 0 0 24px !important;
    padding: 14px 16px !important;
}

body.login .message a,
body.login .notice a,
body.login .success a,
body.login .error a,
body.login #login_error a {
    color: #8e0e1b !important;
    font-weight: 600;
}

body.login.login-action-resetpass #nav,
body.login.login-action-rp #nav,
body.login.login-action-lostpassword #nav {
    margin-top: 20px;
}

body.login.login-action-resetpass #nav a,
body.login.login-action-rp #nav a,
body.login.login-action-lostpassword #nav a {
    color: #8e0e1b !important;
}

/* 8. Footer Nav (Password Lost) */
body.login #nav {
    text-align: right;
    /* Align right as per common logic, or center */
    margin-top: -55px;
    /* Pull up into the form area visually if possible, otherwise keep below */
    margin-bottom: 30px;
    padding: 0;
    position: relative;
    z-index: 10;
    pointer-events: none;
    /* Container ignores clicks so we can float content */
}

body.login #nav a {
    pointer-events: auto;
    color: #666 !important;
    font-size: 14px;
    text-decoration: none;
    float: right;
    /* Floating right for "Password Dimenticata?" look next to Remember Me potentially */
    margin-right: 0;
}

/* Revert Hack for #nav if it breaks flow */
body.login #nav {
    margin-top: 15px;
    text-align: center;
    float: none;
}

body.login #nav a {
    float: none;
    color: #666666 !important;
}

body.login #nav a:hover {
    color: #8e0e1b !important;
    text-decoration: underline;
}

/* 9. Mobile Responsiveness */
@media screen and (max-width: 600px) {
    body.login {
        padding: 20px;
        background: #ffffff !important;
        align-items: flex-start;
        /* Align top on mobile */
        padding-top: 60px;
    }

    body.login div#login {
        padding: 20px 0;
        box-shadow: none !important;
        /* Remove shadow on mobile for flat look */
        border: none !important;
        background: transparent !important;
    }

    body.login h1 a {
        width: 180px !important;
        height: 90px !important;
        margin-bottom: 20px;
    }

    body.login form#loginform input[type="text"],
    body.login form#loginform input[type="password"] {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 15px !important;
    }

    body.login form#loginform input[type="submit"]#wp-submit {
        font-size: 18px !important;
        padding: 18px !important;
    }
}
