/* Login Screen Styles - Enterprise Edition */

/* Login Container with Gradient Background */
#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--login-gradient);
    background-attachment: fixed;
    padding: 20px;
    overflow-y: auto;
}

/* Glassmorphism Login Card */
.login-card {
    background: var(--login-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer effect on card */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

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

/* Logo Area */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--brand-gradient);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-on-brand);
    letter-spacing: -1px;
    box-shadow: var(--shadow-md);
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-logo .tagline {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Content Area */
.login-content {
    text-align: center;
    margin-bottom: 32px;
}

.login-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.login-content p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Google Sign-In Button Area */
.login-button-area {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#g_id_onload {
    display: flex;
    justify-content: center;
}

/* Custom styling for Google button wrapper */
.login-button-area > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Loading State */
#login-loading {
    display: none;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

#login-loading.active {
    display: block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Error State */
#login-error {
    display: none;
    text-align: center;
    color: var(--accent-danger);
    font-size: 14px;
    padding: 12px 16px;
    background: var(--edit-proposal-bg);
    border-radius: 8px;
    border: 1px solid var(--accent-danger);
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

#login-error.active {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Security Badges */
.login-security {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border-secondary);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.security-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.security-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.security-icon.lock {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.security-icon.shield {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}

/* Features List (Optional) */
.login-features {
    display: none; /* Hidden by default, can be enabled */
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.login-features h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    text-align: center;
}

.feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.feature-item::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--brand-gradient);
    color: var(--text-on-brand);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-card {
        padding: 40px 24px;
        border-radius: 16px;
        max-width: 100%;
    }

    .login-logo-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .login-logo h1 {
        font-size: 28px;
    }

    .login-content h2 {
        font-size: 20px;
    }

    .security-badge {
        font-size: 12px;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    #login-screen {
        padding: 12px;
    }

    .login-card {
        padding: 32px 20px;
    }

    .login-logo h1 {
        font-size: 24px;
    }

    .login-content h2 {
        font-size: 18px;
    }

    .security-badge {
        flex-direction: column;
        gap: 4px;
        font-size: 11px;
    }
}

/* Accessibility Improvements */
#login-screen:focus-within .login-card {
    outline: 2px solid var(--border-focus);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .login-card,
    #login-loading,
    #login-error {
        animation: none;
    }

    .login-card::before {
        animation: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .login-card {
        background: var(--bg-primary);
        border: 2px solid var(--text-primary);
    }

    .security-badge {
        color: var(--text-primary);
    }
}
