/* ================================================
   FIXED AUTHENTICATION POPUPS CSS
   This fixes the positioning and checkbox issues
   ================================================ */

/* MODAL OVERLAY - FIXED TO VIEWPORT */
.sc-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
    z-index: 999999 !important;
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sc-modal-overlay.show {
    display: block !important;
    opacity: 1 !important;
}

/* MODAL CONTAINER - CENTERED ON SCREEN */
.sc-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    box-sizing: border-box !important;
}

.sc-modal.show {
    display: flex !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* MODAL CONTENT - THE ACTUAL POPUP BOX */
.sc-modal-content {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    width: 100% !important;
    max-width: 400px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    z-index: 10000000 !important;
    margin: auto !important;
}

/* MODAL HEADER */
.sc-modal-header {
    padding: 24px 24px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #ffffff !important;
    border-radius: 16px 16px 0 0 !important;
}

.sc-modal-header h2 {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

/* CLOSE BUTTON */
.sc-close {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: #f3f4f6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 16px !important;
    color: #6b7280 !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.sc-close:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* MODAL BODY */
.sc-modal-body {
    padding: 24px !important;
    background: #ffffff !important;
}

/* FORM STYLING */
.sc-form-group {
    margin-bottom: 18px !important;
}

.sc-form-group label {
    display: block !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 14px !important;
}

.sc-form-group input[type="text"],
.sc-form-group input[type="email"],
.sc-form-group input[type="password"] {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
}

.sc-form-group input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.sc-form-group small {
    display: block !important;
    margin-top: 4px !important;
    font-size: 12px !important;
    color: #6b7280 !important;
}

/* CHECKBOX - LARGE AND SIMPLE */
.sc-checkbox {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin: 20px 0 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.sc-checkbox input[type="checkbox"] {
    display: none !important;
}

.sc-checkbox .checkmark {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border: 2px solid #9ca3af !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    transition: all 0.2s ease !important;
    display: block !important;
    box-sizing: border-box !important;
}

.sc-checkbox:hover .checkmark {
    border-color: #3b82f6 !important;
}

.sc-checkbox input:checked + .checkmark {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.sc-checkbox input:checked + .checkmark::after {
    content: '✓' !important;
    position: absolute !important;
    top: 1px !important;
    left: 5px !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

/* BUTTON STYLING */
.sc-btn {
    padding: 12px 20px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.sc-btn-primary {
    background: #3b82f6 !important;
    color: white !important;
}

.sc-btn-primary:hover {
    background: #2563eb !important;
}

.sc-btn-full {
    width: 100% !important;
}

.sc-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* LOADING STATE */
.sc-btn.loading .btn-text {
    display: none !important;
}

.sc-btn.loading .btn-loader {
    display: flex !important;
}

.btn-loader {
    display: none !important;
}

/* MESSAGES */
.sc-message {
    padding: 12px 16px !important;
    border-radius: 6px !important;
    margin: 16px 0 !important;
    font-size: 14px !important;
    display: none !important;
}

.sc-message.success {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

.sc-message.error {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

/* MODAL FOOTER */
.sc-modal-footer {
    padding: 16px 0 0 !important;
    border-top: 1px solid #e5e7eb !important;
    text-align: center !important;
}

.sc-modal-footer p {
    margin: 8px 0 !important;
    font-size: 14px !important;
    color: #6b7280 !important;
}

/* LINKS */
.sc-link {
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.sc-link:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* PREVENT BODY SCROLL */
body.modal-open {
    overflow: hidden !important;
}

/* MOBILE RESPONSIVE */
@media (max-width: 480px) {
    .sc-modal {
        padding: 15px !important;
    }
    
    .sc-modal-content {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .sc-modal-header,
    .sc-modal-body {
        padding: 20px !important;
    }
}

/* FORCE OVERRIDES */
.sc-modal,
.sc-modal * {
    box-sizing: border-box !important;
}

/* ENSURE MODAL IS ALWAYS ON TOP */
.sc-modal-overlay,
.sc-modal {
    z-index: 2147483647 !important; /* Maximum z-index */
}