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

:root {
    --primary-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-hover: #3a0ca3;
    --accent-color: #f72585;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --bg-color: linear-gradient(135deg, #020518 0%, #030517 100%);
    --form-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.07);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body.login.dark-mode {
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --bg-color: #0f172a;
    --form-bg: #1e293b;
    --border-color: #334155;
}

body.login {
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* ===== Login Container ===== */
#login {
    width: 100%;
    max-width: 420px;
    padding: 0;
    position: relative;
    z-index: 10;
}

/* ===== Logo Styles ===== */
#login h1 {
    text-align: center;
    margin-bottom: 40px;
}

#login h1 a {
    background-image: url('../images/cropped-logo-180x180.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 200px;
    height: 60px;
    display: block;
    margin: 0 auto;
    text-indent: -9999px;
}

/* ===== Login Form Container ===== */
.login form {
    margin-top: 0;
    margin-left: 0;
    padding: 40px;
    background: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login form:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ===== Form Labels and Text ===== */
.login label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.login .forgetmenot label {
    display: inline;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Input Field Styles ===== */
.login input[type="text"],
.login input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    outline: none;
    font-family: inherit;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: transparent;
}

.login input[type="text"]:hover,
.login input[type="password"]:hover {
    border-color: #cbd5e1;
}

/* ===== Remember Me Checkbox ===== */
input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.button.wp-hide-pw {
    display: none !important;
}

/* Hide password visibility toggle icons */
.dashicons-visibility,
.dashicons-hidden {
    display: none !important;
}

/* Adjust password input padding for hidden button */
#user_pass {
    padding-right: 16px !important;
}

/* Remove hover effects for hidden button */
#user_pass:focus ~ .button.wp-hide-pw,
.wp-hide-pw:focus {
    display: none !important;
}

/* ===== Submit Button Styles ===== */
.login .button-primary {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login .button-primary:hover,
.login .button-primary:focus {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.login .button-primary:active {
    transform: translateY(0);
}

.login .button-primary.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: button-spinner 0.6s linear infinite;
}

@keyframes button-spinner {
    to { transform: rotate(360deg); }
}

/* ===== Bottom Links ===== */
.login #nav,
.login #backtoblog {
    margin: 0;
    padding: 15px 0;
    text-align: center;
}

.login #nav a,
.login #backtoblog a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
}

.login #nav a:hover,
.login #backtoblog a:hover {
    color: white;
    transform: translateY(-1px);
}

/* ===== Remove Language Switcher ===== */
#language-switcher,
.login .language-switcher,
.language-switcher {
    display: none !important;
}

/* ===== Dark Mode Toggle ===== */
.theme-switch-wrapper {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 100;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 120px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(86px);
}

.theme-label {
    position: absolute;
    left: 40px;
    top: 8px;
    font-size: 12px;
    color: white;
    pointer-events: none;
    font-weight: 500;
}

/* ===== Custom Decorative Elements ===== */
.login-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decoration-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(58, 12, 163, 0.05));
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 30%;
    right: 20%;
}

/* ===== Footer Styles ===== */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    z-index: 10;
}

/* ===== Custom Message Styles ===== */
.custom-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.custom-message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border-left: 4px solid #ef4444;
    color: #dc2626;
}

.custom-message.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
    border-left: 4px solid #22c55e;
    color: #16a34a;
}

.custom-message .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

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

    #login h1 a {
        width: 150px;
        height: 45px;
    }

    .theme-switch-wrapper {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 auto 20px;
        display: flex;
        justify-content: center;
    }

    .login-footer {
        position: relative;
        margin-top: 40px;
    }
}

/* ===== Animation Effects ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Form Error States ===== */
input.error {
    border-color: #ef4444 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== Loading States ===== */
.login-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}