/* Modal de Inscripcion - Estilos Unificados */

/* ===== HEADER DEL MODAL ===== */
.modal-header-inscripcion {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tournament-logo-modal {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: white;
    border-radius: 0.75rem;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tournament-logo-modal img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.tournament-info-modal h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0 0 0.4rem 0;
}

.tournament-meta-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

    .tournament-meta-modal span {
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

/* ===== FORM SECTIONS ===== */
.form-section-modal {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-section-title-modal {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .form-section-title-modal i {
        color: #29b6f6;
    }

    .form-section-title-modal .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

/* ===== FORM ELEMENTS ===== */
.form-group-modal {
    margin-bottom: 1rem;
}

    .form-group-modal:last-child {
        margin-bottom: 0;
    }

.form-label-modal {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.4rem;
    display: block;
    font-size: 0.85rem;
}

.form-control-modal {
    border: 2px solid #e9ecef;
    border-radius: 0.6rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
    background-color: white;
}

    .form-control-modal:focus {
        border-color: #29b6f6;
        box-shadow: 0 0 0 0.15rem rgba(41,182,246,0.15);
        outline: none;
    }

    .form-control-modal:disabled,
    .form-control-modal[readonly] {
        background-color: #e9ecef;
        opacity: 0.8;
    }

/* ===== SEARCH INPUT GROUP ===== */
.search-input-group-modal {
    display: flex;
    gap: 0.6rem;
}

    .search-input-group-modal .iti {
        flex: 1;
    }

.btn-search-modal {
    background: linear-gradient(45deg, #29b6f6, #0288d1);
    border: none;
    color: white;
    padding: 0 1rem;
    border-radius: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
}

    .btn-search-modal:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(2, 136, 209, 0.3);
    }

    .btn-search-modal:disabled {
        opacity: 0.6;
        transform: none;
    }

/* ===== PARTNER RESULT CARDS ===== */
.partner-result-modal {
    margin-top: 0.75rem;
    padding: 0.9rem;
    border-radius: 0.6rem;
    display: none;
}

    .partner-result-modal.found {
        display: block;
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border: 2px solid #28a745;
    }

    .partner-result-modal.not-found {
        display: block;
        background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
        border: 2px solid #ffc107;
    }

.partner-found-info-modal {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.partner-avatar-modal {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.partner-details-modal {
    flex: 1;
    min-width: 0;
}

    .partner-details-modal h5 {
        margin: 0;
        font-weight: 700;
        color: #155724;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

        .partner-details-modal h5 i {
            color: #28a745;
        }

    .partner-details-modal p {
        margin: 0;
        font-size: 0.75rem;
        color: #155724;
        opacity: 0.8;
    }

/* ===== MANUAL ENTRY TOGGLE ===== */
.manual-entry-section-modal {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px dashed #dee2e6;
}

.btn-toggle-manual-modal {
    background: none;
    border: none;
    color: #29b6f6;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
}

    .btn-toggle-manual-modal:hover {
        text-decoration: underline;
    }

.manual-fields-modal {
    margin-top: 0.75rem;
}

/* ===== BANK INFO CARD ===== */
.bank-info-card-modal {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #29b6f6;
    border-radius: 0.6rem;
    padding: 0.9rem;
}

    .bank-info-card-modal h6 {
        color: #0288d1;
        font-weight: 700;
        margin-bottom: 0.65rem;
        font-size: 0.9rem;
    }

/* ===== MULTI-SELECT (Pills/Chips) ===== */
.multi-select-container-modal {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 0.6rem;
    padding: 0.65rem;
}

.multi-select-options-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.multi-select-option-modal {
    cursor: pointer;
    margin: 0;
}

    .multi-select-option-modal input {
        display: none;
    }

    .multi-select-option-modal .option-content-modal {
        display: inline-flex;
        align-items: center;
        padding: 0.4rem 0.9rem;
        background: #f8f9fa;
        border: 2px solid #e9ecef;
        border-radius: 2rem;
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
        transition: all 0.2s;
    }

    .multi-select-option-modal:hover .option-content-modal {
        border-color: #29b6f6;
        background: rgba(41, 182, 246, 0.05);
    }

    .multi-select-option-modal input:checked + .option-content-modal {
        background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
        border-color: #0288d1;
        color: white;
    }

/* Days of week - special style */
.multi-select-container-modal[data-field-name*="dias"] .option-content-modal {
    min-width: 90px;
    justify-content: center;
}

/* ===== SI/NO TOGGLE BUTTONS ===== */
.si-no-container-modal {
    display: flex;
    gap: 0.6rem;
}

.si-no-option-modal {
    cursor: pointer;
    margin: 0;
}

    .si-no-option-modal input {
        display: none;
    }

.si-no-label-modal {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 0.6rem;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

    .si-no-label-modal.si {
        color: #28a745;
    }

    .si-no-label-modal.no {
        color: #dc3545;
    }

.si-no-option-modal:hover .si-no-label-modal {
    border-color: currentColor;
}

.si-no-option-modal input:checked + .si-no-label-modal.si {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.si-no-option-modal input:checked + .si-no-label-modal.no {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* ===== VALIDATION STATES ===== */
.multi-select-container-modal.invalid {
    border-color: #dc3545;
}

    .multi-select-container-modal.invalid + .form-text-modal {
        color: #dc3545;
    }

.multi-select-container-modal.valid {
    border-color: #28a745;
}

/* Validation state for required fields */
.form-control-modal.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

    .form-control-modal.is-invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15);
    }

.form-text-modal {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.info-min-selecciones-modal {
    margin-bottom: 0.4rem;
}

/* ===== COMPROBANTE UPLOAD AREA ===== */
.comprobante-section-modal {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #dee2e6;
}

.comprobante-upload-area-modal {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 0.6rem;
    background: white;
    transition: all 0.2s;
    overflow: hidden;
}

    .comprobante-upload-area-modal:hover {
        border-color: #29b6f6;
        background: rgba(41, 182, 246, 0.02);
    }

    .comprobante-upload-area-modal.dragover {
        border-color: #29b6f6;
        background: rgba(41, 182, 246, 0.05);
    }

    .comprobante-upload-area-modal.has-file {
        border-style: solid;
        border-color: #28a745;
    }

.comprobante-input-modal {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder-modal {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
}

    .upload-placeholder-modal i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: #adb5bd;
    }

    .upload-placeholder-modal p {
        margin: 0 0 0.2rem;
        font-size: 0.85rem;
    }

    .upload-placeholder-modal small {
        font-size: 0.7rem;
        opacity: 0.7;
    }

.upload-preview-modal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

    .upload-preview-modal img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 0.4rem;
        border: 2px solid white;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    .upload-preview-modal .preview-info-modal {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

        .upload-preview-modal .preview-info-modal span {
            font-weight: 600;
            color: #155724;
            font-size: 0.8rem;
            word-break: break-all;
        }

.btn-remove-file-modal {
    background: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #dc3545;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 3;
}

    .btn-remove-file-modal:hover {
        background: #dc3545;
        color: white;
        transform: scale(1.1);
    }

.upload-preview-modal img.pdf-icon {
    background: white;
    padding: 0.5rem;
}

/* ===== intl-tel-input FIXES ===== */
#modalInscripcion .iti {
    width: 100%;
}

#modalInscripcion .iti--container {
    z-index: 10060 !important;
}

#modalInscripcion .iti input.form-control-modal {
    padding-left: 52px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .modal-header-inscripcion {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .tournament-meta-modal {
        justify-content: center;
    }

    .form-section-modal {
        padding: 1rem;
    }

    .search-input-group-modal {
        flex-direction: column;
    }

    .partner-found-info-modal {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.6rem;
    }

    .partner-avatar-modal {
        margin: 0 auto;
    }

    .partner-details-modal h5 {
        justify-content: center;
    }

    .partner-found-info-modal .btn {
        width: 100%;
    }

    .si-no-container-modal {
        flex-direction: column;
    }

    .si-no-label-modal {
        width: 100%;
        justify-content: center;
    }
}

/* ===== READONLY USER CARD ===== */
.user-readonly-card-modal {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #29b6f6;
    border-radius: 0.6rem;
    padding: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-modal {
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: linear-gradient(135deg, #29b6f6, #0288d1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.user-details-modal {
    flex: 1;
}

    .user-details-modal strong {
        display: block;
        color: #0d47a1;
        font-size: 0.95rem;
    }

    .user-details-modal small {
        color: #1565c0;
        font-size: 0.8rem;
    }

/* ===== LOGIN REQUIRED ALERT ===== */
.login-required-alert-modal {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 2px solid #ffc107;
    border-radius: 0.6rem;
    padding: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

    .login-required-alert-modal i {
        color: #856404;
        font-size: 1.25rem;
    }

    .login-required-alert-modal .alert-text-modal {
        flex: 1;
    }

        .login-required-alert-modal .alert-text-modal p {
            margin: 0;
            color: #856404;
            font-size: 0.85rem;
        }

        .login-required-alert-modal .alert-text-modal a {
            color: #533f03;
            font-weight: 600;
        }

/* ===== SUCCESS STATE ===== */
.inscripcion-exito-modal {
    text-align: center;
    padding: 2rem 1rem;
}

    .inscripcion-exito-modal i.fa-check-circle {
        font-size: 3.5rem;
        color: #28a745;
        margin-bottom: 1rem;
    }

    .inscripcion-exito-modal h4 {
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        color: #155724;
        margin-bottom: 0.5rem;
    }

    .inscripcion-exito-modal p {
        color: #495057;
        font-size: 0.9rem;
    }

/* ===== REGISTRO CTA ===== */
.inscripcion-registro-cta {
    background: #f0f9ff;
    border: 1px solid #b6e0fe;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.registro-cta-icon {
    margin-bottom: 0.75rem;
}

    .registro-cta-icon i {
        font-size: 2rem;
        color: #0288d1;
    }

.registro-cta-texto {
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.btn-registro-cta {
    display: inline-block;
    background: linear-gradient(45deg, #29b6f6, #0288d1);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 28px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
}

    .btn-registro-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(2, 136, 209, 0.4);
        color: white;
    }

.registro-cta-login {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0;
}

    .registro-cta-login a {
        color: #0288d1;
        font-weight: 600;
        text-decoration: none;
    }

        .registro-cta-login a:hover {
            text-decoration: underline;
        }

/* ===== BLOQUEO DE SCROLL CUANDO MODAL EST� ABIERTO ===== */
html.modal-inscripcion-open,
body.modal-inscripcion-open {
    overflow: hidden !important;
    height: 100% !important;
    position: fixed !important;
    width: 100% !important;
    touch-action: none;
}

/* Asegurar que el wrapper de Magnific Popup cubra todo */
.mfp-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
}

/* Asegurar que el contenedor del modal sea scrolleable */
.mfp-wrap {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Fix para iOS Safari - altura de viewport */
@supports (-webkit-touch-callout: none) {
    .mfp-bg,
    .mfp-wrap {
        min-height: -webkit-fill-available !important;
    }

    html.modal-inscripcion-open,
    body.modal-inscripcion-open {
        height: -webkit-fill-available !important;
    }
}

/* ===== UPLOAD AREA PARA CAMPOS PERSONALIZADOS ===== */
.upload-area-modal,
.upload-area-modal-edit {
    border: 2px dashed #dee2e6;
    border-radius: 0.6rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.upload-area-modal:hover,
.upload-area-modal-edit:hover {
    border-color: #29b6f6;
    background: rgba(41, 182, 246, 0.05);
}

.upload-area-modal.has-image,
.upload-area-modal-edit.has-image {
    border-style: solid;
    border-color: #28a745;
    background: white;
}
