/* Paleta y tipografía de marca Hans Soluciones
   (extraídos de hans-soluciones.es — Elementor kit global colors)   */
:root {
  --primary: #00427B;          /* azul marino corporativo */
  --primary-hover: #00325e;
  --secondary: #08A4A4;        /* turquesa acento */
  --accent: #EF7D00;           /* naranja CTA principal */
  --accent-hover: #d16a00;
  --sky: #83BDEE;              /* azul claro */
  --cream: #F8F3EC;            /* fondo suave */
  --text: #5A5A5A;             /* texto cuerpo */
  --text-strong: #292929;      /* titulares */
  --border: #d9dde3;
  --muted: #6a7280;
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 12px rgba(0,66,123,.08);
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-head: "Merriweather", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

.widget {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

/* --- Cabecera --- */
.widget__header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--primary);
}

.widget__lead {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: var(--text);
}

.trust {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .88rem;
  color: var(--muted);
}
.trust li {
  padding-left: 16px;
  position: relative;
}
.trust li::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 8px; height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  transform: translateY(-50%);
}
.trust strong { color: var(--text-strong); }

/* --- Formulario de búsqueda --- */
.search {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.search input {
  flex: 1;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-strong);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input::placeholder { color: #9aa1ac; }
.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,66,123,.12);
}

.search button {
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.search button:hover:not(:disabled) { background: var(--primary-hover); }
.search button:active:not(:disabled) { transform: translateY(1px); }
.search button:disabled { opacity: .6; cursor: wait; }

/* --- Resultados --- */
.results:empty { display: none; }

.results__count {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.result {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.result:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.result__code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 110px;
  font-size: .95rem;
}

.result__desc {
  flex: 1;
  color: var(--text-strong);
}

.results__empty {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--text);
  border-left: 3px solid var(--secondary);
}
.results__empty strong { color: var(--text-strong); }

.results__error {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fdecec;
  color: #8a1c1c;
  border: 1px solid #f5c6c6;
}

/* CTA contextual tras cada búsqueda */
.results__cta {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
}
.results__cta strong { color: var(--text-strong); }
.results__cta a { font-weight: 600; }

/* --- Bloque CTA de Alertas --- */
.cta {
  margin: 26px 0;
  padding: 22px 22px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #05315a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.cta__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin: 0 0 6px;
  color: #fff;
}
.cta__text {
  margin: 0 0 6px;
  color: rgba(255,255,255,.9);
  font-size: .95rem;
}
.cta__price {
  margin: 0;
  font-size: .88rem;
  color: var(--sky);
}
.cta__price strong { color: #fff; }
.cta__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  font-family: inherit;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.5);
}
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

/* --- Feedback plegable --- */
.feedback {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.feedback summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 0;
}
.feedback__form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback__form textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
  color: var(--text-strong);
}
.feedback__form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,66,123,.12);
}
.feedback__form button {
  align-self: flex-start;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.feedback__form button:hover:not(:disabled) { background: var(--primary-hover); }
.feedback__form button:disabled { opacity: .6; cursor: wait; }
.feedback__status {
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
  min-height: 1.2em;
}
.feedback__status--ok { color: #1a7a34; }
.feedback__status--err { color: #8a1c1c; }

/* --- FAQ --- */
.faq {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.faq h2 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--primary);
  margin: 0 0 14px;
}
.faq__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}
.faq__item summary {
  cursor: pointer;
  padding: 12px 16px;
  color: var(--text-strong);
  font-weight: 500;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-size: 1.4rem;
  font-weight: 700;
  transition: transform .2s ease;
}
.faq__item[open] summary::after { content: "−"; }
.faq__item p {
  margin: 0;
  padding: 0 16px 14px;
  font-size: .95rem;
}

/* --- Footer --- */
.widget__footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
}
.widget__contact {
  margin: 0 0 8px;
  font-size: .95rem;
  color: var(--text-strong);
}
.widget__contact a { font-weight: 500; }
.widget__legal {
  margin: 0;
  color: var(--muted);
}
.widget__legal a { color: var(--muted); }

/* --- Responsive --- */
@media (max-width: 640px) {
  .widget { padding: 20px 16px 32px; }
  .search { flex-direction: column; }
  .search button { padding: 12px; }
  .cta { grid-template-columns: 1fr; }
  .cta__actions { min-width: 0; }
  .result { flex-direction: column; gap: 4px; }
  .result__code { min-width: 0; }
}
