/* Brando — oposiciones.css (panel del cliente). Solo composición: todo sale de los tokens de brand.css.
   Casos como tarjetas de seguimiento (estilo «estado del pedido» de Apple), selector de planes,
   vista de documento del borrador y guía paso a paso. Prefijo .op- */

.a-col { display: flex; flex-direction: column; gap: var(--b-space-6); min-width: 0; }
.op-aviso .b-icon { width: 20px; height: 20px; }

/* ---------- Caso: tarjeta de seguimiento ---------- */
.op-casos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--b-card-gap); }
.op-caso {
  display: flex; flex-direction: column; gap: var(--b-space-3); overflow: hidden;
  background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg);
  padding: var(--b-card-pad); scroll-margin-top: 80px;
}
.op-caso:focus { outline: none; }
.op-caso.is-flash { animation: op-flash 1.2s var(--b-ease); }
@keyframes op-flash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-primary) 45%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.op-caso.is-gris { background: transparent; }
.op-caso__top { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-3); flex-wrap: wrap; }
.op-plan-chip {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: var(--b-r-pill);
  background: var(--b-tint); color: var(--b-on-tint); font: 600 var(--b-t-caption)/var(--b-lh-caption) var(--b-font-body); letter-spacing: .02em;
}
.op-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px 2px 8px; border-radius: var(--b-r-pill);
  background: var(--b-surface-2); color: var(--b-ink-2); font: 600 var(--b-t-caption)/var(--b-lh-caption) var(--b-font-body); letter-spacing: .02em; white-space: nowrap;
}
.op-pill svg { width: 14px; height: 14px; }
.op-pill--urgente { background: var(--b-alto-bg); color: var(--b-alto); }
.op-pill--ok { background: var(--b-bajo-bg); color: var(--b-bajo); }
.op-caso__h { font: 600 var(--b-t-title3)/var(--b-lh-title3) var(--b-font-body); margin-top: var(--b-space-1); }
.op-caso__h .a-marca-txt { font-size: .94em; }
.op-caso__vs { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); margin-top: -4px; }
.op-caso__vs .a-marca-txt { color: var(--b-ink); font-weight: 400; font-size: .94em; }
.op-estado { display: flex; flex-direction: column; gap: 2px; margin-top: var(--b-space-2); }
.op-estado__t { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); }
.op-estado__s { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); max-width: 60ch; }
.op-estado--ok .op-estado__t { color: var(--b-bajo); }
.op-caso.is-gris .op-estado__t { color: var(--b-ink-2); }
.op-caso__foot { display: flex; align-items: center; gap: 6px; font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.op-caso__foot svg { width: 16px; height: 16px; color: var(--b-ink-3); }

/* Línea de avance: barra por paso, llena hasta el paso actual; rótulo debajo */
.op-track { list-style: none; margin: var(--b-space-1) 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 4px; }
.op-track__step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.op-track__bar { height: 4px; border-radius: 2px; background: var(--b-surface-2); transition: background-color var(--b-dur-slow) var(--b-ease); }
.op-track__lbl { font-size: var(--b-t-caption); line-height: var(--b-lh-caption); font-weight: 500; color: var(--b-ink-3); overflow-wrap: anywhere; }
.op-track__step.is-done .op-track__bar, .op-track__step.is-current .op-track__bar { background: var(--b-primary); }
.op-track__step.is-done .op-track__lbl { color: var(--b-ink-2); }
.op-track__step.is-current .op-track__lbl { color: var(--b-ink); font-weight: 600; }
.op-track.is-hecho .op-track__bar { background: var(--b-bajo) !important; }
@media (min-width: 768px) { .op-track__lbl { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); } }

/* Filas de acciones: al borde de la tarjeta, como Configuración */
.op-rows {
  border: 0; border-radius: 0; background: transparent;
  margin: var(--b-space-1) calc(var(--b-card-pad) * -1) calc(var(--b-card-pad) * -1);
  border-top: .5px solid var(--b-line-strong);
}
.op-rows .b-list__row { padding-inline: var(--b-card-pad); min-height: 60px; }
.op-rows .b-list__row + .b-list__row::before { left: calc(var(--b-card-pad) + 44px); }
.op-row__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none; background: var(--b-tint); color: var(--b-on-tint); }
.op-row__icon svg { width: 18px; height: 18px; }
.op-row--accent .a-row__title { color: var(--b-link); font-weight: 600; }
.op-row.is-off { cursor: default; }
.op-row.is-off .a-row__title { color: var(--b-ink-2); }
.op-row.is-off .op-row__icon { background: var(--b-surface-2); color: var(--b-ink-3); }
.op-row .a-row__value .a-marca-txt { color: var(--b-ink); font-weight: 400; }

/* «Oponerme» dentro de la alerta */
.op-alerta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--b-space-2) var(--b-space-3); }
.op-alerta .b-icon { width: 18px; height: 18px; }
.op-alerta__s { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.op-alerta__tarde { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); max-width: 60ch; }

/* ---------- Hoja: selector de planes ---------- */
@media (min-width: 601px) { .op-sheet--planes { width: min(720px, calc(100vw - 32px)); } }
.op-planes__intro { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.op-planes__h { font: 700 var(--b-t-title2)/var(--b-lh-title2) var(--b-font-display); font-variation-settings: "wdth" 96; }
.op-planes__contra { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); }
.op-planes__contra .a-marca-txt { color: var(--b-ink); font-size: .94em; }
.op-planes { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--b-space-3); }
@media (max-width: 600px) { .op-planes { grid-template-columns: minmax(0, 1fr); } }
.op-plan { position: relative; display: flex; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.op-plan input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.op-plan__card {
  position: relative; flex: 1; display: flex; flex-direction: column; gap: 6px;
  padding: var(--b-space-5) var(--b-space-5) var(--b-space-5); border-radius: var(--b-r-lg);
  border: 1px solid var(--b-line-strong); background: var(--b-surface);
  transition: border-color var(--b-dur) var(--b-ease), box-shadow var(--b-dur) var(--b-ease), background-color var(--b-dur) var(--b-ease);
}
.op-plan:hover .op-plan__card { border-color: var(--b-ink-3); }
.op-plan input:checked + .op-plan__card { border-color: var(--b-primary); box-shadow: inset 0 0 0 1px var(--b-primary); background: color-mix(in srgb, var(--b-primary) 4%, var(--b-surface)); }
.op-plan input:focus-visible + .op-plan__card { outline: 3px solid var(--b-focus); outline-offset: 2px; }
.op-plan:active .op-plan__card { transform: scale(.99); }
.op-plan__radio {
  position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--b-line-strong); color: transparent; transition: background-color var(--b-dur), border-color var(--b-dur);
}
.op-plan__radio svg { width: 15px; height: 15px; }
.op-plan input:checked + .op-plan__card .op-plan__radio { background: var(--b-primary); border-color: var(--b-primary); color: #fff; }
.op-plan__name { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); padding-right: 32px; }
.op-plan__price { font: 700 var(--b-t-title1)/1.1 var(--b-font-display); font-variation-settings: "wdth" 96; letter-spacing: 0; }
.op-plan__iva { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); margin-top: -4px; }
.op-plan__desc { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink); }
.op-plan__list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--b-space-2); padding-top: var(--b-space-3); border-top: .5px solid var(--b-line-strong); }
.op-plan__list > span { position: relative; padding-left: 24px; font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.op-plan__list > span::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 16px; height: 16px; background: var(--b-bajo);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 600px) {
  .op-plan__card { padding: var(--b-space-4); gap: 4px; }
  .op-plan__radio { top: 16px; right: 16px; }
  .op-plan__price { font-size: var(--b-t-title2); }
  .op-plan__list { margin-top: var(--b-space-1); padding-top: var(--b-space-2); gap: 6px; }
}
.op-tasa {
  display: flex; gap: 10px; align-items: flex-start; margin-top: calc(var(--b-space-3) - var(--b-field-gap));
  padding: var(--b-space-3) var(--b-space-4); border-radius: var(--b-r-md); background: var(--b-surface-2);
  font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2);
}
.op-tasa strong { color: var(--b-ink); font-weight: 600; white-space: nowrap; }
.op-tasa__i { width: 18px; height: 18px; flex: none; color: var(--b-ink-3); }
.op-legit { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.op-legit > legend { padding: 0; margin-bottom: 8px; }
.op-seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.op-foot-note { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); text-align: center; max-width: 52ch; margin: 4px auto 0; }

/* ---------- Hoja: borrador como documento ---------- */
@media (min-width: 601px) { .op-sheet--doc { width: min(780px, calc(100vw - 32px)); height: calc(100dvh - 48px); } }
.op-doc-body { background: var(--b-surface-2); padding-top: var(--b-space-4); gap: var(--b-space-4); }
.op-doc-loading { min-height: 40vh; }
#borrador-contenido { display: flex; flex-direction: column; gap: var(--b-space-4); }
.op-fillnote {
  display: flex; gap: 12px; align-items: flex-start; padding: var(--b-space-3) var(--b-space-4); border-radius: var(--b-r-md);
  background: var(--b-surface); border: 1px solid var(--b-line); font-size: var(--b-t-callout); line-height: var(--b-lh-callout);
}
.op-fillnote strong { font-weight: 600; }
.op-fillnote__sw { width: 18px; height: 18px; border-radius: 5px; flex: none; margin-top: 2px; background: var(--b-resaltador); }
.op-riesgo { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-md); padding: 0 var(--b-space-4); }
.op-riesgo summary { display: flex; align-items: center; gap: var(--b-space-3); min-height: 52px; cursor: pointer; list-style: none; }
.op-riesgo summary::-webkit-details-marker { display: none; }
.op-riesgo summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--b-ink-3); border-bottom: 2px solid var(--b-ink-3); transform: rotate(45deg) translateY(-3px); margin-left: 4px; transition: transform var(--b-dur) var(--b-ease); }
.op-riesgo[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.op-riesgo__t { font: 600 var(--b-t-callout)/var(--b-lh-callout) var(--b-font-body); flex: 1; }
.op-riesgo__list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--b-t-callout); line-height: var(--b-lh-callout); }
.op-riesgo__nota { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); padding: var(--b-space-3) 0 var(--b-space-4); }

.op-doc {
  background: var(--b-surface); border-radius: var(--b-r-md); box-shadow: var(--b-e1); border: 1px solid var(--b-line);
  padding: clamp(24px, 5vw, 56px) clamp(20px, 6vw, 64px); color: var(--b-ink);
  font-size: var(--b-t-body); line-height: 1.65; overflow-wrap: break-word;
}
.op-doc > * + * { margin-top: .85em; }
.op-doc h2 { font: 700 var(--b-t-title2)/var(--b-lh-title2) var(--b-font-display); font-variation-settings: "wdth" 96; text-align: center; margin-bottom: .6em; }
.op-doc h3 { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); margin-top: 1.6em; }
.op-doc h4 { font: 600 var(--b-t-callout)/var(--b-lh-callout) var(--b-font-body); color: var(--b-ink-2); margin-top: 1.3em; }
.op-doc ul, .op-doc ol { padding-left: 1.4em; margin-bottom: 0; }
.op-doc li + li { margin-top: .35em; }
.op-doc blockquote { margin-inline: 0; padding-left: 1em; border-left: 3px solid var(--b-line-strong); color: var(--b-ink-2); }
.op-doc hr { border: 0; border-top: 1px solid var(--b-line); margin-block: 1.6em; }
.op-doc strong { font-weight: 600; }
/* Campo por completar: el resaltador (siempre con tinta encima, también en oscuro) */
.op-fill {
  background: var(--b-resaltador); color: #0f1233; border-radius: 4px; padding: 1px 6px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; font-weight: 500;
}
.op-fill__tag { font: 600 var(--b-t-caption)/1 var(--b-font-body); letter-spacing: .02em; margin-right: 6px; padding-right: 6px; border-right: 1px solid rgb(15 18 51 / .3); }
.op-doc-foot__row { display: flex; justify-content: center; gap: var(--b-space-2); flex-wrap: wrap; }
.op-doc-foot .b-icon { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .op-doc-body { padding-inline: 12px; }
  .op-doc { box-shadow: none; padding: 24px 18px; }
  .op-doc h2 { font-size: var(--b-t-title3); }
}

/* ---------- Hoja: pedir cambios ---------- */
.op-revs { display: flex; align-items: center; gap: 12px; font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); }
.op-revs strong { color: var(--b-ink); font-weight: 600; }
.op-revs__dots { display: inline-flex; gap: 6px; flex: none; }
.op-revs__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--b-line-strong); }
.op-revs__dot.is-on { background: var(--b-primary); }
.op-textarea { min-height: 140px; resize: vertical; line-height: var(--b-lh-body); }

/* ---------- Hoja: pasos en SIPI ---------- */
.op-sipi__intro { display: flex; flex-direction: column; gap: 4px; }
.op-pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.op-paso { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--b-space-3); padding-bottom: var(--b-space-4); }
.op-paso:last-child { padding-bottom: 0; }
.op-paso:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--b-line); }
.op-paso__n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--b-resaltador); color: #0f1233; font: 700 var(--b-t-callout)/1 var(--b-font-body); font-variant-numeric: tabular-nums;
}
.op-paso__txt { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.op-paso__t { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); }
/* Pasos que llegan como una frase (guía del servidor): texto normal, no titular */
.op-paso__t--plano { font: 400 var(--b-t-callout)/var(--b-lh-callout) var(--b-font-body); color: var(--b-ink); }
.op-paso__s { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); }
.op-sheet .b-input.b-mono::placeholder { text-transform: none; font-family: var(--b-font-body); }
