/* ================================================================
   LOGIN PAGE STYLES
   Theme-aware styling for light/dark modes
   Uses global CSS variables from theme-variables.css
   ================================================================ */

/* ===== Password Field with Toggle ===== */
.password-container {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.password-container input {
    padding-right: 52px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
}

.toggle-password:hover {
    opacity: 1;
    background: linear-gradient(135deg, var(--accent-purple-15), var(--accent-pink-15));
    transform: translateY(-50%) scale(1.1);
}

.toggle-password::before {
    content: "\f070"; /* Font Awesome eye-slash icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--accent-purple);
    font-size: 15px;
    transition: all 0.3s ease;
}

.toggle-password:hover::before {
    color: var(--accent-pink);
}

.toggle-password.visible::before {
    content: "\f06e"; /* Font Awesome eye icon */
    color: var(--accent-cyan);
}

/* ===== Remember Me & Forgot Password ===== */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 340px;
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-forgot label {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    color: var(--text-secondary);
}

.remember-forgot label:hover {
    color: var(--text-primary);
}

.remember-forgot input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.remember-forgot a {
    position: relative;
    transition: all 0.3s ease;
}

.remember-forgot a:hover {
    color: var(--accent-pink);
}

/* Register link text */
.register-text a {
    position: relative;
    display: inline-block;
}

/* ===== Login Button Enhancement ===== */
form button[type="submit"] {
    height: 3rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.75rem;
}

/* ===== Social Login Section ===== */
.social-login {
    margin-top: 1.25rem;
    width: 100%;
    max-width: 340px;
}

.social-login h2 {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-align: center;
    position: relative;
    width: 100%;
    margin: 1rem auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.social-login h2::before,
.social-login h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--input-bg);
    border: 2px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Social icon inner glow */
.social-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 14px;
}

/* Dark mode social icon hover */
[data-theme="dark"] .social-icon:hover,
:root .social-icon:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: transparent;
    box-shadow: 
        0 10px 30px rgba(139, 92, 246, 0.4),
        0 0 20px rgba(139, 92, 246, 0.2);
}

/* Light mode social icon hover */
[data-theme="light"] .social-icon:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: transparent;
    box-shadow: 
        0 10px 30px rgba(139, 92, 246, 0.25),
        0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Brand colors on hover - distinct brand colors */
.social-icon.google:hover {
    background: #EA4335;
    border-color: #EA4335;
}

.social-icon.microsoft:hover {
    background: #7FBA00;
    border-color: #7FBA00;
}

.social-icon.twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.social-icon.apple:hover {
    background: #000000;
    border-color: #333333;
}

.social-icon:hover::before {
    color: #ffffff !important;
}

/* Font Awesome social icons */
.social-icon::before {
    font-family: "Font Awesome 5 Brands";
    font-size: 22px;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.social-icon.google::before {
    content: "\f1a0"; /* Google icon */
}

.social-icon.microsoft::before {
    content: "\f17a"; /* Windows/Microsoft icon */
}

.social-icon.twitter::before {
    content: "\f099"; /* Twitter icon */
}

.social-icon.apple::before {
    content: "\f179"; /* Apple icon */
}

/* Disabled social icons */
.social-icon.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(60%);
    position: relative;
}

.social-icon.disabled:hover {
    opacity: 0.4;
    transform: none;
    background-color: var(--input-bg);
    box-shadow: none;
    border-color: var(--border-light);
}

/* Tooltip for disabled social icons */
.social-icon.disabled[title]::after {
    content: attr(title);
    position: absolute;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.social-icon.disabled:hover[title]::after {
    opacity: 1;
    visibility: visible;
}

/* ===== Login Form Input Styling ===== */
.input-container {
    margin-bottom: 0.75rem;
}

.input-container input {
    width: 100%;
    height: 3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-width: 1px;
}

.input-container input:focus {
    outline: none;
    border-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 4px var(--accent-purple-15) !important;
}

/* Hide Django's default error messages */
.errorlist {
    display: none;
}

/* ===== Rate Limiting Styling ===== */
.rate-limit-warning {
    color: var(--warning-text);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    padding: 0.5rem 1rem;
    background: var(--warning-bg);
    border-radius: 8px;
    border: 1px solid var(--warning-border);
}

.rate-limit-active .rate-limit-warning {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* ===== Account Blocked Styling ===== */
.account-blocked {
    color: var(--error-text);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 600;
    display: none;
    padding: 0.5rem 1rem;
    background: var(--error-bg);
    border-radius: 8px;
    border: 1px solid var(--error-border);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 480px) {
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .remember-forgot label,
    .remember-forgot a {
        padding: 4px 0;
    }
    
    .remember-forgot a {
        margin-top: 0;
        align-self: flex-start;
    }
    
    .input-container input,
    form button[type="submit"] {
        height: 3rem;
        font-size: 16px; /* Prevent auto-zoom on iOS */
    }
    
    .social-icon {
        width: 48px;
        height: 48px;
    }
    
    .social-icon::before {
        font-size: 22px;
    }
}
