/* Modern Authentication Styles - Matching PDFrow Theme */

/* Auth Navigation Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-auth {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-login {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-login:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-signup {
    background: var(--gradient-primary);
    color: white;
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 0.5rem;
    display: none;
    min-width: 160px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--border-color);
    color: var(--accent-primary);
}

/* Auth Modals */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

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

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.auth-form-container {
    position: relative;
    background: var(--card-bg);
    border-radius: 18px;
    padding: 1.75rem;
    max-width: 440px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    animation: authSlideIn 0.4s ease-out;
}

@keyframes authSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.auth-form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form-header h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--text-muted);
    color: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.auth-close-btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.1) rotate(90deg);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.15);
}

.auth-input:focus + .input-icon {
    color: var(--accent-primary);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group:has(label) .input-icon {
    top: calc(50% + 12px);
}

.auth-submit-btn {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.auth-submit-btn:hover::before {
    left: 100%;
}

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

.auth-submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 0 1rem;
    font-size: 0.875rem;
    position: relative;
}

/* Google Auth Button */
.google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.google-auth-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

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

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

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

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Error Messages */
.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #f44336;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-error svg {
    flex-shrink: 0;
}

/* Success Messages */
.auth-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #4caf50;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-success svg {
    flex-shrink: 0;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    animation: toastSlideIn 0.4s ease-out;
    max-width: 400px;
    min-width: 300px;
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast svg {
    flex-shrink: 0;
    color: inherit;
}

.toast span {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-group label {
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

.checkbox-group a {
    color: var(--accent-primary);
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

/* hCaptcha Styles */
.captcha-group {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

.captcha-group .h-captcha {
    transform: scale(0.95);
    transform-origin: center;
}

@media (max-width: 480px) {
    .captcha-group .h-captcha {
        transform: scale(0.85);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-buttons {
        gap: 0.5rem;
    }

    .btn-auth {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .user-email {
        display: none;
    }

    .auth-form-container {
        padding: 1.25rem;
        margin: 0.5rem;
        max-height: 94vh;
        overflow-y: auto;
        max-width: 380px;
    }
    .auth-close-btn {
        top: 12px;
        right: 12px;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .auth-form-header h2 {
        font-size: 1.5rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .auth-input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 0.875rem;
    }
}

@media (max-width: 480px) {
    .auth-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-auth {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .auth-form-container {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .auth-form-header {
        margin-bottom: 1.5rem;
    }

    .auth-form-header h2 {
        font-size: 1.3rem;
    }

    .google-auth-btn {
        font-size: 0.9rem;
        padding: 0.875rem;
    }
}