/* ============================================
   LAYOUT: VISID - Single Page Form
   Formulario de una sola página responsivo
   ============================================ */

/* Variables de color Chevrolet */
:root {
    --chevrolet-gold: #C29B3F;
    --chevrolet-gold-light: #D4AF37;
    --chevrolet-gold-dark: #B6862D;
    --text-dark: #333333;
    --text-light: #888888;
    --border-light: #CCCCCC;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
}

/* Fondo blanco para toda la aplicación */
body, html {
    background-color: #fff !important;
    font-family: 'Louis', Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}

/* Contenedor principal */
.visid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background-color: #fff;
}

/* Header */
.visid-header {
    text-align: center;
    margin-bottom: 3rem;
}

.visid-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Barra de modelos */
.visid-models-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.model-item {
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.model-item:hover {
    border-color: var(--chevrolet-gold);
    background-color: rgba(194, 155, 63, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.model-item.active {
    background-color: var(--chevrolet-gold);
    border-color: var(--chevrolet-gold);
    color: var(--bg-white);
    box-shadow: 0 4px 12px rgba(194, 155, 63, 0.3);
}

/* Contenido del formulario */
.visid-form-content {
    width: 100%;
}

/* Grid de campos responsivo */
.visid-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

/* Campo de formulario */
.visid-field-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.visid-field-wrapper.full-width {
    grid-column: 1 / -1;
}

.visid-field-wrapper.half-width {
    grid-column: span 1;
}

/* ===== FLOWBITE FLOATING LABELS - Estilo personalizado VISID ===== */
/* Basado en el diseño de style_visid.scss con Tailwind CSS + Flowbite */

/* Contenedor relativo para floating labels */
.visid-container .relative {
    margin: auto 10px;
    margin-bottom: 30px;
}

/* Input y Select con estilo personalizado */
.visid-container input,
.visid-container select {
    background-color: #f2f2f2 !important;
    border-bottom-width: 2px !important;
    border-bottom-color: rgb(145 145 145 / 42%) !important;
    box-shadow: 0 1px 0px rgb(145 145 145 / 42%) !important;
    color: rgb(33, 37, 41) !important;
}

/* Label con color personalizado */
.visid-container label {
    color: #8c8c8c !important;
}

/* Label cuando el input tiene foco */
.visid-container .peer:focus ~ label {
    color: #8c8c8c !important;
}

/* Estados de error - Border rojo */
.visid-container .border-red-600 {
    border-bottom-color: #dc3545 !important;
    box-shadow: 0 1px 0px rgba(220, 53, 69, 0.6) !important;
}

/* Label de error */
.visid-container label.text-red-600 {
    color: #dc3545 !important;
}

/* Select - Text Overflow */
.visid-container select {
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    padding-right: 2.5rem !important;
}

@media (max-width: 768px) {
    .visid-container select {
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        padding-right: 2.5rem !important;
    }
}

/* Input con label debe tener el orden correcto en el DOM */
.visid-field-wrapper input,
.visid-field-wrapper select,
.visid-field-wrapper textarea {
    width: 100%;
    padding: 26px 12px 10px !important;
    border: 0 !important;
    border-radius: 0;
    background-color: #f2f2f2;
    color: rgb(33, 37, 41);
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    font-family: 'Louis', Arial, Helvetica, sans-serif;
    position: relative;
    box-shadow: 0 1px 0px rgba(145, 145, 145, 0.42);
}

.visid-field-wrapper input:focus,
.visid-field-wrapper select:focus,
.visid-field-wrapper textarea:focus {
    outline: none;
    border: 0;
    box-shadow: 0 1px 0px rgba(145, 145, 145, 0.42);
    background-color: #f2f2f2;
}

/* Ocultar placeholder por defecto, se mostrará solo con foco */
.visid-field-wrapper input::placeholder,
.visid-field-wrapper select::placeholder,
.visid-field-wrapper textarea::placeholder {
    color: transparent;
    opacity: 0;
}

/* Mostrar placeholder solo cuando tiene foco */
.visid-field-wrapper input:focus::placeholder,
.visid-field-wrapper select:focus::placeholder,
.visid-field-wrapper textarea:focus::placeholder {
    color: var(--text-light);
    opacity: 0.5;
}

/* Select estilizado - Solo mostrar label, no opciones */
.visid-field-wrapper select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888888' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
    cursor: pointer;
    padding: 26px 2.5rem 10px 12px !important; /* Ajustar padding para alineación con inputs */
}

/* Select bloqueado */
.visid-field-wrapper select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
    background-image: none; /* Remover flecha cuando está deshabilitado */
}

/* Mostrar el texto del select cuando no es el placeholder */
.visid-field-wrapper select:not(.is-placeholder) {
    color: rgb(33, 37, 41) !important; /* Color del texto cuando una opción real está seleccionada */
}

/* Select cuando está enfocado */
.visid-field-wrapper select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230077d9' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
}

/* Opciones del select con mejor estilo */
.visid-field-wrapper select option {
    padding: 0.75rem;
    font-size: 1rem;
    color: rgb(33, 37, 41);
    background-color: #ffffff;
}

/* Ocultar la primera opción (placeholder) cuando está seleccionada */
.visid-field-wrapper select option:first-child {
    color: var(--text-light);
}

/* Cuando se selecciona una opción válida, mostrar el texto */
.visid-field-wrapper select:not([value=""]) {
    color: var(--text-dark);
}

/* Estilos para checkbox de términos y condiciones */
.visid-field-wrapper input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.visid-field-wrapper .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

/* Términos y condiciones alineados a la derecha */
.visid-field-wrapper:has(input[type="checkbox"]) {
    text-align: right;
    justify-content: flex-end;
}

.visid-field-wrapper:has(input[type="checkbox"]) .field-group {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

/* Mensajes de error */
.visid-field-wrapper .field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

.visid-field-wrapper input.field-error-input,
.visid-field-wrapper select.field-error-input,
.visid-field-wrapper textarea.field-error-input {
    border: 0 !important;
    box-shadow: 0 1px 0px rgba(220, 53, 69, 0.6) !important;
    background-color: #f2f2f2;
}

/* Icono de error al final de inputs con error */
.visid-field-wrapper input.field-error-input {
    background-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20width='12'%20height='12'%20fill='none'%20stroke='%23dc3545'%3e%3ccircle%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20stroke-linejoin='round'%20d='M5.8%203.6h.4L6%206.5z'/%3e%3ccircle%20cx='6'%20cy='8.2'%20r='.6'%20fill='%23dc3545'%20stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px 24px;
    padding-right: 48px; /* Espacio para el icono más grande */
}

/* Icono de error al final de selects con error */
.visid-field-wrapper select.field-error-input {
    background-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20width='12'%20height='12'%20fill='none'%20stroke='%23dc3545'%3e%3ccircle%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20stroke-linejoin='round'%20d='M5.8%203.6h.4L6%206.5z'/%3e%3ccircle%20cx='6'%20cy='8.2'%20r='.6'%20fill='%23dc3545'%20stroke='none'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23dc3545' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: right 12px center, right 36px center;
    background-size: 24px 24px, 12px 12px;
    padding-right: 60px; /* Espacio para ambos iconos (error + dropdown) */
}

/* Icono de error al final de textareas con error */
.visid-field-wrapper textarea.field-error-input {
    background-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20width='12'%20height='12'%20fill='none'%20stroke='%23dc3545'%3e%3ccircle%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20stroke-linejoin='round'%20d='M5.8%203.6h.4L6%206.5z'/%3e%3ccircle%20cx='6'%20cy='8.2'%20r='.6'%20fill='%23dc3545'%20stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px top 12px;
    background-size: 24px 24px;
    padding-right: 48px; /* Espacio para el icono más grande */
}

/* Label en estado de error */
.visid-field-wrapper input.field-error-input ~ .field-label.active,
.visid-field-wrapper select.field-error-input ~ .field-label.active,
.visid-field-wrapper textarea.field-error-input ~ .field-label.active {
    color: #dc3545;
}

/* Ajustar el label cuando hay error en el campo */
.visid-field-wrapper .field-group.error .field-label.active {
    color: #dc3545;
}

/* Texto de ayuda */
.visid-field-wrapper .field-help {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(33, 37, 41, 0.75);
    font-family: 'Louis', Arial, Helvetica, sans-serif;
    font-weight: 400;
    line-height: 16.5px;
    text-align: start;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    box-sizing: border-box;
}

/* Botón de envío */
.visid-submit-wrapper {
    text-align: right;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.btn-visid-submit {
    color: #fff;
    text-transform: none;
    border-color: rgba(0, 0, 0, 0);
    background-color: #0077d9;
    border-radius: 10px;
    padding: 12px 50px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
    font-family: 'Louis', Arial, Helvetica, sans-serif;
}

.btn-visid-submit:hover:not(:disabled) {
    background-color: #0056b3;
    border-color: rgba(0, 0, 0, 0);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 217, 0.3);
}

.btn-visid-submit:disabled {
    background-color: var(--text-light);
    border-color: rgba(0, 0, 0, 0);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Error global */
.visid-error-global {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.visid-error-global p {
    color: #721c24;
    margin: 0;
    font-size: 0.95rem;
}

/* Responsive Design */
/* Mobile pequeño - 1 columna */
@media (max-width: 480px) {
    .visid-container {
        padding: 1rem 0.75rem;
    }

    .visid-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .visid-fields-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .visid-field-wrapper.half-width {
        grid-column: 1 / -1;
    }
}

/* Tablet - 2 columnas */
@media (min-width: 481px) and (max-width: 1023px) {
    .visid-fields-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Desktop - 3 columnas */
@media (min-width: 1024px) {
    .visid-fields-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}


@media (max-width: 480px) {
    .visid-container {
        padding: 1rem 0.75rem;
    }

    .visid-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .visid-models-bar {
        gap: 0.5rem;
    }

    .model-item {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .visid-fields-grid {
        gap: 0.5rem;
    }

    .visid-field-wrapper input,
    .visid-field-wrapper select,
    .visid-field-wrapper textarea {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    .btn-visid-submit {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

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

.visid-form-content {
    animation: fadeIn 0.5s ease-out;
}

/* Loading spinner override para visid */
.visid-container .spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.visid-container .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(194, 155, 63, 0.2);
    border-top-color: var(--chevrolet-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ESTILOS DE COLOR PARA CHECKBOX - VISID LAYOUT
   Solo colores específicos del layout visid
   ============================================ */

/* Wrapper del sonar para el checkbox */
.visid-container .checkbox-sonar-wrapper {
    width: 24px;
    height: 24px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Capa de sonar/radar */
.visid-container .checkbox-sonar {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgb(0, 0, 0);
    opacity: 0.75;
    pointer-events: none;
}

/* Colores negros para visid */
.visid-container .checkbox-custom {
    border-color: rgb(0, 0, 0) !important;
    background-color: #ffffff !important;
    flex-shrink: 0 !important;
}

/* Estados de color para visid */
.visid-container .checkbox-option:has(.checkbox-input:checked) .checkbox-custom {
    border-color: rgb(0, 0, 0) !important;
    background-color: rgb(0, 0, 0) !important;
}

.visid-container .checkbox-option:has(.checkbox-input:checked) .checkbox-custom::after {
    border-right-color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}

/* Colores del label para visid */
.visid-container .checkbox-label {
    color: rgb(33, 37, 41) !important;
}

.visid-container .checkbox-option:has(.checkbox-input:checked) .checkbox-label {
    color: rgb(33, 37, 41) !important;
}

/* Estados disabled para visid - Solo el checkbox, el label mantiene color normal */
.visid-container .checkbox-option.checkbox-disabled .checkbox-label {
    color: rgb(33, 37, 41) !important; /* Label siempre con el mismo color */
    opacity: 1 !important; /* Label siempre visible, sin atenuación */
}

/* Alineación a la derecha del checkbox de términos */
.visid-container .terms-and-conditions {
    display: flex;
    justify-content: flex-end;
}

.visid-container .terms-and-conditions .terms-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

         .visid-container .terms-and-conditions .checkbox-option {
             display: flex;
             align-items: center;
             justify-content: flex-end;
         }


/* Sobrescribir la opacidad del contenedor disabled solo para el label - Mayor especificidad */
.visid-container .terms-and-conditions .checkbox-option.checkbox-disabled .checkbox-label {
    opacity: 1 !important; /* Forzar opacidad completa para el label */
    color: rgb(33, 37, 41) !important; /* Forzar color del label */
}

/* Regla adicional con máxima especificidad para el label disabled */
.visid-container .field-group.terms-and-conditions .checkbox-option.checkbox-disabled .checkbox-label {
    opacity: 1 !important;
    color: rgb(33, 37, 41) !important;
    filter: none !important;
}

.visid-container .checkbox-option.checkbox-disabled:has(.checkbox-input:checked) .checkbox-custom {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.visid-container .checkbox-option.checkbox-disabled:has(.checkbox-input:checked) .checkbox-custom::after {
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
}

.visid-container .checkbox-custom.checkbox-disabled {
    border-color: #d1d5db !important;
    background-color: #f3f4f6 !important;
}

.visid-container .checkbox-custom.checkbox-disabled::after {
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
}


