/* auth.css - Premium Authentication Styles */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    padding: 2rem;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    background-color: #F9FAFB;
}

.auth-form input:focus {
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 0;
}

.auth-options a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-options a:hover {
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E5E7EB;
}

.auth-divider span {
    padding: 0 1rem;
}

.social-login {
    display: flex;
    gap: 1rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.social-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

/* RTL Support */
html[dir="rtl"] .auth-options a {
    margin-right: auto;
    margin-left: 0;
}

/* In-page Error Alert Banner */
.error-alert-banner {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    animation: authAlertFadeIn 0.3s ease;
}

@keyframes authAlertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive auth styles */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
        min-height: calc(100vh - 80px); /* accounting for mobile sticky header */
    }

    .auth-card {
        padding: 2.25rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .auth-header {
        margin-bottom: 1.75rem;
    }

    .auth-header .logo {
        font-size: 1.75rem;
    }

    .auth-header h1 {
        font-size: 1.25rem;
    }

    .social-login {
        flex-direction: column;
        gap: 0.75rem;
    }

    .social-btn {
        width: 100%;
        padding: 0.85rem;
    }
}

/* Google Accounts Chooser Overlay Dialog */
.google-chooser-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.google-chooser-overlay.active {
    opacity: 1;
    visibility: visible;
}

.google-chooser-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 2.5rem;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    text-align: center;
}

.google-chooser-overlay.active .google-chooser-card {
    transform: translateY(0) scale(1);
}

.google-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.google-logo-svg {
    width: 40px;
    height: 40px;
}

.google-chooser-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.google-chooser-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 2rem 0;
}

.google-chooser-subtitle strong {
    color: var(--primary-color, #4F46E5);
}

.google-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.google-account-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    outline: none;
    width: 100%;
}

.google-account-item:hover, .google-account-item:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.google-account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #4F46E5) 0%, #818cf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

.google-account-info {
    display: flex;
    flex-direction: column;
}

.google-account-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.google-account-email {
    font-size: 0.85rem;
    color: #64748b;
}

.google-custom-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    margin-top: 1rem;
    animation: googleFormFadeIn 0.3s ease;
}

.google-custom-form.active {
    display: flex;
}

@keyframes googleFormFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.google-chooser-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
}

.google-chooser-btn {
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.google-chooser-btn.btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.google-chooser-btn.btn-cancel:hover {
    background: #e2e8f0;
}

.google-chooser-btn.btn-submit {
    background: var(--primary-color, #4F46E5);
    color: #fff;
}

.google-chooser-btn.btn-submit:hover {
    background: #4338ca;
}

.google-use-another {
    background: transparent;
    border: none;
    color: var(--primary-color, #4F46E5);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.2s ease;
    padding: 0.5rem 0;
}

.google-use-another:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* RTL Specific Styles for google accounts chooser */
html[dir="rtl"] .google-account-item {
    text-align: right;
}
html[dir="rtl"] .google-custom-form {
    text-align: right;
}
