/* =========================================================
   Web-to-Case Volaris
   ========================================================= */

/* =======================================
   VARIABLES CSS (Paleta Volaris)
   ======================================= */
   
:root {
  --v-font: 'Inter', Arial, sans-serif;
  --v-primary: #911083;
  --v-primary-hover: #6e0b65;
  --v-primary-alt: #A12885;
  --v-bg: #ffffff;
  --v-text: #242424;
  --v-muted: #595959;
  --v-border: #d7d7d7;
  --v-border-strong: #bdbdbd;
  --v-focus: rgba(145, 16, 131, .35);
  --v-shadow: 0 2px 20px rgba(0, 0, 0, .08);
  --v-radius: 12px;
  --v-radius-sm: 10px;
}

/* =======================================
   CONTENEDOR PRINCIPAL
   ======================================= */
.web-to-case-form {
  padding: 22px 12px;
  background-color: var(--v-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 98vw;
  margin: 20px auto;
  box-shadow: var(--v-shadow);
  font-family: var(--v-font);
}

/* Desktop */
@media (min-width: 600px) {
  .web-to-case-form {
    padding: 40px 20px;
    max-width: 800px;
    margin: 32px auto;
  }
}

/* =======================================
   TÍTULOS Y DESCRIPCIÓN
   ======================================= */
.form-title {
  color: var(--v-primary);
  font-size: 1.35em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.form-description {
  text-align: center;
  color: var(--v-muted);
  margin-bottom: 24px;
  font-size: 1em;
  line-height: 1.55;
}

/* Desktop */
@media (min-width: 600px) {
  .form-title {
    font-size: 2em;
  }
  
  .form-description {
    margin-bottom: 28px;
    font-size: 1.08em;
  }
}

/* =======================================
   LAYOUT DEL FORMULARIO
   ======================================= */
.styled-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =======================================
   FIELDSETS (Secciones)
   ======================================= */
fieldset.group {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
}

fieldset.group legend {
  font-weight: 700;
  padding: 0 8px;
}

.group .form-grid {
  margin-top: 8px;
}

/* =======================================
   GRID (Mobile: 1 columna, Desktop: 2 columnas)
   ======================================= */
.form-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr; /* Mobile: una columna */
}

/* Desktop: dos columnas */
@media (min-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .form-grid .full {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
  }
}

/* =======================================
   LABELS
   ======================================= */
.styled-form label {
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.styled-form .required::after {
  content: "*";
  color: var(--v-primary);
  font-weight: 700;
  margin-left: 2px;
}

/* =======================================
   INPUTS, SELECTS Y TEXTAREAS
   ======================================= */
.styled-form input,
.styled-form textarea,
.styled-form select {
  padding: 12px;
  border: 1.5px solid var(--v-border);
  border-radius: var(--v-radius-sm);
  font-size: 1em;
  width: 100%;
  background: #f8f8f8;
  color: var(--v-text);
  transition: border .2s, background .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.styled-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* Flecha personalizada para select */
.styled-form select {
  background-image: linear-gradient(45deg, transparent 50%, #777 50%),
                    linear-gradient(135deg, #777 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 4px),
                       calc(100% - 12px) calc(50% + 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* =======================================
   ESTADOS DE FOCO
   ======================================= */
.styled-form input:focus,
.styled-form textarea:focus,
.styled-form select:focus {
  border-color: var(--v-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(145, 16, 131, .12);
}

.styled-form input:focus-visible,
.styled-form textarea:focus-visible,
.styled-form select:focus-visible {
  outline: 3px solid var(--v-focus);
  outline-offset: 2px;
}

/* =======================================
   PLACEHOLDERS
   ======================================= */
.styled-form ::placeholder {
  color: #9a9a9a;
}

/* =======================================
   ESTADOS DISABLED / READONLY
   ======================================= */
.styled-form input[disabled],
.styled-form textarea[disabled],
.styled-form select[disabled],
.styled-form input[readonly] {
  opacity: .65;
  cursor: not-allowed;
  background: #f1f1f1;
}

/* =======================================
   CHECKBOXES Y RADIOS
   ======================================= */
.control-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-inline label {
  font-weight: 500;
  color: #333;
  margin: 0;
}

.styled-form input[type="checkbox"],
.styled-form input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 6px 0 0;
  accent-color: var(--v-primary);
  background: #fff;
  border: 1.5px solid var(--v-border-strong);
  border-radius: 4px;
}

/* =======================================
   HINTS Y MENSAJES
   ======================================= */
.form-hint {
  color: #6c6c6c;
  font-size: .95em;
  margin-top: 6px;
}

.form-error {
  color: #b00020;
  font-weight: 600;
  margin-top: 6px;
}

.form-success {
  color: #1f8f3a;
  font-weight: 600;
  margin-top: 6px;
}

/* Estado de error */
.is-error input,
.is-error textarea,
.is-error select {
  border-color: #b00020;
  box-shadow: 0 0 0 3px rgba(176, 0, 32, .12);
}

/* =======================================
   BOTONES
   ======================================= */
.btn-primary {
  background-color: var(--v-primary);
  color: #fff;
  padding: 14px 0;
  border: none;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 1.08em;
  cursor: pointer;
  transition: background .25s, box-shadow .25s, transform .06s ease;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(145, 16, 131, .08);
  width: 100%;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--v-primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--v-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(145, 16, 131, .12);
}

.btn-secondary {
  background: #fff;
  color: var(--v-primary);
  border: 2px solid var(--v-primary);
  border-radius: 100px;
  padding: 14px 0;
  font-weight: 700;
  font-size: 1.08em;
  cursor: pointer;
  transition: background .25s, color .25s, box-shadow .25s;
  margin-top: 8px;
  width: 100%;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: #f2e5f6;
  color: var(--v-primary-hover);
}

.btn-tertiary {
  background: transparent;
  color: var(--v-primary-alt);
  border: 2px solid var(--v-primary-alt);
  border-radius: 100px;
  padding: 12px 0;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background .25s, color .25s;
  width: 100%;
}

.btn-tertiary:hover,
.btn-tertiary:focus {
  background: #f6eafd;
  color: var(--v-primary);
}

/* Botones deshabilitados */
button[disabled],
.btn-primary[disabled],
.btn-secondary[disabled],
.btn-tertiary[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* =======================================
   GRUPO DE ACCIONES
   ======================================= */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-tertiary {
  flex: 0 0 auto;
  width: 100%;
}

/* Desktop: botones en línea */
@media (min-width: 600px) {
  .form-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .form-actions .btn-primary {
    flex: 1 1 220px;
  }
  
  .form-actions .btn-secondary,
  .form-actions .btn-tertiary {
    flex: 1 1 180px;
  }
}

/* =======================================
   SPINNER Y MENSAJE DE CONFIRMACIÓN
   ======================================= */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#submitStatus {
  text-align: center;
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  display: none;
}

#submitStatus.loading {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

#submitStatus.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

/* =======================================
   LOADER PARA BOTÓN
   ======================================= */
.is-loading {
  pointer-events: none;
  position: relative;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .35) 0, rgba(255, 255, 255, 0) 60%);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: .6; }
}

/* =======================================
   OVERRIDES
   ======================================= */
.web-to-case-form {
  width: 100% !important;
  max-width: 800px;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

.web-to-case-form .container,
.web-to-case-form .row {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
}

.web-to-case-form .sidebar,
.web-to-case-form .kb-sidebar,
.web-to-case-form .col-md-4 {
  display: none !important;
}

/* =======================================
   ACCESIBILIDAD - SOLO LECTORES DE PANTALLA
   ======================================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Checkbox y Control Inline - Aviso de Privacidad
   ========================================================= */

/* Contenedor del checkbox */
.control-inline {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 24px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

@media (min-width: 760px) {
    .control-inline {
        padding: 20px;
        margin: 32px 0;
    }
}

/* Checkbox input */
.control-inline input[type="checkbox"] {
    /* Resetear estilos */
    appearance: auto;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    
    /* Tamaño visible */
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    
    /* Posicionamiento */
    margin: 2px 0 0 0;
    flex-shrink: 0;
    
    /* Cursor */
    cursor: pointer;
    
    /* Asegurar que sea visible */
    opacity: 1 !important;
    position: relative !important;
    
    /* Borde y fondo */
    border: 2px solid #911083;
    border-radius: 4px;
    background-color: #fff;
}

/* Checkbox cuando está checked */
.control-inline input[type="checkbox"]:checked {
    background-color: #911083;
    border-color: #911083;
    accent-color: #911083;
}

/* Focus state */
.control-inline input[type="checkbox"]:focus {
    outline: 2px solid #911083;
    outline-offset: 2px;
}

/* Hover state */
.control-inline input[type="checkbox"]:hover {
    border-color: #6e0b65;
}

/* Label del checkbox */
.control-inline label {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.5;
    color: #242424;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

@media (min-width: 760px) {
    .control-inline label {
        font-size: 1em;
    }
}

/* Link dentro del label */
.control-inline label a {
    color: #911083;
    text-decoration: underline;
    font-weight: 600;
}

.control-inline label a:hover {
    color: #6e0b65;
    text-decoration: none;
}

/* Estado inválido */
.control-inline input[type="checkbox"]:invalid {
    border-color: #dc3545;
}

/* Asegurar que no haya estilos conflictivos */
.control-inline input[type="checkbox"]:not(:checked),
.control-inline input[type="checkbox"]:checked {
    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}