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

/* ===== Page Layout ===== */
body.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 30px 20px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ===== Login wrapper ===== */
#login {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
}

body.login #login {
    padding-top: 0;
    padding-bottom: 0;
}

/* ===== Logo ===== */
#login h1,
#login h1.wp-login-logo {
    margin: 0 0 12px;
    padding: 0;
    text-align: center;
    line-height: 1;
}

#login h1 a,
.login h1 a,
.wp-login-logo a {
    display: block;
    width: 320px;
    height: 84px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-size: 0;
    color: transparent;
    text-decoration: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    overflow: hidden;
    outline: none;
}

/* ===== SSO Button (above form, no card background) ===== */
.custom-login-oidc-button-wrap {
    padding: 0 0 0;
    margin: 0;
}

.custom-login-oidc-separator {
    padding: 8px 0;
    margin: 0;
    text-align: center;
    position: relative;
}

.custom-login-oidc-separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.custom-login-oidc-separator span {
    padding: 0 12px;
    position: relative;
    color: #999;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Form Card ===== */
#loginform,
#registerform,
#lostpasswordform {
    padding: 16px 20px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* When there is no SSO button above, form already has full rounded corners */

/* ===== 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.2s, box-shadow 0.2s;
}

#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;
    display: block;
    margin-bottom: 4px;
}

/* Don't force block display on the remember-me label */
#loginform .forgetmenot label {
    display: inline-flex;
    margin-bottom: 0;
}

/* ===== Submit Button ===== */
.wp-core-ui .button-primary {
    width: 100%;
    height: auto;
    margin-top: 14px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-shadow: none;
    box-shadow: none;
    transition: opacity 0.2s;
}

.wp-core-ui .button-primary:hover {
    opacity: 0.9;
}

.wp-core-ui .button-primary:active {
    opacity: 1;
}

/* ===== Remember Me ===== */
.forgetmenot {
    margin: 8px 0 14px;
}

.forgetmenot label {
    font-size: 13px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.forgetmenot input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

/* ===== Error / Success Messages ===== */
#login_error,
.message,
.success {
    border-radius: 4px;
    margin: 0 0 10px;
    padding: 10px 14px;
    font-size: 13px;
}

#login_error {
    border-left: 4px solid #dc3232;
    background: #fbeaea;
}

.message {
    border-left: 4px solid #0073aa;
    background: #e8f4fd;
}

.success {
    border-left: 4px solid #46b450;
    background: #ecf7ed;
}

/* ===== Footer Links ===== */
#nav,
#backtoblog {
    text-align: center;
    margin: 6px 0 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

#nav a,
#backtoblog a {
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    padding: 2px 0;
}

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

/* ===== Privacy Policy / Conditions Link ===== */
.privacy-policy-page-link,
.login .privacy-policy-page-link {
    text-align: center;
    margin: 10px 0 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.privacy-policy-page-link a {
    display: inline-block;
    font-size: 13px;
    text-decoration: none;
    padding: 2px 0;
}

.privacy-policy-page-link a:hover {
    text-decoration: underline;
}

/* ===== Language Switcher ===== */
body.login .language-switcher {
    text-align: center;
    margin: 4px 0 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
    body.login {
        padding: 40px 16px 30px;
    }

    #login {
        max-width: 100%;
    }

    #login h1 a,
    .login h1 a,
    .wp-login-logo a {
        width: 260px;
        height: 70px;
    }
}

@media screen and (max-width: 480px) {
    body.login {
        padding: 30px 12px 20px;
    }

    #login h1,
    #login h1.wp-login-logo {
        margin-bottom: 12px;
    }

    #login h1 a,
    .login h1 a,
    .wp-login-logo a {
        width: 200px;
        height: 56px;
    }

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

    .wp-core-ui .button-primary {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media screen and (max-width: 360px) {
    #login h1 a,
    .login h1 a,
    .wp-login-logo a {
        width: 160px;
        height: 45px;
    }

    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 14px 12px;
    }
}

/* ===== Custom HTML Content ===== */
.custom-login-html-content {
    width: 100%;
    max-width: 420px;
    margin: 12px auto;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.custom-login-html-content img {
    max-width: 100%;
    height: auto;
}

.custom-login-html-content a {
    color: inherit;
    text-decoration: underline;
}

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

/* ===== Transitions (interactive elements only) ===== */
#nav a,
#backtoblog a,
.privacy-policy-page-link a,
.custom-login-oidc-button,
input,
button,
.wp-core-ui .button-primary {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
