/* =========================================
   ESTILOS GENERALES Y FUENTES
   ========================================= */
   @import url('https://fonts.googleapis.com/css2?family=Dosis:wght@400;600;700;800&display=swap');

   body {
       font-family: 'Dosis', sans-serif;
       margin: 0;
       padding: 0;
       box-sizing: border-box;
       color: #333;
   }
   
   /* =========================================
      CONTENEDORES Y ESTRUCTURA
      ========================================= */
   .formulario-section {
       padding: 60px 20px;
       min-height: 600px;
       display: flex;
       align-items: center;
       justify-content: center;
       /* Imagen de fondo por defecto (se puede sobreescribir en línea si cambia por página) */
       background: url('../img/gallery/San-Andres-island-credit-Mario-Carvajal-CC4.jpg') no-repeat center center/cover;
   }
   
   .formulario-container {
       max-width: 1100px;
       width: 100%;
       margin: auto;
       background-color: rgba(255, 255, 255, 0.95);
       border-radius: 20px;
       padding: 40px;
       box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
       backdrop-filter: blur(5px);
   }
   
   .formulario-titulo {
       text-align: center;
       font-size: 2.8rem;
       font-weight: 800;
       color: #C62E3D;
       margin-bottom: 35px;
       text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
   }
   
   /* =========================================
      INPUTS Y LABELS MODERNOS
      ========================================= */
   .label-modern {
       font-weight: 700;
       font-size: 0.95rem;
       color: #444;
       margin-bottom: 6px;
       display: block;
       margin-left: 5px;
   }
   
   .input-wrapper {
       position: relative;
       display: flex;
       align-items: center;
   }
   
   .input-icon {
       position: absolute;
       left: 15px;
       font-size: 1.2rem;
       pointer-events: none;
       z-index: 10;
       color: #666; /* Icono gris suave */
   }
   
   .input-modern {
       width: 100%;
       padding: 14px 14px 14px 45px; /* Espacio a la izquierda para el icono */
       border: 1px solid #e0e0e0;
       border-radius: 12px;
       font-size: 1rem;
       font-family: 'Dosis', sans-serif;
       color: #333;
       background-color: #f9f9f9;
       transition: all 0.3s ease;
       appearance: none; /* Limpia estilos nativos en iOS */
   }
   
   .input-modern:focus {
       border-color: #C62E3D;
       background-color: #fff;
       outline: none;
       box-shadow: 0 0 0 4px rgba(198, 46, 61, 0.1);
   }
   
   /* Ajuste para select (flecha) */
   select.input-modern {
       background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23C62E3D%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
       background-repeat: no-repeat;
       background-position: right 15px center;
       background-size: 12px;
   }
   
   /* =========================================
      TOGGLES (Botones Hotel/Paquete)
      ========================================= */
   .toggle-wrapper {
       display: flex; 
       justify-content: center; 
       margin-bottom: 30px;
   }
   
   .toggle-container {
       background: #f0f0f0;
       padding: 6px;
       border-radius: 50px;
       display: inline-flex;
       border: 1px solid #ddd;
       box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
       width: 100%;
       max-width: 400px; /* Ancho máximo del toggle */
   }
   
   .radio-tab {
       cursor: pointer;
       flex: 1;
   }
   
   .tab-content {
       display: flex; 
       align-items: center; 
       justify-content: center;
       gap: 10px; 
       padding: 12px 15px; 
       border-radius: 50px; 
       transition: all 0.3s;
       font-size: 1.1rem;
       color: #555;
       font-weight: 600;
   }
   
   .radio-tab input:checked + .tab-content {
       background-color: #C62E3D;
       color: white;
       box-shadow: 0 4px 10px rgba(198, 46, 61, 0.3);
   }
   
   .radio-tab:hover .tab-content {
       background-color: rgba(198, 46, 61, 0.05);
   }
   
   .radio-tab input:checked:hover + .tab-content {
       background-color: #a82532;
   }
   
   /* =========================================
      GRID SYSTEMS
      ========================================= */
   .grid-3 {
       display: grid;
       grid-template-columns: repeat(3, 1fr);
       gap: 20px;
       margin-bottom: 25px;
   }
   
   .grid-cols-custom {
       display: grid;
       grid-template-columns: 1fr 1fr 2fr;
       gap: 20px;
       margin-bottom: 25px;
   }
   
   .grid-2 {
       display: grid;
       grid-template-columns: 1fr 1fr;
       gap: 20px;
       margin-bottom: 25px;
   }
   
   .grid-auth {
       display: grid; 
       grid-template-columns: 1fr 1fr; 
       gap: 20px; 
       align-items: center; 
       margin-bottom: 30px;
   }
   
   /* =========================================
      BOTONES
      ========================================= */
   .btn-submit-container {
       text-align: center;
   }
   
   .btn-submit {
       background-color: #C62E3D;
       color: #fff;
       padding: 15px 60px;
       border: none;
       border-radius: 50px;
       font-size: 1.2rem;
       font-weight: 800;
       cursor: pointer;
       box-shadow: 0 8px 20px rgba(198, 46, 61, 0.4);
       transition: all 0.3s ease;
       width: 100%;
       max-width: 350px;
   }
   
   .btn-submit:hover {
       transform: translateY(-2px);
       box-shadow: 0 12px 25px rgba(198, 46, 61, 0.6);
   }
   
   .btn-submit:disabled {
       background-color: #aaa;
       cursor: not-allowed;
       transform: none;
       box-shadow: none;
   }
   
   .captcha-text {
       margin-top: 10px;
       font-size: 0.8rem;
       color: #666;
   }
   
   /* =========================================
      OTROS COMPONENTES
      ========================================= */
   .auth-box {
       background: #fff;
       padding: 15px;
       border-radius: 12px;
       border: 1px dashed #ccc;
   }
   
   .auth-label {
       display: flex;
       align-items: center;
       gap: 10px;
       cursor: pointer;
       font-size: 0.95rem;
   }
   
   .checkbox-custom {
       width: 20px;
       height: 20px;
       accent-color: #C62E3D;
       cursor: pointer;
   }
   
   .link-rojo {
       color: #C62E3D;
       font-weight: bold;
       text-decoration: underline;
   }
   
   /* =========================================
      FLATPICKR (Calendario)
      ========================================= */
   .flatpickr-calendar {
       font-family: 'Dosis', sans-serif !important;
       border-radius: 12px !important;
       box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
       border: none !important;
   }
   .flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
       background: #C62E3D !important;
       border-color: #C62E3D !important;
   }
   .flatpickr-day.today {
       border-color: #C62E3D !important;
   }
   
   /* =========================================
      RESPONSIVE (MÓVIL)
      ========================================= */
   @media screen and (max-width: 768px) {
       .formulario-section {
           padding: 20px 10px;
           background: #f8f9fa !important; /* Fondo plano en móvil para rapidez */
           min-height: auto;
       }
   
       .formulario-container {
           padding: 25px 20px;
           box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
           border-radius: 16px;
       }
   
       .formulario-titulo {
           font-size: 1.8rem;
           margin-bottom: 25px;
       }
   
       /* Romper Grids a 1 columna */
       .grid-3, .grid-cols-custom, .grid-auth {
           grid-template-columns: 1fr;
           gap: 15px;
       }
   
       /* Grid de fechas e invitados se mantiene en 2 col si es posible, o 1 si es muy pequeño */
       .grid-2 {
           gap: 15px;
       }
   
       /* Ajuste de botón */
       .btn-submit {
           width: 100%;
           max-width: 100%;
           padding: 14px;
       }
       
       .toggle-container {
           width: 100%;
           max-width: 100%;
       }
   }

/* =========================================
   LOADING OVERLAY (AVIÓN CORPORATIVO)
   ========================================= */
   .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: none; /* Oculto por defecto */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    backdrop-filter: blur(5px);
}

.loading-content {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

/* Círculo Guía (Estela) */
.loading-track {
    width: 100%;
    height: 100%;
    border: 2px dashed #f0f0f0;
    border-top-color: #C62E3D;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

/* El Avión */
.plane-icon {
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    /* SVG del avión en rojo corporativo */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C62E3D'%3E%3Cpath d='M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    /* El avión gira con el contenedor padre (track) pero lo rotamos para que mire adelante */
    transform: rotate(45deg); 
}

/* Texto animado */
.loading-text {
    color: #C62E3D;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    animation: pulse 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}

.loading-subtext {
    color: #666;
    font-size: 1rem;
    max-width: 80%;
}

/* Animaciones */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

/* =========================================
   MENSAJE NO ENCONTRADO / ASESOR
   ========================================= */
.not-found-message {
    display: none; /* Oculto inicial */
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.not-found-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    display: block;
    animation: bounce 2s infinite;
}

.not-found-title {
    color: #C62E3D;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.not-found-desc {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* =========================================
   MENSAJES DE ERROR / TOAST / MODAL
   ========================================= */
   .error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    z-index: 10000; /* Por encima del loading */
    display: none; /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.error-card {
    background: white;
    padding: 35px 25px;
    border-radius: 20px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border-top: 6px solid #dc3545; /* Rojo alerta */
    animation: shake 0.4s ease-in-out;
    position: relative;
}

.error-icon {
    font-size: 3.5rem;
    color: #dc3545;
    margin-bottom: 15px;
    display: block;
}

.error-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.error-text {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.5;
}

.error-countdown {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 20px;
    font-style: italic;
}

.btn-error-close {
    background: #333;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
    max-width: 200px;
}

.btn-error-close:hover {
    background: #555;
    transform: translateY(-2px);
}

/* Animación de sacudida para llamar la atención */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}