:root {
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Tonos claros e institucionales (Comfamiliar Huila) */
  --brand-blue: #0066A4;
  --brand-blue-light: #E0F2FE;
  --brand-blue-soft: #F0F9FF;
  --brand-green: #8CC63F;
  --brand-green-dark: #4D7C0F;
  --brand-green-light: #ECFCCB;
  --brand-green-soft: #F7FEE7;

  /* Estados suaves y luminosos */
  --border-light: #E2E8F0;
  --border-focus: #7DD3FC;
  --shadow-card: 0 24px 60px -15px rgba(15, 23, 42, 0.07), 0 4px 18px -4px rgba(15, 23, 42, 0.04);
  --shadow-input: 0 4px 16px rgba(14, 116, 144, 0.05);
  --shadow-input-focus: 0 0 0 4px rgba(186, 230, 253, 0.65), 0 8px 22px rgba(2, 132, 199, 0.09);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

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

html,
body {
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Iluminación ambiental clara */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--top {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(224, 242, 254, 0.9) 0%, rgba(224, 242, 254, 0) 70%);
  top: -140px;
  left: -100px;
}

.bg-glow--bottom {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(236, 252, 203, 0.85) 0%, rgba(236, 252, 203, 0) 70%);
  bottom: -150px;
  right: -100px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Contenedor principal amplio para que el banner y el texto completo del campo se vean sin cortes */
.app-shell {
  width: 100%;
  max-width: 1040px;
  position: relative;
  z-index: 1;
}

.consulta-card {
  background: var(--bg-card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-xl);
  padding: 36px 38px 38px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Cabecera con logo más grande arriba */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo {
  max-width: 310px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Contenedor del Banner Horizontal */
.banner-box {
  width: 100%;
  margin-bottom: 26px;
  border-radius: 20px;
  overflow: hidden;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  box-shadow: 0 10px 26px -8px rgba(0, 72, 132, 0.16);
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.flat-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Formulario y barra de consulta */
.search-form {
  width: 100%;
}

.input-group {
  display: flex;
  align-items: center;
  background: #F8FAFC;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 7px 8px 7px 14px;
  box-shadow: var(--shadow-input);
  transition: all 0.22s ease;
}

.input-group:focus-within {
  background: #FFFFFF;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-input-focus);
}

.input-group.input-group--error {
  border-color: #FDA4AF;
  box-shadow: 0 0 0 4px rgba(254, 226, 226, 0.7);
}

.input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

/* Selector con nombres completos de tipos de documento */
.doc-type-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.doc-type-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1E293B;
  padding: 10px 26px 10px 6px;
  cursor: pointer;
  border-radius: 10px;
  field-sizing: content;
  max-width: 320px;
  text-overflow: ellipsis;
  transition: background-color 0.15s ease, color 0.15s ease, width 0.15s ease;
}

.doc-type-select:hover {
  background-color: #F1F5F9;
}

.doc-type-select:focus {
  outline: none;
  background-color: #E0F2FE;
  color: #0369A1;
}

.select-chevron {
  position: absolute;
  right: 7px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.input-divider {
  width: 1.5px;
  height: 26px;
  background: #CBD5E1;
  margin: 0 12px 0 6px;
  flex-shrink: 0;
}

.doc-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.doc-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 10px 4px;
  outline: none;
}

.doc-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  margin-right: 6px;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.clear-btn[hidden] {
  display: none !important;
}

.clear-btn:hover {
  transform: scale(1.08);
}

.clear-btn svg {
  width: 20px;
  height: 20px;
}

/* Botón Consultar */
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284C7 0%, #0066A4 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(2, 132, 199, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -4px rgba(2, 132, 199, 0.45);
  filter: brightness(1.04);
}

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

.submit-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.submit-btn__icon {
  width: 18px;
  height: 18px;
}

.submit-btn__spinner {
  width: 18px;
  height: 18px;
  border: 2.2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.submit-btn__spinner[hidden],
.submit-btn__icon[hidden] {
  display: none !important;
}

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

/* Contenedor de Resultados */
.result-container {
  margin-top: 24px;
  animation: slideFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-container[hidden] {
  display: none !important;
}

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

.result-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  background: #F8FAFC;
}

.result-card--success {
  background: linear-gradient(145deg, #F7FEE7 0%, #F0FDF4 100%);
  border-color: #D9F99D;
}

.result-card--neutral {
  background: linear-gradient(145deg, #F8FAFC 0%, #F1F5F9 100%);
  border-color: #E2E8F0;
}

.result-card--error {
  background: linear-gradient(145deg, #FFF1F2 0%, #FFE4E6 100%);
  border-color: #FECDD3;
}

.result-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #FFFFFF;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.result-icon-box svg {
  width: 28px;
  height: 28px;
}

.result-body {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.35;
}

.result-card--success .result-title {
  color: #365314;
}

.result-card--error .result-title {
  color: #9F1239;
}

.result-desc {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #FFFFFF;
  color: #475569;
  border: 1px solid #E2E8F0;
}

.meta-pill--highlight {
  background: #ECFCCB;
  color: #3F6212;
  border-color: #BEF264;
}

.meta-pill svg {
  width: 15px;
  height: 15px;
}

/* Botones de contacto cuando No aplica o no tiene Kit Escolar */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: #FFFFFF;
  color: #0369A1;
  border: 1.5px solid #BAE6FD;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.07);
  transition: all 0.18s ease;
}

.contact-btn:hover {
  background: #F0F9FF;
  border-color: #38BDF8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

.contact-btn--whatsapp {
  color: #15803D;
  border-color: #BBF7D0;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.07);
}

.contact-btn--whatsapp:hover {
  background: #F0FDF4;
  border-color: #4ADE80;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.13);
}

.contact-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.contact-btn__number {
  font-weight: 700;
  color: #0284C7;
}

.contact-btn__number--wa {
  color: #16A34A;
}

/* Responsivo para tablets y móviles */
@media (max-width: 740px) {
  body {
    align-items: flex-start;
    padding: 16px 12px 32px;
  }

  .consulta-card {
    padding: 24px 18px 24px;
    border-radius: 22px;
  }

  .brand-logo {
    max-width: 240px;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .input-icon {
    display: none;
  }

  .doc-type-wrapper {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 11px;
    padding: 2px 6px;
  }

  .doc-type-select {
    width: 100% !important;
    max-width: none;
    padding: 10px 28px 10px 8px;
  }

  .input-divider {
    display: none;
  }

  .doc-input-wrapper {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 11px;
    padding: 2px 8px;
  }

  .doc-input {
    font-size: 0.95rem;
    padding: 10px 4px;
  }

  .submit-btn {
    width: 100%;
    padding: 13px 18px;
  }

  .result-card {
    flex-direction: column;
    padding: 18px;
    gap: 12px;
  }

  .result-body {
    width: 100%;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .contact-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 12px 14px;
    font-size: 0.88rem;
  }
}
