/* ============================================================
   SSO Login Modal — Dark glass morphism (portal-matched)
   ============================================================ */

.sm-login-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 16, 25, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sm-login-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sm-login-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 16px;
    padding: 40px 32px 32px;
    background: rgba(32, 31, 40, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(109, 64, 169, 0.3);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(109, 64, 169, 0.15);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.sm-login-modal-overlay.open .sm-login-modal {
    transform: translateY(0);
}

/* Close button */
.sm-login-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--sm-text-secondary, #D2CCE5);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.sm-login-modal-close:hover {
    color: var(--sm-text, #F6F2FF);
}

/* Header */
.sm-login-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.sm-login-modal-header img {
    margin-bottom: 12px;
    border-radius: 8px;
}

.sm-login-modal-header h2 {
    font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--sm-text, #F6F2FF);
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

.sm-login-modal-header p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--sm-text-secondary, #D2CCE5);
    margin: 0;
}

/* ============================================================
   Tabs (Email / Phone)
   ============================================================ */
.sm-login-tabs {
    display: flex;
    position: relative;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(109, 64, 169, 0.2);
}

.sm-login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sm-login-tab svg {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sm-login-tab.active {
    color: var(--sm-info, #4593FF);
}

.sm-login-tab.active svg {
    opacity: 1;
    fill: var(--sm-info, #4593FF);
}

.sm-login-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.sm-login-tab-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50%;
    height: 2px;
    background: var(--sm-info, #4593FF);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* ============================================================
   Form
   ============================================================ */
.sm-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sm-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-form-group label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--sm-text-secondary, #D2CCE5);
    letter-spacing: 0.3px;
}

.sm-form-group input {
    width: 100%;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--sm-text, #F6F2FF);
    background: rgba(20, 16, 25, 0.6);
    border: 1px solid rgba(109, 64, 169, 0.3);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.sm-form-group input::placeholder {
    color: var(--sm-text-disabled, #8F8A9E);
}

.sm-form-group input:focus {
    border-color: var(--sm-info, #4593FF);
    box-shadow: 0 0 0 3px rgba(69, 147, 255, 0.15);
}

/* ============================================================
   Password wrapper + toggle
   ============================================================ */
.sm-password-wrapper {
    position: relative;
}

.sm-password-wrapper input {
    padding-right: 44px;
}

.sm-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.sm-password-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   Links row
   ============================================================ */
.sm-login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.sm-login-links a {
    color: var(--sm-info, #4593FF);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sm-login-links a:hover {
    color: var(--sm-info-light, #7AB1FF);
    text-decoration: underline;
}

/* ============================================================
   Error / Success banners
   ============================================================ */
.sm-login-error {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--sm-error, #CF2A2A);
    background: rgba(207, 42, 42, 0.1);
    border: 1px solid rgba(207, 42, 42, 0.25);
    border-radius: 6px;
    padding: 8px 12px;
}

.sm-login-success {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid rgba(46, 125, 50, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
}

/* ============================================================
   Submit button
   ============================================================ */
.sm-login-submit {
    width: 100%;
    padding: 12px;
    font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #0f0f0f;
    background: var(--sm-info, #4593FF);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    margin-top: 4px;
}

.sm-login-submit:hover {
    background: var(--sm-info-light, #7AB1FF);
    box-shadow: 0 4px 16px rgba(69, 147, 255, 0.3);
    transform: translateY(-1px);
}

.sm-login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   OAuth divider
   ============================================================ */
.sm-login-oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
    gap: 12px;
}

.sm-login-oauth-divider::before,
.sm-login-oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(109, 64, 169, 0.3);
}

.sm-login-oauth-divider span {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* ============================================================
   OAuth buttons
   ============================================================ */
.sm-oauth-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.sm-oauth-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(109, 64, 169, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.sm-oauth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(109, 64, 169, 0.5);
    transform: scale(1.08);
}

.sm-oauth-btn svg {
    pointer-events: none;
}

/* ============================================================
   MFA view
   ============================================================ */
.sm-mfa-title {
    font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--sm-text, #F6F2FF);
    text-align: center;
    margin: 0 0 8px;
}

.sm-mfa-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--sm-text-secondary, #D2CCE5);
    text-align: center;
    margin: 0 0 20px;
}

.sm-mfa-input {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 8px;
    font-weight: 600;
}

.sm-mfa-back {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--sm-info, #4593FF);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sm-mfa-back:hover {
    color: var(--sm-info-light, #7AB1FF);
    text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    .sm-login-modal {
        padding: 32px 20px 24px;
        margin: 12px;
    }

    .sm-login-modal-header h2 {
        font-size: 20px;
    }

    .sm-login-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .sm-oauth-buttons {
        gap: 8px;
    }

    .sm-oauth-btn {
        width: 40px;
        height: 40px;
    }
}
