/* Authentication Modal Styles */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal.active {
    display: flex;
}

.auth-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 480px;
    width: 100%;
    max-height: 95vh;
    box-shadow: var(--shadow-2xl);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

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

.auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-lighter);
    border: none;
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.auth-close:hover {
    background: var(--primary);
    color: var(--white);
    transform: rotate(90deg);
}

.auth-close svg {
    width: 20px;
    height: 20px;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    padding: 48px 40px 32px;
    text-align: center;
    color: var(--white);
    position: relative;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
}

.auth-logo {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.auth-logo .highlight {
    color: rgba(255, 255, 255, 0.9);
}

.auth-subtitle {
    font-size: 16px;
    opacity: 1;
    font-weight: 500;
    position: relative;
}

.auth-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--border-radius);
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--border-radius-sm);
    font-family: 'Inter', sans-serif;
}

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

.auth-tab.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeInContent 0.3s ease-out;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-lighter);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition-fast);
    background: var(--white);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.form-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

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

.auth-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.auth-submit:active:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-lighter);
}

.auth-divider span {
    padding: 0 16px;
    font-weight: 500;
}

.google-signin-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--white);
    color: var(--text-primary);
    border: 2px solid var(--border-lighter);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-signin-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-lighter);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

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

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.form-input-wrapper {
    position: relative;
}

.auth-benefits {
    background: var(--primary-lighter);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 24px;
}

.auth-benefits h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.auth-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-benefits li {
    font-size: 13px;
    color: var(--text-primary);
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.auth-benefits li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Loading state */
.auth-submit.loading {
    pointer-events: none;
    position: relative;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.auth-notification {
    animation: slideInRight 0.3s ease-out;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-modal {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
.auth-container {
        margin: 0;
        border-radius: var(--border-radius);
        max-width: 100%;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .auth-header {
        padding: 32px 20px 20px;
    }
    
    .auth-body {
        padding: 24px 20px;
    }
    
    .auth-logo {
        font-size: 26px;
    }
    
    .auth-subtitle {
        font-size: 14px;
    }
    
    .auth-tabs {
        margin-bottom: 24px;
    }
    
    .auth-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .auth-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .google-signin-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 48px;
    }
    
    .auth-divider {
        margin: 20px 0;
    }
    
    .auth-benefits {
        padding: 16px;
        margin-top: 20px;
    }
    
    .auth-benefits h4 {
        font-size: 13px;
    }
    
    .auth-benefits li {
        font-size: 12px;
        padding: 5px 0;
    }
    
    .auth-notification {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .auth-close {
        width: 32px;
        height: 32px;
        top: 16px;
        right: 16px;
    }
    
    .auth-close svg {
        width: 18px;
        height: 18px;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .auth-modal {
        padding: 8px;
        padding-top: 30px;
    }
    
    .auth-header {
        padding: 28px 16px 16px;
    }
    
    .auth-body {
        padding: 20px 16px;
    }
    
    .auth-logo {
        font-size: 24px;
    }
    
    .form-input {
        padding: 11px 12px;
    }
}
