/* Auth Modal Styles */
:root {
    --auth-primary: #6366f1;
    --auth-primary-hover: #4f46e5;
    --auth-bg: rgba(255, 255, 255, 0.95);
    --auth-text: #1f2937;
    --auth-text-light: #6b7280;
    --auth-border: #e5e7eb;
    --auth-radius: 16px;
    --auth-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.open {
    opacity: 1;
    visibility: visible;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-container {
    position: relative;
    background: var(--auth-bg);
    width: 100%;
    max-width: 420px;
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin: 1rem;
}

.auth-modal.open .auth-container {
    transform: translateY(0);
}

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--auth-text-light);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.auth-close:hover {
    color: var(--auth-text);
}

/* Tabs */
.auth-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-bottom: 2px solid var(--auth-border);
    padding-bottom: 0.5rem;
}

.auth-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--auth-text-light);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.auth-tab.active {
    color: var(--auth-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--auth-primary);
    border-radius: 3px 3px 0 0;
}

/* Forms */
.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--auth-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-light);
    cursor: pointer;
    padding: 5px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--auth-text-light);
    cursor: pointer;
}

.forgot-password {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--auth-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--auth-primary-hover);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Messages */
.auth-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.auth-message.error {
    display: block;
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.auth-message.success {
    display: block;
    background: #d1fae5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}

/* Loader */
.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.auth-submit-btn.loading .btn-loader {
    display: block;
}

.auth-submit-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        margin: 0;
        height: 100%;
        max-width: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .auth-close {
        top: 1.5rem;
        right: 1.5rem;
    }
}
