/**
 * Custom WordPress Login Page Styles
 * Matches CAM Dashboard UI Theme
 */

/* ================================
   CSS Variables - CAM Brand Theme
   ================================ */
:root {
    --cam-primary: #f5a623;
    --cam-primary-dark: #cd7f32;
    --cam-secondary: #9496b8;
    --cam-purple: #b06fff;
    --cam-pink: #ff5a87;
    --cam-dark: #1a1a2e;
    --cam-darker: #0f0f1a;
    --cam-white: #ffffff;
    --cam-text: #e0e0e0;
    --cam-text-muted: #a0a0b0;
    --cam-border: rgba(245, 166, 35, 0.2);
    --cam-glow: rgba(245, 166, 35, 0.4);
}

/* ================================
   Login Page Container
   ================================ */
body.login {
    background: linear-gradient(135deg, var(--cam-darker) 0%, var(--cam-dark) 50%, #1f1f3a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Animated Background Particles */
body.login::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(245, 166, 35, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(176, 111, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 90, 135, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Floating Orbs Animation */
body.login::after {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
    animation: floatOrb 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 30px) scale(1.1); }
}

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

/* ================================
   Login Header - Logo Area
   ================================ */
.login h1 {
    text-align: center;
    margin-bottom: 30px;
}

.login h1 a {
    width: 100%;
    height: 80px;
    margin: 0 auto;
    background: none;
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo Icon */
.login h1 a::before {
    content: '';
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--cam-primary) 0%, var(--cam-primary-dark) 100%);
    border-radius: 18px;
    box-shadow:
        0 8px 32px rgba(245, 166, 35, 0.3),
        0 0 0 1px rgba(245, 166, 35, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login h1 a::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>') center/contain no-repeat;
    filter: brightness(0) invert(1);
}

/* ================================
   Login Form Card
   ================================ */
.login form {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--cam-border);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(245, 166, 35, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 25px;
}

.login form::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cam-primary), transparent);
    border-radius: 0 0 3px 3px;
}

/* ================================
   Form Labels
   ================================ */
.login label {
    color: var(--cam-text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

/* ================================
   Input Fields
   ================================ */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--cam-white);
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    border-color: var(--cam-primary);
    background: rgba(245, 166, 35, 0.05);
    box-shadow:
        0 0 0 3px rgba(245, 166, 35, 0.15),
        0 0 20px rgba(245, 166, 35, 0.1);
    outline: none;
}

.login input[type="text"]::placeholder,
.login input[type="password"]::placeholder,
.login input[type="email"]::placeholder {
    color: var(--cam-text-muted);
    opacity: 0.7;
}

/* Input Icons Container */
.login form .input {
    position: relative;
    margin-bottom: 20px;
}

/* ================================
   Remember Me Checkbox
   ================================ */
.login .forgetmenot {
    float: none;
    margin-top: 5px;
}

.login .forgetmenot input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(245, 166, 35, 0.3);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.login .forgetmenot input[type="checkbox"]:checked {
    background: var(--cam-primary);
    border-color: var(--cam-primary);
}

.login .forgetmenot input[type="checkbox"]:checked::after {
    content: '✓';
    color: var(--cam-dark);
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login .forgetmenot label {
    color: var(--cam-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* ================================
   Submit Button
   ================================ */
.login .submit input[type="submit"],
.login form .wp-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--cam-primary) 0%, var(--cam-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: var(--cam-dark);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(245, 166, 35, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    text-shadow: none;
    margin-top: 10px;
}

.login .submit input[type="submit"]:hover,
.login form .wp-submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(245, 166, 35, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.login .submit input[type="submit"]:active,
.login form .wp-submit:active {
    transform: translateY(0);
}

/* ================================
   Lost Password Link
   ================================ */
.login #nav {
    text-align: center;
    margin-top: 20px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.login #nav a {
    color: var(--cam-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.login #nav a:hover {
    color: var(--cam-white);
    background: rgba(245, 166, 35, 0.1);
}

/* ================================
   Back to Blog Link
   ================================ */
.login #backtoblog {
    display: none;
}

/* ================================
   Error Messages
   ================================ */
.login .message,
.login #login_error {
    background: rgba(255, 90, 135, 0.1);
    border: 1px solid rgba(255, 90, 135, 0.3);
    border-left: 4px solid var(--cam-pink);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--cam-text);
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(255, 90, 135, 0.1);
}

.login #login_error a {
    color: var(--cam-pink);
}

/* Success Message */
.login .success {
    background: rgba(80, 200, 120, 0.1);
    border-color: rgba(80, 200, 120, 0.3);
    border-left-color: #50c878;
}

/* ================================
   Loading State
   ================================ */
.login form.loading {
    position: relative;
}

.login form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--cam-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ================================
   Divider
   ================================ */
.login .login-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--cam-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login .login-divider::before,
.login .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cam-border), transparent);
}

/* ================================
   Social Login Buttons (if needed)
   ================================ */
.login .social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.login .social-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--cam-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--cam-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login .social-btn:hover {
    background: rgba(245, 166, 35, 0.1);
    border-color: var(--cam-primary);
}

/* ================================
   Footer Branding
   ================================ */
.login #footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--cam-text-muted);
    font-size: 12px;
    z-index: 1;
}

.login #footer a {
    color: var(--cam-primary);
    text-decoration: none;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 480px) {
    #login {
        padding: 15px;
    }

    .login form {
        padding: 30px 25px;
    }

    .login h1 a::before {
        width: 60px;
        height: 60px;
    }
}

/* ================================
   Accessibility - Focus Visible
   ================================ */
.login :focus-visible {
    outline: 2px solid var(--cam-primary);
    outline-offset: 2px;
}

/* ================================
   Dark Mode Enhancements
   ================================ */
@media (prefers-color-scheme: dark) {
    .login form {
        background: rgba(20, 20, 35, 0.98);
    }
}

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

.login form {
    animation: fadeInUp 0.5s ease-out;
}

.login h1 {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.login #nav {
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}
