﻿/* Authentication Styles for BatchVision */

/* Header Login Button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(139, 99, 255, 0.1);
    border: 1px solid rgba(139, 99, 255, 0.3);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: var(--accent-violet);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .login-btn:hover {
        background: rgba(139, 99, 255, 0.2);
        border-color: rgba(139, 99, 255, 0.5);
        color: var(--primary-white);
        text-decoration: none;
        transform: translateY(-1px);
    }

.login-icon {
    width: 16px;
    height: 16px;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 99, 255, 0.2);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(139, 99, 255, 0.3);
    position: relative;
    overflow: hidden;
}

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan), var(--accent-emerald));
        background-size: 200% 100%;
        animation: borderFlow 3s linear infinite;
    }

    .login-card h1 {
        text-align: center;
        color: var(--primary-white);
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 2rem;
        background: linear-gradient(135deg, var(--primary-white) 0%, var(--accent-violet) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

/* Login Steps - CRITICAL: Only show active step */
.login-step {
    display: none !important;
    animation: slideIn 0.4s ease-out;
}

    .login-step.active {
        display: block !important;
    }

.back-button {
    background: none;
    border: none;
    color: var(--medium-gray);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

    .back-button:hover {
        color: var(--accent-violet);
    }

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--primary-white);
        font-weight: 500;
        font-size: 0.9rem;
    }

    .form-group input {
        width: 100%;
        padding: 1rem;
        border: 1px solid rgba(139, 99, 255, 0.3);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.05);
        color: var(--primary-white);
        font-size: 1rem;
        transition: all 0.3s ease;
        font-family: 'Sora', sans-serif;
        box-sizing: border-box;
    }

        .form-group input::placeholder {
            color: var(--medium-gray);
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--accent-violet);
            box-shadow: 0 0 0 3px rgba(139, 99, 255, 0.1);
            background: rgba(255, 255, 255, 0.08);
        }

/* MFA Code Input */
#mfa-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--accent-violet);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

    .btn-primary:hover:not(:disabled) {
        background: #7952e6;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(139, 99, 255, 0.4);
    }

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.btn-external {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 99, 255, 0.3);
    border-radius: 12px;
    color: var(--primary-white);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

    .btn-external:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--accent-violet);
        color: var(--primary-white);
        text-decoration: none;
        transform: translateY(-1px);
    }

/* Provider Icons */
.provider-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .provider-icon.microsoft::before {
        content: "⊞";
        color: #00a1f1;
        font-size: 16px;
    }

    .provider-icon.google::before {
        content: "G";
        color: #4285f4;
        font-weight: bold;
        font-size: 14px;
    }

    .provider-icon.azure::before {
        content: "◇";
        color: #0078d4;
        font-size: 16px;
    }

    .provider-icon.entraid::before {
        content: "⊞";
        color: #00a1f1;
        font-size: 16px;
    }

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    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);
    }
}

/* Status Messages */
.user-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(139, 99, 255, 0.1);
    border: 1px solid rgba(139, 99, 255, 0.2);
    border-radius: 10px;
}

.user-email {
    color: var(--accent-violet);
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-word;
}

.auth-method-info {
    color: var(--medium-gray);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

.success-message {
    background: rgba(0, 212, 163, 0.1);
    border: 1px solid rgba(0, 212, 163, 0.3);
    color: #00d4a3;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

/* Alternative Methods */
.alternative-methods {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(139, 99, 255, 0.2);
}

    .alternative-methods h4 {
        color: var(--primary-white);
        font-size: 0.9rem;
        margin-bottom: 1rem;
        text-align: center;
    }

.method-button {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 99, 255, 0.2);
    border-radius: 8px;
    color: var(--medium-gray);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Sora', sans-serif;
}

    .method-button:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--accent-violet);
        color: var(--primary-white);
    }

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes borderFlow {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .login-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

        .login-btn span {
            display: none;
        }
}

/* Focus styles for accessibility */
.btn-primary:focus,
.btn-external:focus,
.form-group input:focus,
.method-button:focus,
.back-button:focus {
    outline: 2px solid var(--accent-violet);
    outline-offset: 2px;
}

/* Tenant Selection Step */
#tenant-step {
    animation: slideIn 0.4s ease-out;
}

.tenant-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tenant-item {
    width: 100%;
}

.tenant-select-btn {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 99, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    color: var(--primary-white);
}

    .tenant-select-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--accent-violet);
        transform: translateX(4px);
    }

    .tenant-select-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(139, 99, 255, 0.1);
    }

.tenant-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tenant-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-white);
}

.tenant-role {
    font-size: 0.85rem;
    color: var(--medium-gray);
    font-weight: 400;
}

.tenant-arrow {
    color: var(--accent-violet);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.tenant-select-btn:hover .tenant-arrow {
    transform: translateX(4px);
}

/* Info Message Style */
.info-message {
    background: rgba(139, 99, 255, 0.1);
    border: 1px solid rgba(139, 99, 255, 0.3);
    color: var(--accent-violet);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease-out;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tenant-select-btn {
        padding: 0.875rem 1rem;
    }

    .tenant-name {
        font-size: 0.95rem;
    }

    .tenant-role {
        font-size: 0.8rem;
    }
}