:root {
  --navy-950: #071b2f;
  --navy-900: #0b2745;
  --navy-800: #123a61;
  --blue-700: #175f9e;
  --blue-600: #1c74bd;
  --blue-100: #eaf4fc;
  --blue-050: #f5faff;

  --slate-900: #1a2533;
  --slate-700: #445365;
  --slate-600: #617083;
  --slate-500: #7a8796;
  --slate-300: #cbd4dd;
  --slate-200: #dfe5eb;
  --slate-100: #edf1f5;
  --slate-050: #f7f9fb;

  --white: #ffffff;
  --success: #188754;

  --shadow-sm: 0 2px 8px rgba(7, 27, 47, 0.06);
  --shadow-md: 0 12px 32px rgba(7, 27, 47, 0.09);
  --shadow-lg: 0 24px 54px rgba(7, 27, 47, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --content-width: 1180px;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  color: var(--slate-900);

  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(28, 116, 189, 0.07),
      transparent 32rem
    ),
    var(--slate-050);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* =========================================================
   CABECERA
   ========================================================= */

.topbar {
  position: relative;
  z-index: 10;

  background:
    linear-gradient(
      115deg,
      var(--navy-950) 0%,
      var(--navy-900) 56%,
      var(--navy-800) 100%
    );

  color: var(--white);

  border-bottom:
    1px solid rgba(255, 255, 255, 0.08);

  box-shadow:
    0 4px 18px rgba(7, 27, 47, 0.16);
}

.topbar__inner {
  width: min(
    calc(100% - 40px),
    var(--content-width)
  );

  min-height: 78px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  display: grid;
  place-items: center;

  border-radius: 13px;

  background:
    linear-gradient(
      145deg,
      #3d98d7,
      #17649f
    );

  border:
    1px solid rgba(255, 255, 255, 0.18);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 7px 18px rgba(0, 0, 0, 0.18);
}

.brand__mark span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand__eyebrow {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand__text strong {
  overflow: hidden;

  color: var(--white);
  font-size: 17px;
  font-weight: 700;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.system-status {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  gap: 9px;

  padding: 8px 12px;

  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;

  background:
    rgba(255, 255, 255, 0.07);

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 999px;
}

.system-status__dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #58d493;

  box-shadow:
    0 0 0 4px rgba(88, 212, 147, 0.12);
}


/* =========================================================
   CONTENIDO PRINCIPAL
   ========================================================= */

.main-content {
  width: min(
    calc(100% - 40px),
    var(--content-width)
  );

  flex: 1;

  margin: 0 auto;
  padding: 56px 0 72px;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
  max-width: 810px;
  margin-bottom: 34px;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero__badge {
  display: inline-flex;
  align-items: center;

  margin-bottom: 16px;
  padding: 6px 11px;

  color: var(--blue-700);

  background: var(--blue-100);

  border:
    1px solid rgba(23, 95, 158, 0.10);

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;

  margin: 0;

  color: var(--navy-950);

  font-size: clamp(
    32px,
    4.4vw,
    50px
  );

  line-height: 1.07;
  letter-spacing: -0.035em;
  font-weight: 760;
}

.hero p {
  max-width: 700px;

  margin: 20px 0 0;

  color: var(--slate-600);

  font-size: 16px;
  line-height: 1.75;
}


/* =========================================================
   PANEL DE BÚSQUEDA
   ========================================================= */

.search-panel {
  padding: 30px;

  background:
    rgba(255, 255, 255, 0.94);

  border:
    1px solid rgba(203, 212, 221, 0.72);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-md);
}

.search-panel__header {
  margin-bottom: 20px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-label {
  display: block;

  margin-bottom: 6px;

  color: var(--blue-700);

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.search-panel h2,
.results-header h2 {
  margin: 0;

  color: var(--navy-950);

  font-size: 22px;
  line-height: 1.2;
  font-weight: 730;
  letter-spacing: -0.018em;
}

.search-panel__hint {
  color: var(--slate-500);
  font-size: 12px;
}

.search-form {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 12px;
}

.search-box {
  position: relative;
}

.search-box__icon {
  position: absolute;

  top: 50%;
  left: 17px;

  width: 20px;
  height: 20px;

  color: var(--slate-500);

  transform: translateY(-50%);

  pointer-events: none;
}

.search-box__icon svg {
  width: 100%;
  height: 100%;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box input {
  width: 100%;
  height: 54px;

  padding:
    0 48px
    0 50px;

  color: var(--slate-900);

  background: var(--white);

  border:
    1px solid var(--slate-300);

  border-radius: 12px;

  outline: none;

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.search-box input::placeholder {
  color: #94a0ad;
}

.search-box input:hover {
  border-color: #aebac6;
}

.search-box input:focus {
  border-color: var(--blue-600);

  box-shadow:
    0 0 0 4px rgba(28, 116, 189, 0.11);
}

.search-box__clear {
  position: absolute;

  top: 50%;
  right: 12px;

  width: 32px;
  height: 32px;

  padding: 0;

  display: grid;
  place-items: center;

  color: var(--slate-600);

  background: transparent;

  border: 0;
  border-radius: 50%;

  font-size: 24px;
  line-height: 1;

  transform: translateY(-50%);
}

.search-box__clear:hover {
  color: var(--navy-900);
  background: var(--slate-100);
}

.search-button {
  min-width: 126px;
  height: 54px;

  padding: 0 24px;

  color: var(--white);

  background:
    linear-gradient(
      145deg,
      var(--blue-600),
      var(--blue-700)
    );

  border: 0;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 700;

  box-shadow:
    0 7px 16px rgba(23, 95, 158, 0.20);

  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.search-button:hover {
  filter: brightness(1.04);

  box-shadow:
    0 9px 20px rgba(23, 95, 158, 0.25);

  transform: translateY(-1px);
}

.search-button:active {
  transform: translateY(0);
}

.search-examples {
  margin-top: 17px;

  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;

  color: var(--slate-500);
  font-size: 11px;
}

.search-examples__items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.search-examples__items span {
  padding: 5px 9px;

  color: var(--slate-600);

  background: var(--slate-050);

  border:
    1px solid var(--slate-200);

  border-radius: 999px;

  font-weight: 650;
}


/* =========================================================
   ESTADO INICIAL
   ========================================================= */

.status-area {
  margin-top: 26px;
}

.welcome-state {
  min-height: 220px;

  padding: 38px 24px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  border:
    1px dashed #cad4de;

  border-radius: var(--radius-lg);

  background:
    rgba(255, 255, 255, 0.55);
}

.welcome-state__icon {
  width: 54px;
  height: 54px;

  margin-bottom: 17px;

  display: grid;
  place-items: center;

  color: var(--blue-700);

  background: var(--blue-100);

  border-radius: 15px;
}

.welcome-state__icon svg {
  width: 25px;
  height: 25px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-state h3 {
  margin: 0 0 8px;

  color: var(--navy-950);

  font-size: 18px;
  font-weight: 720;
}

.welcome-state p {
  max-width: 500px;

  margin: 0;

  color: var(--slate-600);

  font-size: 14px;
  line-height: 1.65;
}


/* =========================================================
   RESULTADOS
   ========================================================= */

.results-section {
  margin-top: 38px;
}

.results-header {
  margin-bottom: 17px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.result-count {
  padding: 7px 11px;

  color: var(--slate-600);

  background: var(--white);

  border:
    1px solid var(--slate-200);

  border-radius: 999px;

  font-size: 11px;
  font-weight: 700;
}

.results-grid {
  display: grid;
  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 18px;
}


/* =========================================================
   TARJETA DE PROFESIONAL
   Será utilizada después por JavaScript
   ========================================================= */

.professional-card {
  position: relative;

  overflow: hidden;

  padding: 24px;

  background: var(--white);

  border:
    1px solid var(--slate-200);

  border-radius: var(--radius-md);

  box-shadow: var(--shadow-sm);

  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.professional-card:hover {
  border-color: #c4d6e6;

  box-shadow: var(--shadow-md);

  transform: translateY(-2px);
}

.professional-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 4px;
  height: 100%;

  background:
    linear-gradient(
      180deg,
      var(--blue-600),
      var(--navy-800)
    );
}

.professional-card__header {
  padding-left: 3px;
  margin-bottom: 20px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.professional-card__type {
  display: inline-block;

  margin-bottom: 6px;

  color: var(--blue-700);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.professional-card__name {
  margin: 0;

  color: var(--navy-950);

  font-size: 18px;
  line-height: 1.3;
  font-weight: 750;
}

.professional-card__entity {
  margin: 7px 0 0;

  color: var(--slate-600);

  font-size: 13px;
  line-height: 1.5;
}

.professional-card__data {
  margin: 0;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.data-item {
  min-width: 0;
}

.data-item--wide {
  grid-column: 1 / -1;
}

.data-item dt {
  margin-bottom: 4px;

  color: var(--slate-500);

  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-item dd {
  margin: 0;

  color: var(--slate-800, #314052);

  overflow-wrap: anywhere;

  font-size: 13px;
  line-height: 1.5;
}

.professional-card__actions {
  margin-top: 20px;
  padding-top: 17px;

  display: flex;
  justify-content: flex-end;

  border-top:
    1px solid var(--slate-100);
}

.copy-button {
  padding: 8px 12px;

  color: var(--blue-700);

  background: var(--blue-050);

  border:
    1px solid #cfe2f2;

  border-radius: 9px;

  font-size: 11px;
  font-weight: 750;
}

.copy-button:hover {
  background: var(--blue-100);
}


/* =========================================================
   ESTADOS: CARGANDO / VACÍO / ERROR
   ========================================================= */

.state-message {
  padding: 36px 24px;

  text-align: center;

  background: var(--white);

  border:
    1px solid var(--slate-200);

  border-radius: var(--radius-md);
}

.state-message h3 {
  margin: 0 0 7px;

  color: var(--navy-950);

  font-size: 17px;
}

.state-message p {
  max-width: 540px;

  margin: 0 auto;

  color: var(--slate-600);

  font-size: 13px;
  line-height: 1.6;
}

.loading-dot {
  width: 8px;
  height: 8px;

  display: inline-block;

  margin: 0 3px;

  background: var(--blue-600);

  border-radius: 50%;

  animation:
    loadingPulse 1.1s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes loadingPulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.75);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}


/* =========================================================
   PIE
   ========================================================= */

.footer {
  margin-top: auto;

  color: var(--slate-500);

  background:
    rgba(255, 255, 255, 0.68);

  border-top:
    1px solid var(--slate-200);
}

.footer__inner {
  width: min(
    calc(100% - 40px),
    var(--content-width)
  );

  min-height: 66px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  font-size: 11px;
}


/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

button:focus-visible,
input:focus-visible {
  outline:
    3px solid rgba(28, 116, 189, 0.28);

  outline-offset: 2px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 860px) {

  .main-content {
    padding-top: 42px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 640px) {

  .topbar__inner {
    width: min(
      calc(100% - 28px),
      var(--content-width)
    );

    min-height: 70px;
  }

  .brand__mark {
    width: 41px;
    height: 41px;
    flex-basis: 41px;

    border-radius: 11px;
  }

  .brand__eyebrow {
    display: none;
  }

  .brand__text strong {
    max-width: 215px;

    font-size: 14px;
  }

  .system-status {
    display: none;
  }

  .main-content {
    width: min(
      calc(100% - 28px),
      var(--content-width)
    );

    padding:
      34px 0
      54px;
  }

  .hero__badge {
    margin-bottom: 13px;
  }

  .hero h1 {
    font-size: 32px;
    line-height: 1.1;
  }

  .hero p {
    margin-top: 15px;

    font-size: 14px;
    line-height: 1.65;
  }

  .search-panel {
    padding: 21px;

    border-radius: 16px;
  }

  .search-panel__header {
    align-items: flex-start;
  }

  .search-panel__hint {
    display: none;
  }

  .search-panel h2,
  .results-header h2 {
    font-size: 19px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-box input {
    height: 52px;

    padding-left: 46px;

    font-size: 16px;
  }

  .search-button {
    width: 100%;
    height: 50px;
  }

  .search-examples {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-state {
    min-height: 190px;

    padding:
      30px 18px;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .professional-card {
    padding: 20px;
  }

  .professional-card__data {
    grid-template-columns: 1fr;
  }

  .data-item--wide {
    grid-column: auto;
  }

  .footer__inner {
    width: min(
      calc(100% - 28px),
      var(--content-width)
    );

    min-height: 72px;

    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 4px;

    padding:
      12px 0;
  }

}


/* =========================================================
   PANTALLAS MUY PEQUEÑAS
   ========================================================= */

@media (max-width: 390px) {

  .brand__text strong {
    max-width: 185px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .search-panel {
    padding: 18px;
  }

}
