/* 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);
    backdrop-filter: blur(4px);
}

/* LAYER 3: Modal container (gets centered by flexbox) */
.sp-login-gate-container {
    position: relative;         /* NOT absolute, NOT fixed */
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
}

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

.sp-login-gate-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.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;
}

.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"] {
    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 {
    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-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    font-size: 14px;
    color: #999;
}

/* Prevent body scroll when modal is open */
body.sp-login-gate-active {
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .sp-login-gate-container {
        padding: 30px 20px;
        width: 95%;
    }
    
    .sp-login-gate-title {
        font-size: 24px !important;
    }
    
    .sp-login-gate-message {
        font-size: 14px;
    }
}