/* ============================================
   AUTHENTICATION STYLES
   ============================================ */

:root {
    --auth-primary: #667eea;
    --auth-secondary: #764ba2;
    --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-success: #10b981;
    --auth-error: #ef4444;
    --auth-warning: #f59e0b;
}

/* Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
    z-index: 0;
}

body.dark-mode .auth-background {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
}

.auth-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--auth-gradient);
    opacity: 0.08;
    filter: blur(80px);
    animation: float 25s infinite ease-in-out;
}

.auth-circle.circle-1 {
    width: 500px;
    height: 500px;
    top: -250px;
    right: -150px;
    animation-delay: 0s;
}

.auth-circle.circle-2 {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -100px;
    animation-delay: 5s;
}

.auth-circle.circle-3 {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Back Button */
.back-home {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-mode .back-home {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(102, 126, 234, 0.2);
    color: var(--auth-primary);
}

.back-home:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Container */
.auth-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1;
}

/* Card */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease;
}

body.dark-mode .auth-card {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-gradient);
    border-radius: 20px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.auth-logo h1 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(102, 126, 234, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-tab:hover {
    color: var(--auth-primary);
}

.auth-tab.active {
    background: white;
    color: var(--auth-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .auth-tab.active {
    background: rgba(50, 50, 50, 1);
}

/* Alert */
.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--auth-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--auth-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert i:first-child {
    font-size: 1.2rem;
}

.auth-alert span {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

/* Forms */
.auth-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.form-group label i {
    color: var(--auth-primary);
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

body.dark-mode .form-group input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.form-group input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

body.dark-mode .form-group input:focus {
    background: rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--auth-primary);
}

/* Form Errors */
.form-error {
    display: block;
    color: var(--auth-error);
    font-size: 0.825rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.form-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.825rem;
    margin-top: 0.5rem;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

body.dark-mode .checkbox-custom {
    border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--auth-gradient);
    border-color: var(--auth-primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
}

.forgot-password,
.terms-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.forgot-password:hover,
.terms-link:hover {
    opacity: 0.8;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--auth-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .form-footer {
    border-color: rgba(255, 255, 255, 0.06);
}

.form-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.switch-form {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.switch-form:hover {
    opacity: 0.8;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.trust-badge i {
    color: var(--auth-primary);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .back-home {
        top: 1rem;
        left: 1rem;
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .back-home span {
        display: none;
    }

    .auth-logo h1 {
        font-size: 1.5rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .trust-badges {
        gap: 1rem;
    }

    .trust-badge span {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .auth-tabs {
        flex-direction: column;
    }

    .auth-tab {
        width: 100%;
    }
}
