/* =========================================================
   KL Login — Custom Login Page Styles
   Keys Locker Store — v1.0.0
   ========================================================= */

/* --- Reset & Page Layout --- */

body.login.kl-login-page {
    background: var(--kl-dark, #0a0a0a) !important;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 60px 20px 40px !important;
    box-sizing: border-box !important;
}

/* --- Hide WP defaults we're replacing --- */

body.login.kl-login-page #login h1 {
    display: none !important;
}

body.login.kl-login-page .language-switcher {
    display: none !important;
}

/* --- Override LoginPress if active --- */

body.login.kl-login-page #loginpress-show-love,
body.login.kl-login-page .loginpress-show-love {
    display: none !important;
}

body.login.kl-login-page #login {
    width: 100% !important;
    max-width: 440px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* --- Custom Logo --- */

.kl-login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.kl-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.kl-logo-link:hover {
    color: #fff;
    opacity: 0.9;
}

.kl-logo-link:focus {
    outline: none;
    box-shadow: none;
}

.kl-logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border-radius: 12px;
    font-size: 20px;
    color: var(--kl-accent, #00d4aa);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.kl-logo-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: rotate(45deg);
    animation: klShimmer 3s ease-in-out infinite;
}

@keyframes klShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.kl-logo-img {
    height: 48px;
    width: auto;
    flex-shrink: 0;
    border-radius: 12px;
}

.kl-logo-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.kl-logo-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1.1;
}

.kl-logo-tagline {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    margin-top: 2px;
}


/* --- Tab Navigation --- */

.kl-login-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 4px;
}

.kl-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    color: #888;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.kl-tab:hover {
    color: #ccc;
    background: rgba(255,255,255,0.04);
}

.kl-tab:focus {
    outline: none;
    box-shadow: none;
}

.kl-tab-active {
    background: var(--kl-card-bg, #ffffff) !important;
    color: var(--kl-card-text, #333333) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kl-tab i {
    font-size: 13px;
}


/* --- Form Card --- */

body.login.kl-login-page #loginform,
body.login.kl-login-page #registerform,
body.login.kl-login-page #lostpasswordform,
body.login.kl-login-page #resetpassform {
    background: var(--kl-card-bg, #ffffff) !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 36px !important;
    box-shadow: 0 4px 40px rgba(0,0,0,0.2) !important;
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
}

/* --- Labels --- */

body.login.kl-login-page #loginform label,
body.login.kl-login-page #registerform label,
body.login.kl-login-page #lostpasswordform label,
body.login.kl-login-page #resetpassform label {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.2px;
}

/* --- Input Fields --- */

body.login.kl-login-page input[type="text"],
body.login.kl-login-page input[type="password"],
body.login.kl-login-page input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: #fafafa;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    color: var(--kl-card-text, #333);
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 4px;
    box-shadow: none;
    outline: none;
}

body.login.kl-login-page input[type="text"]:focus,
body.login.kl-login-page input[type="password"]:focus,
body.login.kl-login-page input[type="email"]:focus {
    border-color: var(--kl-dark, #0a0a0a);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body.login.kl-login-page input[type="text"]::placeholder,
body.login.kl-login-page input[type="password"]::placeholder,
body.login.kl-login-page input[type="email"]::placeholder {
    color: #aaa;
}

/* --- Password wrapper (for toggle icon) --- */

.kl-password-wrapper {
    position: relative;
}

.kl-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
    line-height: 1;
}

.kl-password-toggle:hover {
    color: var(--kl-dark, #0a0a0a);
}

/* --- Remember Me Checkbox --- */

body.login.kl-login-page .forgetmenot {
    margin-top: 8px;
    margin-bottom: 4px;
    float: none !important;
}

body.login.kl-login-page .forgetmenot label {
    font-size: 13px;
    font-weight: 400;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

body.login.kl-login-page input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ddd;
    border-radius: 5px;
    accent-color: var(--kl-dark, #0a0a0a);
    margin: 0;
    cursor: pointer;
}

/* --- Submit Button --- */

body.login.kl-login-page #wp-submit,
body.login.kl-login-page .wp-core-ui .button-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--kl-dark, #0a0a0a) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none !important;
    box-shadow: none !important;
    display: block;
    margin-top: 8px;
}

body.login.kl-login-page #wp-submit:hover,
body.login.kl-login-page .wp-core-ui .button-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

/* Fix the submit row layout — stack Remember Me above the button */
body.login.kl-login-page .submit {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    margin-top: 16px;
    align-items: stretch;
}

/* Override browser autofill yellow background */
body.login.kl-login-page input:-webkit-autofill,
body.login.kl-login-page input:-webkit-autofill:hover,
body.login.kl-login-page input:-webkit-autofill:focus,
body.login.kl-login-page input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #fafafa inset !important;
    -webkit-text-fill-color: var(--kl-card-text, #333) !important;
    font-family: 'Outfit', sans-serif !important;
    transition: background-color 5000s ease-in-out 0s;
}


/* --- Hide "Register For This Site" default WP message on register page --- */

body.login.kl-login-page .login .message.register {
    display: none !important;
}

/* --- Error & Message Boxes --- */

body.login.kl-login-page .login .message,
body.login.kl-login-page .login .success {
    border: none;
    border-left: 4px solid var(--kl-accent, #00d4aa);
    background: rgba(0, 212, 170, 0.06);
    border-radius: 10px;
    padding: 14px 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: var(--kl-card-text, #333);
    margin: 0 0 20px 0;
    box-shadow: none;
}

body.login.kl-login-page #login_error {
    border: none;
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.06);
    border-radius: 10px;
    padding: 14px 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #333;
    margin: 0 0 20px 0;
    box-shadow: none;
}

body.login.kl-login-page #login_error a {
    color: var(--kl-accent, #00d4aa);
    font-weight: 500;
}


/* --- Navigation Links (Lost password, Back to blog) --- */

body.login.kl-login-page #nav,
body.login.kl-login-page #backtoblog {
    padding: 0;
    margin: 16px 0 0 0;
    text-align: center;
}

body.login.kl-login-page #nav a,
body.login.kl-login-page #backtoblog a {
    color: #888 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.login.kl-login-page #nav a:hover,
body.login.kl-login-page #backtoblog a:hover {
    color: var(--kl-accent, #00d4aa) !important;
}

/* Separator between nav links */
body.login.kl-login-page #nav {
    color: #555;
    font-size: 13px;
}



/* --- Footer Branding --- */

.kl-login-footer {
    margin-top: 40px;
    text-align: center;
    width: 100%;
}

.kl-login-footer p {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: #555;
    margin: 0;
}


/* --- Registration Form: Hide username field, style custom fields --- */

/* Hide the default username row on registration page */
body.login.kl-login-page #registerform > p:first-child {
    display: none !important;
}

/* Registration field hints */
.kl-field-hint {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    color: #999;
    margin-top: 4px;
    line-height: 1.4;
}

/* Registration field spacing */
.kl-reg-field {
    margin-bottom: 14px !important;
}

/* WP's default "A password reset link..." message — hide it since we have our own password field */
body.login.kl-login-page #registerform #reg_passmail {
    display: none !important;
}

body.login.kl-login-page #registerform p.description {
    display: none !important;
}

/* --- Password Strength Meter (WP registration) --- */

body.login.kl-login-page #pass-strength-result {
    border-radius: 8px;
    margin-top: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    padding: 8px 14px;
}

/* --- Password Indicator description --- */

body.login.kl-login-page .indicator-hint {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: #888;
}

body.login.kl-login-page p.description {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: #888;
}


/* --- WP privacy policy link (if shown) --- */

body.login.kl-login-page .privacy-policy-page-link {
    text-align: center;
    margin-top: 12px;
}

body.login.kl-login-page .privacy-policy-page-link a {
    color: #888;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    text-decoration: none;
}

body.login.kl-login-page .privacy-policy-page-link a:hover {
    color: var(--kl-accent, #00d4aa);
}


/* --- Button hide-if-no-js (show/hide password WP default) --- */

body.login.kl-login-page .wp-hide-pw,
body.login.kl-login-page .button.wp-hide-pw {
    display: none !important;
}

body.login.kl-login-page .user-pass-wrap {
    position: relative;
}


/* =========================================================
   Responsive — Mobile (max 768px)
   ========================================================= */

@media (max-width: 768px) {
    body.login.kl-login-page {
        padding: 24px 16px;
    }

    body.login.kl-login-page #login {
        max-width: 100%;
    }

    body.login.kl-login-page #loginform,
    body.login.kl-login-page #registerform,
    body.login.kl-login-page #lostpasswordform,
    body.login.kl-login-page #resetpassform {
        padding: 28px 24px;
        border-radius: 14px;
    }

    .kl-login-logo {
        margin-bottom: 24px;
    }

    .kl-logo-name {
        font-size: 19px;
    }

    .kl-login-tabs {
        margin-bottom: 20px;
    }

    .kl-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .kl-login-footer {
        margin-top: 28px;
    }
}


/* =========================================================
   Responsive — Small mobile (max 400px)
   ========================================================= */

@media (max-width: 400px) {
    body.login.kl-login-page #loginform,
    body.login.kl-login-page #registerform,
    body.login.kl-login-page #lostpasswordform,
    body.login.kl-login-page #resetpassform {
        padding: 24px 20px;
    }

    .kl-tab {
        padding: 10px 10px;
        font-size: 12.5px;
        gap: 6px;
    }

    .kl-logo-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}
