/**
 * SSO Styles for EventManager Online
 *
 * Design tokens from existing stylesheets:
 * - Primary color: #1f77ca
 * - Success: #10b981 / #166534
 * - Warning: #f59e0b / #92400e
 * - Error: #ef4444 / #dc2626
 * - Gray: #6b7280, #374151, #1a2b3c
 * - Border: #e5e7eb, #d1d5db
 * - Background: #f9fafb, #ffffff
 */

/* ==========================================================================
   SSO Login Buttons
   ========================================================================== */

.sso-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.sso-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sso-buttons-horizontal {
    flex-direction: row;
}

.sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 44px;
    box-sizing: border-box;
    cursor: pointer;
}

.sso-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    text-decoration: none;
    color: #374151;
}

.sso-btn:active {
    transform: scale(0.98);
}

.sso-btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Provider-specific hover colors */
.sso-btn-google:hover {
    border-color: #4285f4;
}

.sso-btn-microsoft:hover {
    border-color: #00a4ef;
}

.sso-btn-entraid:hover {
    border-color: #0078d4;
}

.sso-btn-okta:hover {
    border-color: #007dc1;
}

/* Enterprise SSO button (primary style) */
.sso-btn-enterprise {
    background: #1f77ca;
    color: #ffffff;
    border-color: #1f77ca;
}

.sso-btn-enterprise:hover {
    background: #1565c0;
    border-color: #1565c0;
    color: #ffffff;
}

/* Size variants */
.sso-btn-small {
    padding: 8px 12px;
    height: 36px;
    font-size: 13px;
}

.sso-btn-small .sso-btn-icon {
    width: 16px;
    height: 16px;
}

.sso-btn-large {
    padding: 14px 20px;
    height: 52px;
    font-size: 15px;
}

.sso-btn-large .sso-btn-icon {
    width: 24px;
    height: 24px;
}


/* ==========================================================================
   SSO Callback/Processing Page
   ========================================================================== */

.sso-callback {
    text-align: center;
    padding: 40px 20px;
}

.sso-callback-icon {
    margin-bottom: 24px;
}

.sso-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #1f77ca;
    border-radius: 50%;
    animation: sso-spin 1s linear infinite;
    margin: 0 auto;
}

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

.sso-callback h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a2b3c;
    margin: 0 0 8px 0;
}

.sso-callback-message {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.sso-callback-error {
    margin-top: 24px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.sso-callback-error p {
    color: #dc2626;
    margin: 8px 0 16px;
}


/* ==========================================================================
   Account Linking Page
   ========================================================================== */

.sso-link-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 24px;
}

.sso-link-provider,
.sso-link-existing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.sso-provider-logo {
    width: 32px;
    height: 32px;
}

.sso-link-details {
    display: flex;
    flex-direction: column;
}

.sso-link-details strong {
    font-size: 14px;
    color: #1a2b3c;
}

.sso-link-details span {
    font-size: 12px;
    color: #6b7280;
}

.sso-link-arrow .lucide-icon {
    width: 24px;
    height: 24px;
    color: #9ca3af;
}

.sso-link-alternative {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.sso-link-alternative p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}


/* ==========================================================================
   Linked Accounts Management
   ========================================================================== */

.sso-description {
    color: #6b7280;
    margin-bottom: 24px;
}

.sso-linked-accounts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.sso-account-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.sso-account-card:hover {
    border-color: #d1d5db;
}

.sso-account-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f8f9fa;
}

.sso-provider-svg {
    width: 28px;
    height: 28px;
}

.sso-account-info {
    flex: 1;
    min-width: 0;
}

.sso-account-provider {
    font-size: 14px;
    font-weight: 600;
    color: #1a2b3c;
}

.sso-account-email {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sso-account-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.sso-account-actions {
    flex-shrink: 0;
}

.sso-no-accounts {
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.sso-no-accounts p {
    color: #6b7280;
    margin-top: 16px;
}

.sso-add-account {
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.sso-add-account h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a2b3c;
    margin-bottom: 16px;
}

.sso-add-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* ==========================================================================
   Enterprise SSO Admin Configuration
   ========================================================================== */

.sso-admin-info {
    margin-bottom: 24px;
}

.sso-admin-info .alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sso-config-status {
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sso-config-active {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.sso-config-inactive {
    background: #f9fafb;
}

.sso-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #166534;
}

.sso-config-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #d1fae5;
}

.sso-setup-wizard {
    text-align: center;
}

.sso-setup-header {
    margin-bottom: 32px;
}

.sso-setup-header h4 {
    font-size: 20px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: #1a2b3c;
}

.sso-setup-header p {
    color: #6b7280;
}

.sso-provider-selection h5 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

.sso-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.sso-provider-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.sso-provider-option:hover {
    border-color: #1f77ca;
    box-shadow: 0 4px 12px rgba(31, 119, 202, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
}

.sso-provider-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.sso-provider-icon img,
.sso-provider-icon .lucide-icon {
    width: 100%;
    height: 100%;
}

.sso-provider-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a2b3c;
    margin-bottom: 4px;
}

.sso-provider-desc {
    font-size: 12px;
    color: #6b7280;
}

/* Badges */
.sso-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.sso-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.sso-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.sso-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Form elements */
.sso-redirect-uri {
    display: inline-block;
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    margin-right: 8px;
    word-break: break-all;
}

.sso-form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: center;
}

.sso-hint-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #92400e;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
}

.sso-test-result {
    margin-top: 24px;
    padding: 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sso-test-result.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.sso-test-result.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}


/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .sso-link-info {
        flex-direction: column;
    }

    .sso-link-arrow {
        transform: rotate(90deg);
    }

    .sso-provider-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sso-account-card {
        flex-direction: column;
        text-align: center;
    }

    .sso-account-info {
        text-align: center;
    }

    .sso-form-actions {
        flex-direction: column;
    }

    .sso-form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sso-provider-grid {
        grid-template-columns: 1fr;
    }

    .sso-buttons-horizontal {
        flex-direction: column;
    }
}
