/* ============================================================
   Custom Login Page - Modern Bright Design
   ============================================================ */

/* ---------- Background & Layout ---------- */
body.login {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: cl-gradient-shift 15s ease infinite;
    overflow-x: hidden;
}

@keyframes cl-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Floating Particles ---------- */
.cl-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cl-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: cl-float linear infinite;
}

@keyframes cl-float {
    0%   { transform: translateY(0) translateX(0) scale(1); }
    25%  { transform: translateY(-120px) translateX(40px) scale(1.2); }
    50%  { transform: translateY(-60px) translateX(-30px) scale(0.8); }
    75%  { transform: translateY(-160px) translateX(20px) scale(1.1); }
    100% { transform: translateY(0) translateX(0) scale(1); }
}

/* ---------- Login Container ---------- */
#login {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10;
    width: 420px !important;
    max-width: 92vw;
    padding: 0 !important;
    margin: 0 !important;
    animation: cl-card-appear 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cl-card-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
}

/* ---------- Logo Area ---------- */
#login h1 {
    margin: 0;
    padding: 0;
}

#login h1 a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: auto !important;
    margin: 0 0 28px 0 !important;
    padding: 0;
    background: none !important;
    text-indent: 0 !important;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    overflow: visible !important;
    text-decoration: none;
}

/* ---------- Form Card ---------- */
#loginform {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
    padding: 40px 36px 36px !important;
    margin: 0 !important;
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#loginform:hover {
    box-shadow:
        0 12px 48px rgba(102, 126, 234, 0.28),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-2px);
}

/* ---------- Labels ---------- */
#loginform label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
    display: block;
    margin-bottom: 6px;
}

#loginform label[for="user_login"]::before {
    content: "\f110";
    font-family: dashicons;
    margin-right: 6px;
    color: #667eea;
    font-size: 14px;
    vertical-align: middle;
}

#loginform label[for="user_pass"]::before {
    content: "\f145";
    font-family: dashicons;
    margin-right: 6px;
    color: #667eea;
    font-size: 14px;
    vertical-align: middle;
}

/* ---------- Input Fields ---------- */
#loginform .input,
#loginform input[type="text"],
#loginform input[type="password"] {
    width: 100% !important;
    height: 50px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-weight: 400;
    color: #1f2937 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 14px !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    margin-bottom: 4px !important;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus {
    border-color: #667eea !important;
    background: white !important;
    box-shadow:
        0 0 0 4px rgba(102, 126, 234, 0.15),
        0 2px 8px rgba(102, 126, 234, 0.1) !important;
}

#loginform input[type="text"]::placeholder,
#loginform input[type="password"]::placeholder {
    color: #9ca3af;
}

#loginform .user-pass-wrap {
    margin-bottom: 4px !important;
}

/* WP default form-group spacing override */
#loginform p {
    margin-bottom: 18px !important;
}

#loginform p.forgetmenot {
    margin-bottom: 0 !important;
}

/* ---------- Password Toggle (WP's eye icon) ---------- */
.wp-pwd {
    position: relative;
}

.wp-pwd .button.wp-hide-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #9ca3af !important;
    padding: 4px 8px !important;
    min-height: auto !important;
    box-shadow: none !important;
    transition: color 0.2s;
}

.wp-pwd .button.wp-hide-pw:hover {
    color: #667eea !important;
}

/* ---------- Remember Me ---------- */
.forgetmenot {
    display: flex !important;
    align-items: center;
    margin-top: 4px !important;
}

.forgetmenot label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.forgetmenot label::before {
    display: none !important;
}

.forgetmenot input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 6px !important;
    accent-color: #667eea;
    cursor: pointer;
    margin: 0 !important;
}

/* ---------- Submit Button ---------- */
#wp-submit {
    width: 100% !important;
    height: 52px !important;
    margin-top: 20px !important;
    padding: 0 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    letter-spacing: 0.02em;
    color: white !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer;
    box-shadow:
        0 4px 15px rgba(102, 126, 234, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
}

#wp-submit:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4196 100%) !important;
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.45),
        0 4px 8px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

#wp-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(102, 126, 234, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Submit row layout */
.submit {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
}

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

#nav a, #backtoblog a {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

#nav a:hover, #backtoblog a:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

#nav {
    margin-top: 20px !important;
}

/* ---------- Error / Messages ---------- */
#login_error,
.message,
.success {
    border-radius: 16px !important;
    border: none !important;
    padding: 16px 20px !important;
    margin: 0 0 20px 0 !important;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: cl-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-left: none !important;
}

#login_error {
    background: linear-gradient(135deg, #fff5f5, #ffe3e3) !important;
    color: #c0392b !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.12) !important;
}

#login_error a {
    color: #e74c3c !important;
    font-weight: 600;
}

.message {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe) !important;
    color: #1e40af !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1) !important;
}

.success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
    color: #166534 !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.1) !important;
}

@keyframes cl-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* ---------- Language Switcher ---------- */
.language-switcher {
    position: absolute !important;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    width: auto;
}

.language-switcher label {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 12px !important;
}

.language-switcher select {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 10px !important;
    padding: 6px 12px !important;
    font-size: 12px;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.language-switcher select option {
    background: #374151;
    color: white;
}

.language-switcher .button.wp-hide-pw,
.language-switcher input[type="submit"] {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 10px !important;
    padding: 6px 16px !important;
    font-size: 12px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none !important;
    text-shadow: none !important;
    height: auto !important;
    min-height: auto !important;
}

.language-switcher input[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

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

.privacy-policy-page-link a {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 11px;
    text-decoration: none !important;
}

.privacy-policy-page-link a:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ---------- WP Admin Bar Overrides ---------- */
body.login .interim-login {
    background: transparent !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    body.login {
        padding: 20px;
    }

    #login {
        width: 100% !important;
    }

    #loginform {
        padding: 32px 24px 28px !important;
        border-radius: 20px !important;
    }

    #login h1 a {
        font-size: 26px;
    }

    #loginform .input,
    #loginform input[type="text"],
    #loginform input[type="password"] {
        height: 46px !important;
        border-radius: 12px !important;
    }

    #wp-submit {
        height: 48px !important;
        border-radius: 12px !important;
    }
}

/* ---------- Dark mode preference ---------- */
@media (prefers-color-scheme: dark) {
    #loginform {
        background: rgba(30, 32, 44, 0.88) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    #loginform label {
        color: #e5e7eb;
    }

    #loginform label::before {
        color: #818cf8;
    }

    #loginform .input,
    #loginform input[type="text"],
    #loginform input[type="password"] {
        background: rgba(55, 65, 81, 0.7) !important;
        border-color: rgba(75, 85, 99, 0.8) !important;
        color: #f3f4f6 !important;
    }

    #loginform input[type="text"]:focus,
    #loginform input[type="password"]:focus {
        background: rgba(55, 65, 81, 0.9) !important;
        border-color: #818cf8 !important;
        box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2),
                    0 2px 8px rgba(129, 140, 248, 0.1) !important;
    }

    .forgetmenot label {
        color: #9ca3af !important;
    }

    #wp-submit {
        background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%) !important;
    }

    #wp-submit:hover {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    }
}
