/**
 * Modal de Contacto - Diseño Moderno y Discreto
 * Para The Data Company
 */

/* Modal Principal - Diseño flotante y suave */
#service-modal .modal-dialog {
    max-width: 750px;
    margin: 2rem auto;
}

#service-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

#service-modal .modal-header {
    border-bottom: none;
    padding: 2rem 2rem 0.5rem;
    background: transparent;
    border-radius: 16px 16px 0 0;
}

#service-modal .modal-title {
    color: #1D1D1F;
    font-weight: 600;
    font-size: 1.75rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
}

#service-modal .modal-subtitle {
    color: #6E6E73;
    font-weight: 400;
    font-size: 1rem;
    margin-top: 0.25rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#service-modal .modal-body {
    padding: 1rem 2rem 2rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

#service-modal .modal-footer {
    border-top: none;
    padding: 0 2rem 2rem;
    background: transparent;
    border-radius: 0 0 16px 16px;
}

/* Formulario - Estilo moderno y limpio */
#service-form .form-label {
    font-weight: 500;
    color: #1D1D1F;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.01em;
}

#service-form .form-label.fw-bold {
    color: #1D1D1F;
    font-size: 1.1rem;
    font-weight: 600;
}

#service-form .form-control,
#service-form .form-select {
    border: 1px solid #D1D1D6;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #FFFFFF;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
}

#service-form .form-control:hover,
#service-form .form-select:hover {
    border-color: #A1A1AA;
    background: #FAFAFA;
}

#service-form .form-control:focus,
#service-form .form-select:focus {
    border-color: #6610F2;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.08);
    outline: none;
}

#service-form .form-control::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

/* Estados de validación */
#service-form .form-control.is-valid,
#service-form .form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.5.55 3.7-3.73L5.5 2.55 2.8 5.28l-1.05-1.05-.75.75z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#service-form .form-control.is-invalid,
#service-form .form-select.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 d='m5.25 5.25 1.5 1.5m0-1.5-1.5 1.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Radio buttons y checkboxes modernos */
#service-form .form-check {
    margin-bottom: 1rem;
}

#service-form .form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0;
    border: 2px solid #D1D1D6;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
}

#service-form .form-check-input[type="radio"] {
    border-radius: 50%;
}

#service-form .form-check-input:checked {
    background-color: #6610F2;
    border-color: #6610F2;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

#service-form .form-check-input:hover {
    border-color: #A1A1AA;
}

#service-form .form-check-input:focus {
    border-color: #6610F2;
    box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.08);
    outline: none;
}

#service-form .form-check-label {
    margin-left: 0.75rem;
    color: #374151;
    font-size: 0.95rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    line-height: 1.5;
}

/* Botones tipo segmented control para radio buttons */
.form-check-segmented {
    display: inline-flex;
    background: #F3F4F6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
}

.form-check-segmented .form-check {
    margin-bottom: 0;
    margin-right: 0;
}

.form-check-segmented .form-check-input {
    display: none;
}

.form-check-segmented .form-check-label {
    margin-left: 0;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: #6B7280;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: none;
    min-width: 120px;
    text-align: center;
}

.form-check-segmented .form-check-input:checked + .form-check-label {
    background: #FFFFFF;
    color: #1D1D1F;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Secciones específicas */
.inquiry-fields,
.meeting-fields {
    background-color: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border-left: 4px solid #0d6efd;
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease-out;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Textareas */
#service-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Contador de caracteres */
.char-counter {
    display: block;
    text-align: right;
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

.char-counter.text-warning {
    color: #f0ad4e !important;
}

/* Botones modernos con jerarquía clara */
#service-modal .btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Botón principal - sólido */
#service-modal .btn-primary {
    background: linear-gradient(135deg, #6610F2 0%, #5A0EC7 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(102, 16, 242, 0.25);
}

#service-modal .btn-primary:hover {
    background: linear-gradient(135deg, #5A0EC7 0%, #4A0D9F 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 16, 242, 0.35);
    color: #FFFFFF;
}

#service-modal .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 16, 242, 0.3);
}

#service-modal .btn-primary:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Botón secundario - ghost style */
#service-modal .btn-secondary {
    background: transparent;
    color: #6B7280;
    border: 1px solid #D1D5DB;
}

#service-modal .btn-secondary:hover {
    background: #F9FAFB;
    color: #374151;
    border-color: #9CA3AF;
    transform: none;
}

#service-modal .btn-secondary:active {
    background: #F3F4F6;
}

/* Botón de cerrar mejorado */
#service-modal .btn-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    opacity: 0.6;
}

#service-modal .btn-close:hover {
    background: #F3F4F6;
    opacity: 1;
}

#service-modal .btn-close:focus {
    box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.08);
    outline: none;
}

/* Spinner de carga */
#submit-spinner {
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
}

/* Mensajes de error y éxito */
#form-error {
    border-radius: 0.5rem;
    border: none;
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

#form-success {
    border-radius: 0.5rem;
    border: none;
    background-color: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid #198754;
}

/* Mejoras de accesibilidad */
#service-modal .form-control:focus,
#service-modal .form-select:focus,
#service-modal .form-check-input:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Enlaces */
#service-form a {
    color: #0d6efd;
    text-decoration: underline;
}

#service-form a:hover {
    color: #0056b3;
}

/* Títulos de sección */
#service-form h5 {
    color: #212529;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Texto de ayuda */
.form-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    #service-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #service-modal .modal-body {
        padding: 1.5rem;
        max-height: calc(100vh - 150px);
    }
    
    #service-modal .modal-header,
    #service-modal .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .inquiry-fields,
    .meeting-fields {
        padding: 1rem;
    }
    
    #service-form .row .col-md-6,
    #service-form .row .col-md-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    #service-modal .modal-title {
        font-size: 1.25rem;
    }
    
    #service-modal .modal-body {
        padding: 1rem;
    }
    
    #service-modal .modal-header,
    #service-modal .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Estados hover para mejorar la experiencia */
#service-form .form-control:hover,
#service-form .form-select:hover {
    border-color: #b3d7ff;
}

#service-form .form-check-input:hover {
    border-color: #0d6efd;
}

/* Indicadores discretos para campos requeridos */
#service-form .form-label.required:after {
    content: " (requerido)";
    color: #9CA3AF;
    font-weight: 400;
    font-size: 0.85em;
    font-style: italic;
}

/* Alternativa más moderna: pequeño punto de color */
#service-form .form-label.required-dot:before {
    content: "•";
    color: #6610F2;
    font-weight: bold;
    margin-right: 4px;
}

/* Ocultar asteriscos por defecto */
#service-form .form-label:after {
    content: none;
}

/* Efectos de entrada del modal */
#service-modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

#service-modal.show .modal-dialog {
    transform: none;
}

/* Backdrop personalizado con blur */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Espaciado mejorado entre elementos */
#service-form .mb-3 {
    margin-bottom: 1.5rem !important;
}

#service-form .row {
    margin-bottom: 0.5rem;
}

#service-form .col-md-6,
#service-form .col-md-4 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Secciones con mejor espaciado */
.inquiry-fields,
.meeting-fields {
    background-color: #F8FAFC;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 3px solid #6610F2;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease-out;
}

/* Títulos de sección más suaves */
#service-form h5 {
    color: #1D1D1F;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 0.5rem;
}

/* Loading state para el formulario completo */
#service-form.loading {
    pointer-events: none;
    opacity: 0.7;
}

#service-form.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: 0.5rem;
}