/* Modern Color Palette - Red Theme */
:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --secondary-color: #fef2f2;
    --accent-color: #f97316;
    --success-color: #10b981;
    --error-color: #dc2626;
    --border-color: #e2e8f0;
    --border-color-hover: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --input-bg: #ffffff;
    --input-focus-bg: #fef2f2;
    --section-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

/* ===== CUSTOM LOGIN FORM STYLES ===== */

.rm-form {
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* Label Styling */
.rm-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.rm-form label .required-asterisk {
    color: var(--error-color);
    font-weight: 600;
}

.rm-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

/* Input Field Styling */
.rm-form input[type="text"],
.rm-form input[type="email"],
.rm-form input[type="password"],
.rm-form input[type="checkbox"] {
    font-family: inherit;
    line-height: 1.5;
}

.rm-form input[type="email"],
.rm-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rm-form input::placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.rm-form input:hover {
    border-color: var(--border-color-hover);
}

.rm-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}

.rm-form input:focus::placeholder {
    color: var(--text-secondary);
}

/* Password Field */
.rm-password-wrap {
    position: relative;
}

.rm-password-toggle:hover {
    color: var(--text-primary) !important;
}

/* Submit Button */
.rm-form button[type="submit"],
.rm-submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: 100%;
    margin-top: 16px;
}

.rm-form button[type="submit"]:hover,
.rm-submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rm-form button[type="submit"]:active,
.rm-submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.rm-form button[type="submit"]:disabled,
.rm-submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 4px;
    min-height: 20px;
}

.rm-form-errors-top {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    color: var(--error-color);
    display: none;
    font-size: 14px;
    font-weight: 500;
}

.rm-form-errors-top.has-errors {
    display: block;
    animation: slideIn 0.3s ease;
}

/* Loading Overlay */
.rm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.rm-loading-message {
    margin-top: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.rm-form {
    animation: slideIn 0.5s ease-out;
}

.form-group {
    animation: slideIn 0.3s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }

/* Link Hover Effects */
.rm-form a:hover {
    opacity: 0.8;
}

/* ===== WORDPRESS LOGIN PAGE OVERRIDE STYLES ===== */

/* Body and Background */
body.login {
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Login Container */
#login {
    width: 450px;
    padding: 5% 0 0;
}

/* Site Name/Logo Area */
.login h1 {
    text-align: center;
    margin-bottom: 30px;
}

.login h1 a {
    background-image: none !important;
    width: 100%;
    height: auto;
    text-indent: 0;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    display: block;
}

/* Hide site name and show only Welcome Back */
.login h1 a {
    text-indent: -9999px !important;
    overflow: hidden;
}

/* Add welcome text above form */
.login h1 a::after {
    content: 'Welcome Back';
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    text-indent: 0;
}

/* Login Form */
#loginform,
#registerform,
#lostpasswordform {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 45px 40px;
    border: none;
    margin-top: 0;
}

/* Form Labels */
.login label {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0;
    display: block;
    margin-bottom: 8px;
}

/* Input Fields */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 15px;
    color: #2c3e50;
    box-shadow: none;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 0;
    margin-bottom: 20px;
}

.login input[type="text"]:hover,
.login input[type="password"]:hover,
.login input[type="email"]:hover {
    border-color: #9ca3af;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    background-color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    outline: none;
    transform: none;
}

/* Placeholder styling */
.login input::placeholder {
    color: #9ca3af;
    font-size: 14px;
}

/* Ensure password field wrapper has proper positioning */
.login .user-pass-wrap {
    position: relative;
}

/* Password field padding for custom toggle */
.login input[type="password"] {
    padding-right: 50px !important;
}

/* Show WordPress default password toggle but style it nicely */
.login .wp-hide-pw,
.login .button.wp-hide-pw,
.login button.wp-hide-pw {
    position: absolute !important;
    right: 12px !important;
    top: 30% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    transition: color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    font-size: 0 !important;
}

.login .wp-hide-pw:hover,
.login button.wp-hide-pw:hover {
    color: #dc2626 !important;
    background: transparent !important;
}

.login .wp-hide-pw .dashicons,
.login button.wp-hide-pw .dashicons {
    width: 20px !important;
    height: 20px !important;
    font-size: 20px !important;
}

/* Custom eye icon toggle */
.rm-password-toggle-wp {
    position: absolute !important;
    right: 16px !important;
    top: 40% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    padding: 8px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    transition: color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
}

.rm-password-toggle-wp:hover {
    color: #dc2626 !important;
}

/* Remember Me Checkbox */
.login .forgetmenot {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    margin-top: 8px;
}

.login input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    margin-top: 0;
    cursor: pointer;
    accent-color: #dc2626;
}

.login .forgetmenot label {
    font-weight: 400;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    margin-bottom: 0;
}

/* Submit Button */
.login .button-primary {
    background: #dc2626 !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2) !important;
    text-shadow: none !important;
    color: #ffffff !important;
    padding: 12px 32px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    width: 100% !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    margin-top: 15px !important;
}

.login .button-primary:hover,
.login .button-primary:focus {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3) !important;
}

.login .button-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2) !important;
}

/* Lost Password Link */
#nav,
#backtoblog {
    text-align: center;
    padding: 0;
    margin: 20px 0 0 0;
}

#nav a,
#backtoblog a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    transition: color 0.2s ease;
}

#nav a:hover,
#backtoblog a:hover {
    color: #2c3e50;
}

/* Messages and Errors */
.login .message,
.rm-message {
    border-left: 3px solid #10b981;
    background: #f0fdf4;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    border-radius: 6px;
    font-size: 14px;
    color: #065f46;
}

.rm-message.rm-success {
    border-left-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.rm-message.rm-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.login #login_error,
.rm-error-message {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #991b1b;
    box-shadow: none;
}

/* Remove default error styling */
.login #login_error {
    box-shadow: none;
    border: none;
    border-left: 3px solid #dc2626;
}

/* Footer Text */
.rm-login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.rm-login-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.rm-login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.rm-login-footer a:hover {
    opacity: 0.8;
}

/* Privacy and Language Chooser at bottom */
.login #language-switcher,
.privacy-policy-page-link {
    margin-top: 20px;
}

.login #language-switcher label,
.privacy-policy-page-link a {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Interim Login */
.interim-login #login {
    padding-top: 3%;
}

/* Password Strength Meter */
#pass-strength-result {
    border-radius: 8px;
    margin: 8px 0;
}

#pass-strength-result.strong {
    background-color: #f0fdf4;
    border-color: var(--success-color);
}

#pass-strength-result.short,
#pass-strength-result.bad {
    background-color: #fef2f2;
    border-color: var(--error-color);
}

#pass-strength-result.good {
    background-color: #fff7ed;
    border-color: var(--accent-color);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loginform,
#registerform,
#lostpasswordform {
    animation: fadeIn 0.5s ease-out;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .rm-form {
        margin: 20px auto;
        padding: 30px 24px;
        max-width: 95%;
    }

    #login {
        width: 90%;
        padding: 5% 0 0;
    }

    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 30px 24px;
    }

    .login h1::after {
        font-size: 28px;
    }

    .login h1::before {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .rm-form {
        padding: 24px 20px;
    }

    .rm-form input[type="email"],
    .rm-form input[type="password"] {
        font-size: 14px;
        padding: 10px 14px;
    }

    .rm-form button[type="submit"],
    .rm-submit-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 24px 20px;
    }

    .login input[type="text"],
    .login input[type="password"],
    .login input[type="email"] {
        font-size: 14px;
        padding: 10px 14px;
    }

    .login .button-primary {
        padding: 12px 24px !important;
        font-size: 15px !important;
    }
}

/* Hide shake error animation and use our own */
.shake {
    animation: shake 0.5s;
}
