/* =========================================================
   CM&C JM S.A.C. — Buscar certificado
   (usa las variables y componentes de styles.css)
   ========================================================= */

.cv-page { --ok: #1f8a4c; --ok-2: #2fb866; --bad: #d93b3b; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cv-back { color: #fff; border-color: rgba(255, 255, 255, .35); }
.cv-back:hover { border-color: #fff; }
.cv-back:hover .arrow { transform: translateX(-4px); }

/* ---------- Cabecera con buscador ---------- */
.cv-hero {
  position: relative; overflow: hidden; isolation: isolate; background: var(--navy-deep);
  padding: calc(var(--header-h) + 70px) 0 80px;
}
.cv-hero__bg {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 60% 35%;
  filter: saturate(.8) brightness(.75);
}
.cv-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--navy-deep) 15%, rgba(26, 34, 70, .82) 55%, rgba(26, 34, 70, .45)),
    linear-gradient(0deg, rgba(26, 34, 70, .9), transparent 50%);
}
.cv-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--brick-2), var(--brick) 40%, var(--orange) 75%, var(--teal) 75% 80%, var(--navy-2) 80%);
}
.cv-hero .stripes { top: auto; bottom: 0; left: auto; right: 0; transform: rotate(180deg); background: linear-gradient(135deg, var(--navy) 0 44%, var(--teal) 44% 49%, var(--orange) 49% 54%, transparent 54%); }
.cv-hero__inner { position: relative; }
.cv-crumbs { margin-bottom: 22px; color: #c3c9e0; }
.cv-crumbs a:hover { color: #fff; }
.cv-crumbs span { margin-inline: 6px; color: var(--orange); }
.cv-hero__title { font-size: clamp(38px, 5.4vw, 66px); font-weight: 400; line-height: 1.04; letter-spacing: -.03em; margin-bottom: 18px; }
.cv-hero__title em { font-style: normal; color: var(--orange); }
.cv-hero__lead { max-width: 560px; color: rgba(255, 255, 255, .82); font-size: 17px; margin-bottom: 34px; }

/* Caja de búsqueda */
.cv-search { max-width: 720px; }
.cv-search__field { position: relative; }
.cv-search__box {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 18px;
  background: #fff; border-radius: 4px; color: var(--navy-2);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
  transition: box-shadow .25s;
}
.cv-search__box:focus-within { box-shadow: 0 0 0 3px rgba(237, 87, 36, .55), 0 24px 50px -20px rgba(0, 0, 0, .55); }
.cv-search__icon { flex: none; width: 22px; height: 22px; fill: none; stroke: #8a90a8; stroke-width: 2; stroke-linecap: round; }
.cv-search__box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 14px 6px;
  font-family: var(--mono); font-size: 18px; letter-spacing: .04em; text-transform: uppercase; color: var(--navy-2);
}
.cv-search__box input::placeholder { color: #9aa0b6; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 16px; }
.cv-search__clear {
  flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: #fff; background: #59607a;
  display: grid; place-items: center; transition: background .2s;
}
.cv-search__clear:hover { background: var(--navy-2); }
.cv-search__btn { flex: none; }
.cv-search__hint { margin-top: 14px; color: #c3c9e0; }
.cv-search__hint b { color: #fff; font-weight: 500; }

/* Sugerencias */
.cv-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: #fff; border-radius: 4px; overflow: hidden; color: var(--navy-2);
  border-top: 3px solid var(--orange); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  animation: fade .25s var(--ease);
}
.cv-suggest li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 18px; cursor: pointer; border-top: 1px solid rgba(33, 47, 94, .08);
}
.cv-suggest li:first-child { border-top: 0; }
.cv-suggest li[aria-selected="true"], .cv-suggest li:hover { background: #f3f4f7; box-shadow: inset 3px 0 0 var(--orange); }
.cv-suggest__name { font-size: 14.5px; font-weight: 600; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-suggest__code { flex: none; font-family: var(--mono); font-size: 13px; color: var(--steel); }
.cv-suggest__code mark { background: rgba(237, 87, 36, .16); color: inherit; border-radius: 2px; }
.cv-suggest__empty { cursor: default !important; color: #6c7391; font-size: 14px; background: none !important; box-shadow: none !important; }

/* ---------- Cuerpo ---------- */
.cv-body { background: var(--gray); color: var(--navy-2); padding-block: clamp(50px, 7vw, 90px); }
.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.cv-main > * { scroll-margin-top: calc(var(--header-h) + 20px); }
.cv-main > *:focus { outline: none; }

/* Tarjeta genérica */
.cv-card {
  background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 42px);
  border-top: 4px solid var(--orange); box-shadow: 0 30px 60px -36px rgba(26, 34, 70, .45);
  animation: fade .5s var(--ease);
}
.cv-card__kicker { color: var(--orange); margin-bottom: 10px; }
.cv-card h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 500; letter-spacing: -.015em; line-height: 1.2; margin-bottom: 24px; }
.cv-card h2 span { font-family: var(--mono); font-size: .8em; color: var(--orange); overflow-wrap: anywhere; }
.cv-card > p { color: #4b5373; margin-bottom: 20px; }
.cv-card--notice { border-top-color: var(--navy); }

.cv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: none; }
.cv-steps li { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid rgba(33, 47, 94, .1); }
.cv-steps li:last-child { border: 0; padding-bottom: 0; }
.cv-steps strong { display: block; font-size: 16px; margin-bottom: 2px; }
.cv-steps p { color: #4b5373; font-size: 14.5px; }
.lr-step__num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 600;
}
.cv-pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; font-weight: 500; }
.cv-pill--ok { background: rgba(31, 138, 76, .12); color: var(--ok); }
.cv-pill--bad { background: rgba(217, 59, 59, .11); color: var(--bad); }

.cv-tips { margin-bottom: 26px; display: grid; gap: 10px; }
.cv-tips li { position: relative; padding-left: 22px; color: #4b5373; font-size: 15px; }
.cv-tips li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* ---------- Certificado ---------- */
.cv-cert {
  --st: var(--ok); --st-bg: rgba(31, 138, 76, .08);
  background: #fff; border-radius: var(--radius); padding: clamp(22px, 4vw, 42px);
  border-top: 6px solid var(--st); box-shadow: 0 30px 60px -36px rgba(26, 34, 70, .45);
  animation: fade .5s var(--ease);
}
.cv-cert.is-expired { --st: var(--bad); --st-bg: rgba(217, 59, 59, .07); }
.cv-cert__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding-bottom: 22px; margin-bottom: 24px; border-bottom: 2px solid var(--orange);
}
.cv-cert__kicker { color: var(--orange); margin-bottom: 6px; }
.cv-cert__code { font-family: var(--mono); font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: .02em; color: var(--navy-2); overflow-wrap: anywhere; }
.cv-cert__note { font-size: 13px; color: #6c7391; margin-top: 4px; }

.cv-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cv-status__label { color: #6c7391; }
.cv-status__value {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 4px;
  font-size: 22px; font-weight: 700; letter-spacing: .06em; color: var(--st); background: var(--st-bg);
  border: 1.5px solid var(--st);
}
.cv-status__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 4px var(--st-bg); }
.is-valid .cv-status__dot { animation: beat 2s infinite; }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 138, 76, .45); } 60% { box-shadow: 0 0 0 8px rgba(31, 138, 76, 0); } }

.cv-data {
  margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(33, 47, 94, .12); border: 1px solid rgba(33, 47, 94, .12); border-radius: 4px; overflow: hidden;
}
.cv-data > div { background: #fff; padding: 14px 18px; }
.cv-data__wide { grid-column: 1 / -1; }
.cv-data dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6c7391; margin-bottom: 4px; }
.cv-data dd { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.cv-data__name { font-size: 18px !important; color: var(--navy-2); }
.cv-mono { font-family: var(--mono); font-weight: 500 !important; }

.cv-validity { background: #f6f7f9; border-radius: 4px; padding: 18px 20px; margin-bottom: 26px; }
.cv-validity__dates { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cv-validity__dates > div:last-child { text-align: right; }
.cv-validity__dates .mono { display: block; color: #6c7391; font-size: 10px; margin-bottom: 2px; }
.cv-validity__dates strong { font-size: 17px; font-weight: 600; }
.cv-validity__bar { height: 8px; border-radius: 999px; background: rgba(33, 47, 94, .1); overflow: hidden; }
.cv-validity__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--st)); transform-origin: left; animation: grow 1s var(--ease) .2s both; }
@keyframes grow { from { transform: scaleX(0); } }
.cv-validity__text { margin-top: 10px; font-size: 13.5px; color: var(--st); font-weight: 600; }

.cv-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cv-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cv-print { color: var(--navy-2); border-color: rgba(33, 47, 94, .25); }
.cv-print:hover { border-color: var(--navy-2); }

/* ---------- Lateral ---------- */
.cv-side { display: grid; gap: 18px; position: sticky; top: calc(var(--header-h) + 24px); }
.cv-help {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(110deg, var(--navy) 0 30%, #1faa59 30%);
  box-shadow: 0 20px 40px -24px rgba(31, 170, 89, .8);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.cv-help:hover { transform: translateY(-3px); box-shadow: 0 26px 44px -22px rgba(31, 170, 89, .9); }
.cv-help img { flex: none; width: 46px; }
.cv-help__text { flex: 1; display: flex; flex-direction: column; padding-left: 8px; }
.cv-help__text .mono { color: rgba(255, 255, 255, .85); font-size: 10.5px; display: flex; align-items: center; gap: 8px; }
.cv-help__text strong { font-size: 17px; font-weight: 700; }
.cv-online { background: rgba(255, 255, 255, .2); border-radius: 999px; padding: 1px 8px; font-size: 9.5px; letter-spacing: .1em; color: #fff; }
.cv-help__icon { flex: none; width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.cv-help__icon svg { width: 22px; height: 22px; fill: #1faa59; }

.cv-info {
  background: #fff; border-radius: var(--radius); padding: 26px 24px; border-top: 4px solid var(--navy);
  box-shadow: 0 20px 40px -28px rgba(26, 34, 70, .4);
}
.cv-info dl { margin: 0; display: grid; gap: 14px; }
.cv-info dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6c7391; margin-bottom: 2px; }
.cv-info dd { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.cv-info dd a:hover { color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cv-layout { grid-template-columns: 1fr; }
  .cv-side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 640px) {
  .cv-back { padding: 9px 14px; font-size: 12px; }
  .cv-hero { padding-bottom: 60px; }
  .cv-search__box { flex-wrap: wrap; padding: 6px 6px 6px 14px; }
  .cv-search__box input { font-size: 16px; }
  .cv-search__btn { flex: 1 1 100%; justify-content: center; }
  .cv-status { align-items: flex-start; }
  .cv-data { grid-template-columns: 1fr; }
  .cv-validity__dates > div:last-child { text-align: left; }
  .cv-actions .btn { flex: 1 1 100%; justify-content: center; }
  .cv-side { grid-template-columns: 1fr; }
}

/* ---------- Impresión de la constancia ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .header, .cv-hero, .cv-side, .footer, .cv-actions, .skip { display: none !important; }
  .cv-body { background: #fff; padding: 0; }
  .cv-layout { display: block; }
  .cv-cert { box-shadow: none; padding: 0; animation: none; }
  .cv-cert::before { content: "CM&C JM S.A.C. — Constancia de verificación de certificado"; display: block; font: 600 12px var(--font); color: #6c7391; margin: 10px 0 16px; }
  .cv-validity__bar span { animation: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
