/* ============================================================
   rnp.css — Registro Nacional de Peritos / CRT
   ------------------------------------------------------------
   Un solo archivo: contenedor, tabs, buscador y tabla.
   Todas las clases empiezan con .rnp-
   ============================================================ */

:root {
  --rnp-primary:       #0d4d4d;
  --rnp-primary-hover: #01635f;
  --rnp-primary-light: #e6f3f3;
  --rnp-telecom-bg:    #e6f3f3;
  --rnp-telecom-text:  #014e4d;
  --rnp-radio-bg:      #fef3e6;
  --rnp-radio-text:    #7a4500;
  --rnp-ambas-bg:      #eef0fe;
  --rnp-ambas-text:    #2d3eb0;
}

.rnp-wrapper,
.rnp-wrapper *,
.rnp-wrapper *::before,
.rnp-wrapper *::after {
  box-sizing: border-box;
}

.rnp-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  font-family: 'Noto Sans', sans-serif;
}

/* ============================================================
   FIXES DEL CMS
   El editor mete <p> entre los botones y <figure> alrededor
   de la tabla. display:contents los hace transparentes para
   el layout sin tener que pelearse con el editor.
   ============================================================ */
.rnp-tabs p,
.rnp-filters p,
.rnp-search p,
.rnp-table-wrap figure {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ============================================================
   TABS
   ============================================================ */
.rnp-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  background: #e6e6e6;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto 28px auto !important;
  padding: 0 !important;
  list-style: none !important;
}

.rnp-tab {
  flex: 1 1 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 17px 20px !important;
  border: none;
  border-right: 1.5px solid rgba(13, 77, 77, .10);
  background: #e6e6e6;
  font-family: 'Noto Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #393939;
  text-align: center;
  text-decoration: none !important;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.rnp-tab:last-child { border-right: none; }
.rnp-tab:hover      { color: var(--rnp-primary); }

.rnp-tab.is-active {
  background: var(--rnp-primary) !important;
  color: #fff !important;
  font-weight: 700;
}

.rnp-tab.is-active:hover { background: var(--rnp-primary-hover) !important; }

/* ============================================================
   PANELES
   ============================================================ */
.rnp-panel { min-height: 200px; }
.rnp-panel[hidden] { display: none; }

/* ============================================================
   BUSCADOR
   ============================================================ */
.rnp-search {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.rnp-search__pill {
  max-width: 860px;
  width: 100%;
  display: flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
}

.rnp-search__pill:focus-within {
  box-shadow: 0 0 0 4px rgba(13, 77, 77, .20), 0 2px 12px rgba(0, 0, 0, .10);
}

.rnp-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  padding: 18px 22px;
  font-family: 'Noto Sans', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  background: transparent;
}

.rnp-search__input::placeholder {
  color: rgba(26, 26, 26, .50);
  font-weight: 400;
}

.rnp-search__clear {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: rgba(26, 26, 26, .4);
  font-size: 20px;
  cursor: pointer;
  transition: color .2s;
}

.rnp-search__clear.is-visible { display: flex; }
.rnp-search__clear:hover      { color: rgba(26, 26, 26, .75); }

.rnp-search__btn {
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--rnp-primary);
  cursor: pointer;
  transition: background .2s;
}

.rnp-search__btn:hover { background: var(--rnp-primary-hover); }

.rnp-search__btn i,
.rnp-search__btn svg {
  font-size: 22px;
  color: #fff !important;
  fill: #fff !important;
}

/* ============================================================
   FILTROS
   ============================================================ */
.rnp-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}

.rnp-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #eeeeee;
  color: #393939;
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.rnp-filter:hover {
  background: var(--rnp-primary-light);
  color: var(--rnp-primary);
  border-color: var(--rnp-primary);
}

.rnp-filter.is-active {
  background: var(--rnp-primary);
  color: #fff;
  border-color: var(--rnp-primary);
}

.rnp-filter__count {
  background: rgba(0, 0, 0, .10);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
}

.rnp-filter.is-active .rnp-filter__count {
  background: rgba(255, 255, 255, .25);
}

/* ============================================================
   HINT DE RESULTADOS
   ============================================================ */
.rnp-hint {
  text-align: center;
  font-size: 15px;
  color: rgba(0, 0, 0, .55);
  margin: 0 0 14px;
  min-height: 22px;
}

/* ============================================================
   TABLA
   ============================================================ */
.rnp-table-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rnp-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Anchos de columna en escritorio */
.rnp-table thead th:nth-child(1) { width: 11%; }  /* Folio RNP */
.rnp-table thead th:nth-child(2) { width: 22%; }  /* No. Registro + Vigencia */
.rnp-table thead th:nth-child(3) { width: 25%; }  /* Nombre */
.rnp-table thead th:nth-child(4) { width: 20%; }  /* Especialidad */
.rnp-table thead th:nth-child(5) { width: 22%; }  /* Email */

.rnp-table thead th {
  background: var(--rnp-primary);
  color: rgba(255, 255, 255, .9);
  font-family: 'Noto Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  padding: 14px 18px;
  text-align: left;
  white-space: normal;
}

.rnp-table thead th:nth-child(1),
.rnp-table thead th:nth-child(2),
.rnp-table thead th:nth-child(4) {
  text-align: center;
}

/* El encabezado de la columna 2 es largo: con el letter-spacing
   normal se parte en cuatro renglones y estira la barra */
.rnp-table thead th:nth-child(2) {
  letter-spacing: .6px;
  padding-left: 10px;
  padding-right: 10px;
}

.rnp-table tbody tr {
  border-bottom: 1px solid rgba(13, 77, 77, .07);
  transition: background .15s;
}

.rnp-table tbody tr:last-child { border-bottom: none; }
.rnp-table tbody tr:hover      { background: var(--rnp-primary-light); }

.rnp-table tbody td {
  padding: 14px 18px;
  font-size: 16px;
  color: #393939;
  vertical-align: middle;
}

/* ── Columna 1: folio ── */
.rnp-col-folio {
  font-weight: 700;
  font-size: 15px;
  color: #2b2b2b;
  white-space: nowrap;
  text-align: center;
}

/* ── Columna 2: registro + vigencia ── */
.rnp-col-registro {
  text-align: center;
  line-height: 1.35;
}

/* display:block es lo que pone la vigencia en su propio renglón */
.rnp-reg {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--rnp-primary);
  white-space: nowrap;
  letter-spacing: .2px;
}

.rnp-vigencia {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #6b6b6b;
  white-space: normal;
}

/* ── Columna 3: nombre ── */
.rnp-col-nombre {
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Columna 4: especialidad ── */
.rnp-col-especialidad {
  text-align: center;
  white-space: normal;
}

/* ── Columna 5: email ── */
.rnp-col-email {
  font-size: 14px;
  /* anywhere evita que un correo largo ensanche la columna */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rnp-email {
  color: var(--rnp-primary);
  /* El portal le mete text-decoration: underline a los enlaces en
     hover. Se apaga aquí y el subrayado lo da el border-bottom,
     que se puede animar y separar del texto. */
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
  transition: border-color .15s, color .15s;
}

.rnp-email:hover,
.rnp-email:focus {
  color: var(--rnp-primary-hover);
  text-decoration: none !important;
  border-bottom-color: currentColor;
}

/* ============================================================
   BADGES DE ESPECIALIDAD
   ============================================================ */
.rnp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.rnp-badge--telecom { background: var(--rnp-telecom-bg); color: var(--rnp-telecom-text); }
.rnp-badge--radio   { background: var(--rnp-radio-bg);   color: var(--rnp-radio-text); }

.rnp-badge--ambas {
  background: var(--rnp-ambas-bg);
  color: var(--rnp-ambas-text);
  white-space: normal;
  line-height: 1.4;
  max-width: 170px;
}

/* ============================================================
   ESTADOS: cargando, sin resultados, error, próximamente
   ============================================================ */
.rnp-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 20px;
  text-align: center;
  font-family: 'Noto Sans', sans-serif;
  font-size: 16px;
  color: rgba(0, 0, 0, .45);
}

.rnp-state[hidden] { display: none; }

.rnp-state i {
  font-size: 38px;
  color: #ccc;
}

/* El editor del CMS borra los <i> vacíos que van solos dentro de un
   div, así que el icono de "próximamente" se pinta desde aquí.
   f7d9 = fa-screwdriver-wrench */
#rnp-panel-requisitos .rnp-state::before,
#rnp-panel-preguntas .rnp-state::before {
  content: "\f7d9";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 38px;
  color: #ccc;
  line-height: 1;
}

/* Si el CMS sí respetó el <i>, se esconde para no duplicar el icono */
#rnp-panel-requisitos .rnp-state i,
#rnp-panel-preguntas .rnp-state i {
  display: none;
}

.rnp-state .fa-spinner { color: var(--rnp-primary); }

.rnp-retry {
  padding: 9px 22px;
  border: 2px solid var(--rnp-primary);
  border-radius: 999px;
  background: #fff;
  color: var(--rnp-primary);
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.rnp-retry:hover {
  background: var(--rnp-primary);
  color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .rnp-tab { font-size: 14px; padding: 15px 12px !important; }
}

@media (max-width: 768px) {
  .rnp-wrapper { padding: 10px 10px 24px; }

  .rnp-tab {
    font-size: 12px;
    padding: 13px 8px !important;
    white-space: normal;
    line-height: 1.25;
  }

  .rnp-search__input { font-size: 16px; padding: 14px 16px; }
  .rnp-search__btn   { flex: 0 0 54px; }

  .rnp-filter { font-size: 13px; padding: 6px 12px; }

  /* En móvil el wrapper es transparente: cada fila trae su sombra */
  .rnp-table-wrap {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 4px 0;
    overflow-x: hidden;
  }

  /* Los labels de cada dato los pone el JS con data-label */
  .rnp-table thead { display: none; }

  .rnp-table,
  .rnp-table tbody,
  .rnp-table td {
    display: block;
    width: 100%;
    table-layout: auto;
  }

  .rnp-table { min-width: 0; }

  /* Cada fila es una tarjeta. Es flex-column para poder reordenar:
     el nombre va primero aunque en la tabla sea la tercera columna. */
  .rnp-table tbody tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 16px;
    margin-bottom: 10px;
    border-bottom: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    overflow: hidden;
  }

  .rnp-table tbody tr:hover {
    background: var(--rnp-primary-light);
    box-shadow: 0 4px 12px rgba(13, 77, 77, .12);
  }

  /* Orden dentro de la tarjeta */
  .rnp-col-nombre       { order: 1; }
  .rnp-col-folio        { order: 2; }
  .rnp-col-registro     { order: 3; }
  .rnp-col-especialidad { order: 4; }
  .rnp-col-email        { order: 5; }

  .rnp-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 5px 0;
    font-size: 14px;
    text-align: left;
  }

  .rnp-table tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(0, 0, 0, .4);
    line-height: 1.4;
  }

  /* El nombre lleva label fijo y separador debajo */
  .rnp-col-nombre {
    font-size: 15px;
    font-weight: 700;
    padding: 0 0 8px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(13, 77, 77, .08);
  }

  .rnp-col-nombre::before { content: "Perito"; }

  .rnp-col-folio { font-size: 13px; }
  .rnp-reg       { font-size: 13px; white-space: normal; }
  .rnp-vigencia  { font-size: 12px; margin-top: 1px; }
  .rnp-col-email { font-size: 13px; }

  .rnp-badge--ambas { max-width: none; }
}
