/* =========================================
   T-ASISTO · Formulario de Contacto
   Estilos inspirados en el carrusel original
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── Variables (mismo sistema del carrusel) ── */
:root {
  --blue:        #0059E2;
  --blue-mid:    #0047B3;
  --blue-light:  #abd8f7;
  --blue-glow:   rgba(0,89,226,0.22);
  --purple:      #6366F1;
  --green:       #0891B2;
  --red:         #EF4444;
  --amber:       #F59E0B;
  --dark:        #04111f;
  --dark-2:      #071e38;
  --text:        #061a33;
  --muted:       #2d5070;
  --bg-start:    #e6f4fc;
  --bg-end:      #abd8f7;
  --white:       #ffffff;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --shadow-sm:   0 4px 16px rgba(0,89,226,0.09);
  --shadow-md:   0 8px 32px rgba(0,89,226,0.14);
  --shadow-lg:   0 20px 60px rgba(0,89,226,0.20);
  --glow:        0 0 0 1px rgba(0,89,226,0.14), 0 8px 40px rgba(0,89,226,0.14);
  --transition:  0.65s cubic-bezier(0.77,0,0.18,1);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background:
    linear-gradient(rgba(0,89,226,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,89,226,0.03) 1px, transparent 1px),
    radial-gradient(ellipse 90% 70% at 60% 40%, #ddf0fb 0%, #c6e5f7 50%, #abd8f7 100%);
  background-size: 52px 52px, 52px 52px, 100% 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* =========================================
   FONDO DECORATIVO — igual al carrusel
   ========================================= */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.s1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,89,226,0.10), transparent 68%);
  top: -250px; right: -150px;
  animation: float 9s ease-in-out infinite;
}

.s2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,89,226,0.08), transparent 68%);
  bottom: -120px; left: -60px;
  animation: float 7s ease-in-out infinite reverse;
}

.s3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(99,102,241,0.10), transparent 68%);
  top: 40%; left: 25%;
  animation: float 11s ease-in-out infinite 2s;
}

.s4 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(0,89,226,0.07), transparent 68%);
  top: 10%; left: 40%;
  animation: float 8s ease-in-out infinite 1s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-28px) scale(1.06); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,89,226,0.18), 0 8px 40px rgba(0,89,226,0.14); }
  50%       { box-shadow: 0 0 0 1px rgba(0,89,226,0.35), 0 16px 56px rgba(0,89,226,0.28); }
}

@keyframes scan-line {
  0%   { transform: translateY(-100%); opacity: 0.04; }
  100% { transform: translateY(110vh); opacity: 0.04; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes check-draw {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}

/* =========================================
   LAYOUT PRINCIPAL
   ========================================= */
.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  max-width: 1060px;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.7s cubic-bezier(0.22,1,0.36,1) both;
}

/* =========================================
   COLUMNA IZQUIERDA — Branding
   ========================================= */
.brand-col {
  flex: 0 0 360px;
  background: linear-gradient(148deg, #0041a8 0%, #0059E2 45%, #1a8cff 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 48px 40px;
}

/* Línea de escaneo en brand */
.brand-col::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: scan-line 5s linear infinite;
  pointer-events: none;
}

/* Grid decorativo brand */
.brand-col::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-logo-wrap {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: glow-pulse 3.5s ease-in-out infinite;
  margin: 0 auto 4px;
  align-self: center;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1;
}

.brand-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  margin-top: -8px;
}

/* Features list */
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 12px 16px;
  transition: background 0.25s, transform 0.25s;
}

.feature-item:hover {
  background: rgba(255,255,255,0.16);
  transform: translateX(4px);
}

.feat-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.feature-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-item strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.feature-item span {
  font-size: 11.5px;
  color: rgba(255,255,255,0.68);
}

.brand-badge {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1px;
  align-self: flex-start;
  margin-top: 8px;
}

/* =========================================
   COLUMNA DERECHA — Formulario
   ========================================= */
.form-col {
  flex: 1;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: stretch;
}

.form-card {
  width: 100%;
  padding: 48px 44px;
  position: relative;
  overflow: hidden;
}

/* ── Cabecera formulario ── */
.form-header {
  margin-bottom: 32px;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--blue);
  margin-bottom: 10px;
}

.form-label::before {
  content: '';
  display: block;
  width: 18px; height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

.form-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  background: linear-gradient(135deg, #041e3a 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.form-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Filas y campos ── */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row .field-wrap {
  flex: 1;
  min-width: 0;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-wrap.full-width {
  margin-bottom: 16px;
}

.field-wrap label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* ── Input wrapper ── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon svg { width: 100%; height: 100%; display: block; }

.textarea-wrap { align-items: flex-start; }

.textarea-icon {
  top: 14px;
  transform: none;
}

/* ── Inputs y select ── */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(0,89,226,0.18);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,89,226,0.12);
  background: #fff;
}

input[type="text"]:focus ~ .input-icon,
input[type="email"]:focus ~ .input-icon,
input[type="tel"]:focus ~ .input-icon {
  color: var(--blue);
}

input[type="text"].invalid,
input[type="email"].invalid,
select.invalid,
textarea.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

input::placeholder,
textarea::placeholder {
  color: rgba(45,80,112,0.4);
}

textarea {
  resize: vertical;
  min-height: 110px;
  padding-top: 13px;
  line-height: 1.6;
}

/* ── Select personalizado ── */
.select-wrap { position: relative; }

select {
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.select-arrow svg { width: 100%; display: block; }

/* ── Contador de caracteres ── */
.char-counter {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.7;
  margin-top: -4px;
}

.char-counter.near-limit { color: var(--amber); }
.char-counter.at-limit   { color: var(--red); }

/* ── Errores de campo ── */
.field-error {
  font-size: 11.5px;
  color: var(--red);
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 5px;
  margin-top: -2px;
}

.field-error.visible {
  display: flex;
  animation: fadeInUp 0.2s ease both;
}

.field-error::before {
  content: '⚠';
  font-size: 10px;
}

.checkbox-error {
  margin-top: 4px;
}

/* ── Checkbox personalizado ── */
.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.custom-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(0,89,226,0.3);
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}

.custom-check svg {
  width: 12px; height: 10px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.checkbox-wrap input:checked + .custom-check {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,89,226,0.15);
}

.checkbox-wrap input:checked + .custom-check svg {
  opacity: 1;
  animation: check-draw 0.2s ease forwards;
}

.checkbox-wrap span:last-child {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link:hover { opacity: 0.75; }

/* ── Botón de envío ── */
.btn-submit {
  width: 100%;
  margin-top: 20px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue) 60%, #2196ff 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,89,226,0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  letter-spacing: 0.2px;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,89,226,0.45);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-text,
.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-loading { display: none; }

.btn-submit.loading .btn-text    { display: none; }
.btn-submit.loading .btn-loading { display: flex; }

.btn-icon { width: 18px; height: 18px; }
.btn-icon svg { width: 100%; height: 100%; }

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* =========================================
   PANELES DE ESTADO
   ========================================= */
.state-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 24px 12px;
  animation: scaleIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 60px 48px;
}

.state-panel.visible {
  display: flex;
}

/* ── Éxito ── */
.success-panel { background: rgba(240,252,255,0.85); }

.state-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.success-icon {
  background: rgba(8,145,178,0.1);
  border: 2px solid rgba(8,145,178,0.3);
  color: var(--green);
  animation: glow-pulse 3s ease-in-out infinite;
}

.success-icon svg { width: 46px; height: 46px; }

.success-panel h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #041e3a 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-panel p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 340px;
}

.ticket-info {
  background: rgba(0,89,226,0.07);
  border: 1px solid rgba(0,89,226,0.2);
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-info:empty { display: none; }

/* ── Error ── */
.error-panel { background: rgba(255,245,245,0.88); }

.error-icon {
  background: rgba(239,68,68,0.08);
  border: 2px solid rgba(239,68,68,0.25);
  color: var(--red);
}

.error-icon svg { width: 44px; height: 44px; }

.error-panel h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #b91c1c;
}

.error-panel p {
  font-size: 14.5px;
  color: #7f1d1d;
  line-height: 1.6;
  max-width: 320px;
}

/* ── Botones de reset / retry ── */
.btn-reset,
.btn-retry {
  padding: 12px 32px;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}

.btn-reset {
  background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,89,226,0.30);
}

.btn-reset:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,89,226,0.40); }

.btn-retry {
  background: #fff;
  color: var(--red);
  border: 1.5px solid rgba(239,68,68,0.3);
  box-shadow: 0 4px 14px rgba(239,68,68,0.12);
}

.btn-retry:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239,68,68,0.20); }

/* =========================================
   PREGUNTAS DE DIAGNÓSTICO INTERACTIVAS
   ========================================= */

/* Contenedor de cada pregunta */
.diag-question {
  margin-bottom: 22px;
}

.diag-q-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Chips (checkboxes) ── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(0,89,226,0.18);
  transition: all 0.18s;
  white-space: nowrap;
}

.chip span:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(0,89,226,0.05);
}

.chip input:checked + span {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 3px 10px rgba(0,89,226,0.28);
}

/* Input "Otro" que aparece al seleccionar ese chip */
.otro-input {
  margin-top: 8px;
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid rgba(0,89,226,0.22);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: rgba(255,255,255,0.8);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.otro-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,89,226,0.1);
}

/* ── Radio cards ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(0,89,226,0.15);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  user-select: none;
  transition: all 0.18s;
}

.radio-card:hover {
  border-color: rgba(0,89,226,0.35);
  background: rgba(0,89,226,0.04);
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.radio-card input:checked ~ .radio-text {
  color: var(--blue);
  font-weight: 600;
}

.radio-card:has(input:checked) {
  border-color: var(--blue);
  background: rgba(0,89,226,0.07);
  box-shadow: 0 2px 10px rgba(0,89,226,0.12);
}

.radio-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 26px;
  text-align: center;
}

.radio-text {
  font-size: 13.5px;
  color: var(--text);
  transition: color 0.18s;
}

/* =========================================
   SECCIÓN DE TÍTULO DE FORMULARIO
   ========================================= */
.form-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--blue);
  margin: 8px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid rgba(0,89,226,0.13);
}

/* =========================================
   CHAT PANEL
   ========================================= */
.chat-panel.state-panel {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

/* ── Cabecera ── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0041a8 0%, #0059E2 100%);
  flex-shrink: 0;
}

.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chat-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-info strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.78);
}

.chat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: chat-dot-pulse 2s ease-in-out infinite;
}

@keyframes chat-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.chat-ticket-badge {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 20px;
  padding: 4px 11px;
  flex-shrink: 0;
  display: none;
}

.chat-ticket-badge:not(:empty) { display: block; }

/* ── Mensajes ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: calc(100% - 180px);
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,89,226,0.18); border-radius: 4px; }

.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: fadeInUp 0.22s ease both;
}

.wrap-user   { justify-content: flex-end; }
.wrap-agent  { justify-content: flex-start; }
.wrap-typing { justify-content: flex-start; }

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.bubble-user {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Filas con icono alineado dentro de la burbuja de usuario */
.bubble-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  line-height: 1.7;
}

.bubble-icon {
  font-size: 13px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.bubble-txt {
  font-size: 13px;
  flex: 1;
  word-break: break-all;
}

.bubble-agent {
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(0,89,226,0.12);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Links dentro de burbujas del agente */
.bubble-agent .chat-link {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.bubble-agent .chat-link:hover {
  color: var(--blue-mid);
}

/* Links dentro de burbujas del usuario (fondo azul) */
.bubble-user .chat-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.9;
}
.bubble-user .chat-link:hover {
  opacity: 1;
}

/* ── Typing dots ── */
.typing-bubble { padding: 12px 16px; min-width: 56px; }

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Input del chat ── */
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(0,89,226,0.1);
  background: rgba(255,255,255,0.92);
  flex-shrink: 0;
}

.chat-input-wrap input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid rgba(0,89,226,0.18);
  border-radius: 22px;
  font-size: 13.5px;
  background: #fff;
  outline: none;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0;
}

.chat-input-wrap input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,89,226,0.1);
}

#chatSend {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 3px 10px rgba(0,89,226,0.32);
}

#chatSend:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 5px 16px rgba(0,89,226,0.42);
}

#chatSend:disabled { opacity: 0.5; cursor: not-allowed; }

#chatSend svg { width: 17px; height: 17px; }

/* ── Botón nueva consulta dentro del chat ── */
.chat-panel .btn-reset {
  margin: 0 16px 14px;
  align-self: center;
  font-size: 12.5px;
  padding: 8px 20px;
}

/* =========================================
   RESPONSIVO
   ========================================= */
@media (max-width: 820px) {
  body { padding: 20px 16px; align-items: flex-start; }

  .page-wrapper {
    flex-direction: column;
    border-radius: var(--radius-lg);
    max-width: 500px;
    margin: 0 auto;
  }

  .brand-col {
    flex: none;
    padding: 36px 32px;
  }

  .brand-features { display: none; }

  .brand-title { font-size: 34px; }

  .form-card { padding: 36px 28px; }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .form-card { padding: 28px 20px; }
  .brand-col  { padding: 28px 22px; }
  .state-panel { padding: 40px 24px; }
}


