/* Sterling Path Login Gate Modal Styles */

/* LAYER 1: Full-viewport wrapper with flexbox centering */
.sp-login-gate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;              /* Enable flexbox */
    align-items: center;        /* Center vertically */
    justify-content: center;    /* Center horizontally */
}

/* LAYER 2: Background overlay */
.sp-login-gate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Add vendor prefixes for cross-browser backdrop-filter support */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    /* Prevent any external styles from overriding background */
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* LAYER 3: Modal container (gets centered by flexbox) */
.sp-login-gate-container {
    position: relative;
    display: flex !important;
    flex-direction: column;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    padding: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
}

.sp-login-gate-scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 30px;
    flex: 1 1 0%;
    min-height: 0;
    max-height: calc(90vh - 52px);
}

.sp-login-gate-container * {
    pointer-events: auto !important;
}

.sp-login-gate-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    min-height: 50px;
}

.sp-login-gate-logo {
    position: absolute;
    left: 0;
    max-width: 80px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sp-login-gate-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #002868 0%, #003580 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.sp-login-gate-title {
    font-size: 36px !important;
    font-weight: 700;
    color: #002868;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.sp-login-gate-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 20px 0;
    text-align: center;
    text-wrap: pretty;
}

.sp-login-gate-tabs {
    display: flex;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 20px;
}

.sp-login-gate-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.sp-login-gate-tab:hover {
    color: #002868;
}

.sp-login-gate-tab.active {
    color: #002868;
    border-bottom-color: #002868;
}

.sp-login-gate-content {
    display: none;
}

.sp-login-gate-content.active {
    display: block;
}

.sp-login-gate-form {
    margin-bottom: 20px;
}

.sp-login-gate-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.sp-login-gate-form input[type="text"],
.sp-login-gate-form input[type="email"],
.sp-login-gate-form input[type="password"],
.sp-login-gate-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.sp-login-gate-form input[type="text"]:focus,
.sp-login-gate-form input[type="email"]:focus,
.sp-login-gate-form input[type="password"]:focus,
.sp-login-gate-form select:focus {
    outline: none;
    border-color: #002868;
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
}

/* Password wrapper for toggle button */
.sp-password-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.sp-password-wrapper input[type="password"],
.sp-password-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 0;
    box-sizing: border-box;
}

.sp-password-wrapper input:focus {
    outline: none;
    border-color: #002868;
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
}

.sp-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}

.sp-password-toggle:hover {
    color: #002868;
    background: rgba(0, 40, 104, 0.05);
}

.sp-eye-icon {
    display: block;
}

.sp-login-gate-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #002868 0%, #003580 100%);
    color: #FFFFFF !important;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sp-login-gate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 40, 104, 0.3);
    color: #FFFFFF !important;
}

.sp-login-gate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    color: #FFFFFF !important;
}

.sp-login-gate-remember {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.sp-login-gate-remember input {
    margin-right: 8px;
}

.sp-login-gate-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px;
    background: #F0F9FF;
    border-radius: 4px;
    border: 1px solid #BFDBFE;
}

.sp-login-gate-checkbox-wrapper input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.sp-login-gate-checkbox-wrapper label {
    margin: 0 !important;
    font-weight: normal !important;
    color: #1E40AF;
    line-height: 1.4;
}

.sp-login-gate-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.sp-login-gate-links a {
    color: #002868;
    text-decoration: none;
}

.sp-login-gate-links a:hover {
    text-decoration: underline;
}

.sp-login-gate-error {
    background: #fee;
    border-left: 4px solid #BF0A30;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #BF0A30;
}

.sp-login-gate-footer {
    text-align: center;
    margin: 0;
    padding: 15px 30px;
    border-top: 1px solid #e5e5e5;
    font-size: 14px;
    color: #999;
    flex-shrink: 0;
}

/* Prevent body scroll when modal is open */
html.sp-login-gate-active,
body.sp-login-gate-active {
    overflow: hidden !important;
    height: 100% !important;
}

.sp-login-gate-scrollable {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .sp-login-gate-modal {
        align-items: stretch;
    }

    .sp-login-gate-container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .sp-login-gate-title {
        font-size: 24px !important;
    }
    
    .sp-login-gate-message {
        font-size: 14px;
    }

    .sp-login-gate-footer {
        margin-top: 20px;
        padding-top: 15px;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }

    .sp-social-buttons {
        flex-wrap: wrap;
    }

    .sp-social-btn-wrap,
    .sp-social-buttons > * {
        flex: none !important;
        width: 100% !important;
    }
}
/* Social login section */
.sp-social-separator {
    height: 1px;
    background: #e5e5e5;
    margin: 20px 0;
}

.sp-social-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
}

.sp-social-btn-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Google SDK renders an iframe — constrain it within the flex child */
.sp-social-btn-wrap[id*="google"] {
    overflow: hidden;
}
.sp-social-btn-wrap[id*="google"] iframe {
    max-width: 100% !important;
}

/* Legacy: direct children that aren't wrapped */
.sp-social-buttons > *:not(.sp-social-btn-wrap) {
    flex: 1;
    min-width: 0;
}

/* Center single social button instead of stretching full width */
.sp-social-buttons:has(> :only-child) > .sp-apple-signin-btn,
.sp-social-buttons:has(> :only-child) > .sp-social-btn-wrap {
    flex: 0 1 auto;
    align-self: center;
}

/* Ensure Apple wrapper is always visible — Google SDK cannot affect it */
#sp-apple-signin-wrap,
#sp-apple-register-wrap {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Apple Sign-In button — outline style to match Google */
.sp-apple-signin-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    height: 44px !important;
    background: #fff !important;
    color: #3c4043 !important;
    border: 1px solid #dadce0 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    cursor: pointer !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
    box-sizing: border-box !important;
    padding: 0 12px !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 44px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.sp-apple-signin-btn:hover {
    background: #f7f8f8 !important;
    border-color: #c6c9cd !important;
    color: #3c4043 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.sp-apple-signin-btn svg {
    flex-shrink: 0;
    color: #000 !important;
}


