/*
 * WL Login UI CSS
 * Minimalistic, elegant WordPress login page styling
 */

/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%) !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* Animated background effect */
body.login::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(12, 164, 231, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

input[type=checkbox]:checked::before {
    display: none !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.5;
    }
}

/* Position login container */
body.login div#login {
    width: 100%;
    max-width: 420px;
    padding: 0;
    margin: 40px auto;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: 1;
}

/* Hide WordPress default elements immediately */
body.login #login h1 {
    display: none !important;
}

body.login #login > form:not(.wl-login-container form),
body.login #backtoblog,
body.login #nav,
body.login #language-switcher {
    display: none !important;
}

/* Hide the default form while it's being wrapped */
body.login #login > form {
    visibility: hidden;
    position: absolute;
    opacity: 0;
    height: 0;
}

/* Show form when WL Login UI is ready */
body.login .wl-login-container form {
    visibility: visible !important;
    position: static !important;
    opacity: 1 !important;
    height: auto !important;
}

/* Ensure error messages are visible in custom form containers */
body.login .wl-login-container #login_error,
body.login .wl-login-form #login_error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    height: auto !important;
}

/* WL Login Container */
.wl-login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.wl-login-card {
    background: rgba(20, 28, 38, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 35px 30px;
    min-height: auto;
    position: relative;
    box-shadow: 0 20px 60px rgb(0 0 0 / 32%), 0 0 1px rgba(12, 164, 231, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(12, 164, 231, 0.1);
}

/* Brand Logo */
.wl-logo {
    text-align: center;
    margin-bottom: 16px;
}

.wl-logo-img {
    width: 48px;
    height: auto;
}

/* WL Login Heading */
.wl-login-heading {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    text-align: center;
    margin-bottom: 6px !important;
    line-height: 32px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
    letter-spacing: -0.5px;
}

/* Subtitle */
.wl-login-subtitle {
    color: #8b98a5;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    line-height: 20px;
}

/* Form Container */
.wl-login-form {
    width: 100%;
}

/* Form Styles */
body.login form {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Input Fields */
body.login form label {
    color: #c9d4df;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.2px;
}

body.login form input[type="text"],
body.login form input[type="password"],
body.login form input[type="email"] {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(139, 152, 165, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
    height: auto !important;
    line-height: 20px;
    font-weight: 400;
}

body.login form input[type="text"]:hover,
body.login form input[type="password"]:hover,
body.login form input[type="email"]:hover {
    border-color: rgba(12, 164, 231, 0.3) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

body.login form input[type="text"]:focus,
body.login form input[type="password"]:focus,
body.login form input[type="email"]:focus {
    border-color: #0ca4e7 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(12, 164, 231, 0.12) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

body.login form input[type="text"]::placeholder,
body.login form input[type="password"]::placeholder,
body.login form input[type="email"]::placeholder {
    color: #6b7684;
}

/* Remember Me Toggle */
body.login form .forgetmenot {
    display: block !important;
    margin-bottom: 16px !important;
    float: none !important;
}

body.login form .forgetmenot label {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    margin-bottom: 0 !important;
    cursor: pointer;
    white-space: nowrap;
    float: none !important;
}

/* Toggle Track */
body.login form .forgetmenot input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px !important;
    height: 22px !important;
    margin: 0 12px 0 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(139, 152, 165, 0.2) !important;
    border-radius: 20px !important;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none !important;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Toggle Knob */
body.login form .forgetmenot input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    width: 14px;
    height: 14px;
    background: #c9d4df;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
}

/* Checked State */
body.login form .forgetmenot input[type="checkbox"]:checked {
    background-color: #0ca4e7 !important;
    border-color: #0ca4e7 !important;
    background-image: none !important;
}

body.login form .forgetmenot input[type="checkbox"]:checked::after {
    transform: translate(18px, -50%);
    background: #ffffff;
}

/* Hover State */
body.login form .forgetmenot input[type="checkbox"]:hover {
    border-color: rgba(12, 164, 231, 0.5) !important;
}

body.login form .forgetmenot input[type="checkbox"]:hover::after {
    background: #ffffff;
}

/* Submit Button */
body.login form input[type="submit"] {
    background: linear-gradient(135deg, #0ca4e7 0%, #0892d0 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: none !important;
    box-shadow: 0 4px 16px rgba(12, 164, 231, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2) !important;
    height: 44px !important;
    line-height: 20px !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: 0.3px;
    font-family: 'Roboto', sans-serif !important;
}

body.login form input[type="submit"]:hover {
    background: linear-gradient(135deg, #0b93d1 0%, #0781ba 100%) !important;
    box-shadow: 0 6px 20px rgba(12, 164, 231, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body.login form input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(12, 164, 231, 0.3) !important;
}

/* Forgot Password Button */
.wl-forgot-btn {
    display: block;
    width: 100%;
    background: transparent !important;
    border: 1px solid rgba(139, 152, 165, 0.3) !important;
    border-radius: 8px !important;
    color: #c9d4df !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 11px 20px !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    margin-bottom: 24px;
    line-height: 20px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.2px;
}

.wl-forgot-btn:hover {
    background: rgba(12, 164, 231, 0.08) !important;
    border-color: rgba(12, 164, 231, 0.4) !important;
    color: #0ca4e7 !important;
}

/* Sign Up Link */
.wl-signup-link {
    color: #8b98a5;
    font-size: 14px;
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(139, 152, 165, 0.15);
    font-weight: 400;
}

.wl-signup-link a {
    color: #0ca4e7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.wl-signup-link a:hover {
    color: #0b93d1;
    text-decoration: underline;
}

/* Footer */
.wl-login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    background: transparent;
    z-index: 1;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a,
.footer-links li a {
    color: #6b7684;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 400;
    display: inline-block;
}

.footer-links a:hover,
.footer-links li a:hover {
    color: #0ca4e7;
}

/* WordPress menu styling */
.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    margin: 0;
    padding: 0;
}

.footer-copyright {
    text-align: center;
    color: #6b7684;
    font-size: 13px;
    font-weight: 400;
}

/* Error Messages */
body.login #login_error,
body.login .message {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
    border-radius: 6px;
    color: #fca5a5;
    padding: 12px 14px;
    margin: 0 0 16px 0;
    font-size: 13px;
    backdrop-filter: blur(10px);
    font-weight: 400;
}

body.login .message {
    background: rgba(12, 164, 231, 0.15);
    border-left: 4px solid #0ca4e7;
    color: #7dd3fc;
}

/* Hide empty error containers */
body.login #login_error:empty,
body.login .message:empty,
.validation-error:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Privacy Links */
body.login .privacy-policy-page-link,
body.login .privacy-policy-link {
    display: none;
}

/* Lost Password Page */
body.login.login-action-lostpassword .wl-login-heading {
    font-size: 28px !important;
}

body.login.login-action-lostpassword form label[for="user_login"] {
    color: #c9d4df;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Register Page */
body.login.login-action-register .wl-login-heading {
    font-size: 28px !important;
}

body.login.login-action-register form label {
    color: #c9d4df;
    font-size: 14px;
}

body.login.login-action-register form input[type="text"],
body.login.login-action-register form input[type="email"] {
    margin-bottom: 20px !important;
}

/* Hide "Register For This Site" notice */
body.login.login-action-register .notice.notice-info.message.register,
body.login.login-action-register .message.register {
    display: none !important;
}

/* Style registration confirmation text */
body.login #reg_passmail {
    color: #8b98a5 !important;
    font-size: 13px !important;
    margin-top: 8px !important;
    margin-bottom: 16px !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
}

body.login .wl-login-form #reg_passmail {
    color: #8b98a5 !important;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body.login div#login {
        max-width: 90%;
    }

    .wl-login-card {
        padding: 30px 25px;
        min-height: auto;
        border-radius: 14px;
    }

    .wl-login-heading {
        font-size: 24px !important;
        margin-bottom: 6px !important;
    }

    .wl-login-subtitle {
        font-size: 13px;
    }

    .wl-logo-img {
        width: 44px;
    }

    .footer-links {
        gap: 14px;
    }

    .footer-links a {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .wl-login-card {
        padding: 24px 18px;
        border-radius: 12px;
    }

    .wl-logo {
        margin-bottom: 16px;
    }

    .wl-login-heading {
        font-size: 20px !important;
        margin-bottom: 6px !important;
    }

    .wl-login-subtitle {
        font-size: 12px;
    }

    body.login form label {
        margin-bottom: 8px !important;
    }

    body.login form input[type="text"],
    body.login form input[type="password"],
    body.login form input[type="email"] {
        font-size: 14px !important;
        padding: 10px 12px !important;
        border-radius: 6px !important;
        margin-bottom: 12px !important;
    }

    /* Minimalist Toggle on Mobile */
    body.login form .forgetmenot input[type="checkbox"] {
        width: 32px !important;
        height: 18px !important;
        margin: 0 8px 0 0 !important;
    }

    body.login form .forgetmenot input[type="checkbox"]::after {
        width: 12px;
        height: 12px;
        left: 3px;
    }

    body.login form .forgetmenot input[type="checkbox"]:checked::after {
        transform: translate(14px, -50%);
    }

    body.login form input[type="submit"],
    .wl-forgot-btn {
        border-radius: 6px !important;
        height: 40px !important;
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }

    .wl-forgot-btn {
        padding: 8px 10px !important;
        font-size: 13px !important;
        margin-bottom: 16px;
    }

    .wl-logo-img {
        width: 42px;
    }

    .wl-signup-link {
        margin-top: 16px;
        padding-top: 16px;
    }

    .footer-links {
        gap: 10px;
        font-size: 11px;
    }
}

/* Loading State */
body.login form.loading input[type="submit"] {
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Accessibility */
body.login form input[type="text"]:focus,
body.login form input[type="password"]:focus,
body.login form input[type="email"]:focus,
body.login form input[type="submit"]:focus,
.wl-forgot-btn:focus {
    outline: 2px solid #0ca4e7;
    outline-offset: 3px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wl-login-card {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interim Login Messages */
body.login .message.interim-login {
    background: rgba(12, 164, 231, 0.15);
    border-left-color: #0ca4e7;
    color: #7dd3fc;
}

/* Password Strength Meter */
body.login #pass-strength-result {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(139, 152, 165, 0.2) !important;
    color: #8b98a5 !important;
    padding: 10px 16px;
    margin-top: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

body.login #pass-strength-result.strong {
    color: #34d399 !important;
    border-color: #34d399 !important;
    background: rgba(52, 211, 153, 0.1) !important;
}

body.login #pass-strength-result.short,
body.login #pass-strength-result.bad {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

body.login #pass-strength-result.good {
    color: #0ca4e7 !important;
    border-color: #0ca4e7 !important;
    background: rgba(12, 164, 231, 0.1) !important;
}

/* Glow effect on focus */
body.login form input[type="text"]:focus,
body.login form input[type="password"]:focus,
body.login form input[type="email"]:focus {
    position: relative;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 28, 38, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(12, 164, 231, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(12, 164, 231, 0.5);
}

/* ===== THEME SUPPORT ===== */

/* Dark Theme */
html[data-user-theme="dark"] body.login {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%) !important;
}

html[data-user-theme="dark"] .wl-login-card {
    background: #202327 !important;
    backdrop-filter: blur(20px);
}

/* Light Theme */
html[data-user-theme="light"] body.login {
    background: #f2f2f2 !important;
}

html[data-user-theme="light"] .wl-login-card {
    background: #ffffff !important;
    box-shadow: 0 1px 2px hsl(240 3.8% 46.1% / 12%) !important;
}

/* Light Theme Text Colors */
html[data-user-theme="light"] .wl-login-heading {
    color: #1a1a1a !important;
}

html[data-user-theme="light"] .wl-login-subtitle {
    color: #555555;
}

html[data-user-theme="light"] form label {
    color: #333333 !important;
}

html[data-user-theme="light"] form input[type="text"],
html[data-user-theme="light"] form input[type="password"],
html[data-user-theme="light"] form input[type="email"] {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #1a1a1a !important;
}

html[data-user-theme="light"] form input[type="text"]:hover,
html[data-user-theme="light"] form input[type="password"]:hover,
html[data-user-theme="light"] form input[type="email"]:hover {
    border-color: rgba(0, 0, 0, 0.3) !important;
    background: rgba(0, 0, 0, 0.08) !important;
}

html[data-user-theme="light"] form input[type="text"]:focus,
html[data-user-theme="light"] form input[type="password"]:focus,
html[data-user-theme="light"] form input[type="email"]:focus {
    border-color: #2199d1 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(33, 153, 209, 0.12) !important;
    background: rgba(0, 0, 0, 0.08) !important;
}

html[data-user-theme="light"] body.login form .forgetmenot input[type="checkbox"] {
    background: rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

html[data-user-theme="light"] body.login form .forgetmenot input[type="checkbox"]::after {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

html[data-user-theme="light"] body.login form .forgetmenot input[type="checkbox"]:checked {
    background-color: #2199d1 !important;
    border-color: #2199d1 !important;
}

html[data-user-theme="light"] body.login form .forgetmenot input[type="checkbox"]:hover {
    border-color: rgba(0, 0, 0, 0.3) !important;
}

html[data-user-theme="light"] .wl-signup-link {
    color: #666666;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-user-theme="light"] .footer-links a,
html[data-user-theme="light"] .footer-links li a {
    color: #666666;
}

/* Registration confirmation text for different themes */
html[data-user-theme="dark"] #reg_passmail,
html[data-user-theme="dark"] .wl-login-form #reg_passmail {
    color: #8b98a5 !important;
}

html[data-user-theme="light"] #reg_passmail,
html[data-user-theme="light"] .wl-login-form #reg_passmail {
    color: #8b98a5 !important;
}

html[data-user-theme="blue"] #reg_passmail,
html[data-user-theme="blue"] .wl-login-form #reg_passmail {
    color: #8b98a5 !important;
}

/* Blue Theme - Default */
html[data-user-theme="blue"] body.login {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%) !important;
}

html[data-user-theme="blue"] .wl-login-card {
    background: rgba(20, 28, 38, 0.95) !important;
    backdrop-filter: blur(20px);
}

/* All Themes - Link and Button Colors */
html[data-user-theme="dark"] form input[type="submit"],
html[data-user-theme="light"] form input[type="submit"],
html[data-user-theme="blue"] form input[type="submit"] {
    background: linear-gradient(135deg, #2199d1 0%, #1a7ba8 100%) !important;
    box-shadow: 0 4px 16px rgba(33, 153, 209, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

html[data-user-theme="dark"] form input[type="submit"]:hover,
html[data-user-theme="light"] form input[type="submit"]:hover,
html[data-user-theme="blue"] form input[type="submit"]:hover {
    background: linear-gradient(135deg, #1a7ba8 0%, #155a7e 100%) !important;
    box-shadow: 0 6px 20px rgba(33, 153, 209, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-user-theme="dark"] .wl-forgot-btn,
html[data-user-theme="light"] .wl-forgot-btn,
html[data-user-theme="blue"] .wl-forgot-btn {
    color: #2199d1 !important;
}

html[data-user-theme="dark"] .wl-forgot-btn:hover,
html[data-user-theme="light"] .wl-forgot-btn:hover,
html[data-user-theme="blue"] .wl-forgot-btn:hover {
    background: rgba(33, 153, 209, 0.08) !important;
    border-color: rgba(33, 153, 209, 0.4) !important;
    color: #2199d1 !important;
}

html[data-user-theme="dark"] .wl-signup-link a,
html[data-user-theme="light"] .wl-signup-link a,
html[data-user-theme="blue"] .wl-signup-link a {
    color: #2199d1 !important;
}

html[data-user-theme="dark"] .wl-signup-link a:hover,
html[data-user-theme="light"] .wl-signup-link a:hover,
html[data-user-theme="blue"] .wl-signup-link a:hover {
    color: #1a7ba8 !important;
}

html[data-user-theme="dark"] .footer-links a:hover,
html[data-user-theme="dark"] .footer-links li a:hover,
html[data-user-theme="light"] .footer-links a:hover,
html[data-user-theme="light"] .footer-links li a:hover,
html[data-user-theme="blue"] .footer-links a:hover,
html[data-user-theme="blue"] .footer-links li a:hover {
    color: #2199d1 !important;
}
