/**
 * Trend AI Authentication Styles
 * Glassmorphism design with Trend AI branding (purple/teal theme)
 * Based on Research AI design patterns
 */

/* Authentication Container */
.login-container,
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated background gradient overlay */
.login-container::before,
.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse-bg {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.8;
    }
}

/* Glassmorphism Card */
.login-card,
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.login-card:hover,
.auth-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Header Section */
.login-header,
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo,
.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: block;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-title,
.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-family: 'Lexend', sans-serif;
    letter-spacing: -0.025em;
}

.login-subtitle,
.auth-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

/* Authentication Buttons */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99, 102, 241, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

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

.auth-button:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2);
}

.auth-button:active {
    transform: translateY(0);
}

/* Provider-specific styling */
.auth-button.google:hover {
    border-color: #4285F4;
    box-shadow: 0 12px 32px rgba(66, 133, 244, 0.2);
}

.auth-button.apple:hover {
    border-color: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.auth-button i {
    font-size: 20px;
    z-index: 1;
}

.auth-button.google i {
    color: #4285F4;
}

.auth-button.apple i {
    color: #000;
}

/* Loading States */
.auth-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.auth-button.loading .spinner {
    display: block;
}

.auth-button.loading .auth-text {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Divider */
.login-divider,
.auth-divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}

.login-divider::before,
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e5e5, transparent);
}

.login-divider span,
.auth-divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 20px;
    color: #666;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

/* Footer */
.login-footer,
.auth-footer {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

.login-footer a,
.auth-footer a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover,
.auth-footer a:hover {
    text-decoration: underline;
    color: #4f46e5;
}

/* Messages */
.error-message,
.success-message,
.info-message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    display: none;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.info-message {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #2563eb;
}

.error-message.show,
.success-message.show,
.info-message.show {
    display: block;
}

/* Back Link */
.back-link {
    position: absolute;
    top: 24px;
    left: 24px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
}

.back-link:hover {
    transform: translateX(-4px);
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .login-card,
    .auth-card {
        padding: 32px 24px;
        margin: 20px;
        border-radius: 20px;
    }

    .login-title,
    .auth-title {
        font-size: 24px;
    }

    .auth-button {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
    }

    .back-link {
        position: static;
        margin-bottom: 20px;
        color: white;
        justify-content: center;
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .login-card,
    .auth-card {
        padding: 40px;
    }
}

/* Large Screen Optimizations */
@media (min-width: 1440px) {
    .login-card,
    .auth-card {
        max-width: 480px;
        padding: 56px;
    }

    .login-title,
    .auth-title {
        font-size: 32px;
    }

    .login-subtitle,
    .auth-subtitle {
        font-size: 18px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .login-card,
    .auth-card {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .login-title,
    .auth-title {
        color: #ffffff;
    }

    .login-subtitle,
    .auth-subtitle {
        color: #a1a1aa;
    }

    .auth-button {
        background: rgba(40, 40, 40, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .login-footer,
    .auth-footer {
        color: #a1a1aa;
    }

    .login-divider span,
    .auth-divider span {
        background: rgba(30, 30, 30, 0.95);
    }

    .error-message {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }

    .success-message {
        background: rgba(34, 197, 94, 0.1);
        border-color: rgba(34, 197, 94, 0.3);
    }

    .info-message {
        background: rgba(59, 130, 246, 0.1);
        border-color: rgba(59, 130, 246, 0.3);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .login-container::before,
    .auth-container::before {
        animation: none;
    }

    .auth-button::before {
        transition: none;
    }

    .auth-button:hover::before {
        left: 0;
        opacity: 0.1;
    }

    .spinner {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-card,
    .auth-card {
        border: 2px solid #000;
        background: rgba(255, 255, 255, 1);
    }

    .auth-button {
        border: 2px solid #000;
    }
}