/* portal.css · `portal.dotnetworks.xyz`, el área de las personas de cada
 * cliente (DOT-70).
 *
 * Hoja propia, como `documento.css`: lo que ve un cliente no carga `ui.css`, que
 * es de la herramienta. La marca es la de la casa —azul #0246AB, `ink`, `paper`,
 * Outfit para titulares e Inter para el cuerpo— y los valores salen de
 * `documento.css`, que a su vez los copia de la web.
 *
 * Sin JavaScript: el gráfico de visitas son barras de CSS con su alto en línea.
 */

@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap;
    src: url("../fuentes/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 900; font-display: swap;
    src: url("../fuentes/outfit-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
    src: url("../fuentes/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap;
    src: url("../fuentes/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
    src: url("../fuentes/inter-latin-600-normal.woff2") format("woff2"); }

:root {
    --brand: #0246ab;
    --brand-700: #01368a;
    --brand-50: #eff6ff;
    --ambar: #c97b30;
    --ambar-claro: #fbf4ea;
    --ink: #0f1c2e;
    --ink-muted: #687585;
    --ink-faint: #9ba8b5;
    --paper: #f8f7f4;
    --blanco: #ffffff;
    --borde: rgba(15, 28, 46, 0.1);
    --titular: "Outfit", system-ui, sans-serif;
    --cuerpo: "Inter", system-ui, sans-serif;
    --radio: 12px;
}

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

body.portal {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 var(--cuerpo);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-700); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Cabecera y pie ─────────────────────────────────────────── */

.portal-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
    border-bottom: 1px solid var(--borde);
    background: var(--blanco);
}
.wordmark {
    margin: 0;
    font: 900 1.35rem/1 var(--titular);
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}
.portal-cab-persona { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--ink-muted); }
.portal-cab-persona form { margin: 0; }

.portal-main {
    flex: 1;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.5rem);
}
.portal-pie {
    padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
    color: var(--ink-faint);
    font-size: 0.85rem;
    text-align: center;
}

/* ── Texto ──────────────────────────────────────────────────── */

.antetitulo {
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
}
h1 { margin: 0 0 0.5rem; font: 900 clamp(2rem, 5vw, 2.6rem)/1.1 var(--titular); letter-spacing: -0.02em; }
h2 { margin: 3rem 0 1.25rem; font: 700 1.15rem/1.3 var(--titular); }
.suave { color: var(--ink-muted); }
.nota { margin-top: 3rem; max-width: 36rem; font-size: 0.9rem; color: var(--ink-faint); }

/* ── Botones y formularios ──────────────────────────────────── */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: var(--blanco);
    font: 500 0.95rem var(--cuerpo);
    text-decoration: none;
    cursor: pointer;
}
.boton:hover { background: var(--brand-700); color: var(--blanco); }
.boton-texto {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-muted);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.boton-texto:hover { color: var(--ink); }

.formulario { display: flex; flex-direction: column; gap: 1.1rem; max-width: 24rem; margin-top: 2rem; }
.campo { display: flex; flex-direction: column; gap: 0.35rem; }
.campo label { font-size: 0.9rem; font-weight: 500; }
.campo input {
    min-height: 44px;
    padding: 0 0.85rem;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: var(--blanco);
    color: var(--ink);
    font: inherit;
}
.campo input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.aviso {
    margin: 1.5rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--ambar-claro);
    color: var(--ink);
    max-width: 24rem;
}

/* ── Tarjetas ───────────────────────────────────────────────── */

.tarjetas { display: flex; flex-direction: column; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.tarjeta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    background: var(--blanco);
    color: var(--ink);
    text-decoration: none;
}
a.tarjeta:hover { border-color: rgba(2, 70, 171, 0.4); color: var(--ink); }
.tarjeta-titulo { display: flex; align-items: center; gap: 0.75rem; font: 700 1.1rem/1.3 var(--titular); }
.tarjeta-sub { display: block; margin-top: 0.2rem; font-size: 0.85rem; color: var(--ink-muted); word-break: break-word; }
.tarjeta-accion { font-size: 0.9rem; font-weight: 500; color: var(--brand); }
.tarjeta-aparte { max-width: 16rem; font-size: 0.85rem; color: var(--ink-faint); }
.tarjeta form { margin: 0; }
.etiqueta {
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: var(--ambar-claro);
    color: var(--ambar);
    font: 500 0.75rem var(--cuerpo);
}

/* ── Visitas ────────────────────────────────────────────────── */

.pestanas { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.pestanas a {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--borde);
    border-radius: 999px;
    background: var(--blanco);
    color: var(--ink-muted);
    font-size: 0.9rem;
    text-decoration: none;
}
.pestanas a[aria-current="page"] { border-color: var(--brand); background: var(--brand); color: var(--blanco); }

.totales { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 2rem 0 0; }
.total { padding: 1.1rem 1.25rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco); }
.total dt { font-size: 0.85rem; color: var(--ink-muted); }
.total dd { margin: 0.2rem 0 0; font: 900 1.9rem/1.1 var(--titular); }

.grafico {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 180px;
    margin: 1.5rem 0 0;
    padding: 1rem 1rem 0;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    background: var(--blanco);
    overflow-x: auto;
}
.barra { flex: 1 0 8px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.barra span { display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--brand); }
.barra span.cero { background: var(--borde); }
.eje { display: flex; justify-content: space-between; margin-top: 0.4rem; font-size: 0.8rem; color: var(--ink-faint); }

.lista { margin: 0; padding: 0; list-style: none; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco); }
.lista li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--borde); }
.lista li:first-child { border-top: 0; }
.lista .n { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── El traspaso ────────────────────────────────────────────── */

body.portal-paso { align-items: center; justify-content: center; }

@media (max-width: 520px) {
    .portal-cab-persona span { display: none; }
    .tarjeta-aparte { max-width: none; }
}

/* ── Documentos y pagos (tramo 3) ───────────────────────────── */

.tarjeta-anulada .tarjeta-titulo { text-decoration: line-through; color: var(--ink-muted); }
.etiqueta-aceptada { background: #e7f5ee; color: #1f7a4d; }
.etiqueta-enviada { background: var(--brand-50); color: var(--brand); }
.etiqueta-rechazada, .etiqueta-anulada, .etiqueta-vencida { background: rgba(15, 28, 46, 0.06); color: var(--ink-muted); }
.lista li > span:first-child { display: flex; flex-direction: column; }
.lista li.anulado > span:first-child { text-decoration: line-through; color: var(--ink-muted); }
.lista li.anulado .n { text-decoration: line-through; color: var(--ink-faint); }
.texto-aviso { color: var(--ambar); }
.total-aviso dd { color: var(--ambar); }

/* ── Proyecto y cambios (tramo 4) ───────────────────────────── */

.hitos { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.hito { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; padding-bottom: 1.4rem; position: relative; }
.hito::before { content: ""; position: absolute; left: 0.7rem; top: 1.3rem; bottom: 0; width: 2px; background: var(--borde); }
.hito:last-child::before { display: none; }
.hito-marca { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--borde); background: var(--blanco); position: relative; z-index: 1; }
.hito-hecho .hito-marca { background: var(--brand); border-color: var(--brand); }
.hito-en_curso .hito-marca { border-color: var(--brand); }
.hito-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.hito-detalle { margin: 0.4rem 0 0; }
.etiqueta-hito-hecho, .etiqueta-pedido-hecho { background: #e7f5ee; color: #1f7a4d; }
.etiqueta-hito-en_curso, .etiqueta-pedido-en_curso { background: var(--brand-50); color: var(--brand); }
.etiqueta-hito-pendiente, .etiqueta-pedido-recibido { background: rgba(15, 28, 46, 0.06); color: var(--ink-muted); }
.formulario-ancho { max-width: 36rem; }
.campo textarea {
    padding: 0.7rem 0.85rem; border: 1px solid var(--borde); border-radius: 8px;
    background: var(--blanco); color: var(--ink); font: inherit; resize: vertical;
}
.campo textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.aviso-ok { background: #e7f5ee; }
.lista li { align-items: center; }
.lista .etiqueta { flex-shrink: 0; white-space: nowrap; }
/* En las tarjetas que son un enlace, el texto se parte y la flecha se queda
   a la derecha: saltando de línea parecía otra cosa. */
a.tarjeta { flex-wrap: nowrap; }
a.tarjeta > span:first-child { flex: 1 1 auto; min-width: 0; }
a.tarjeta .tarjeta-accion { flex-shrink: 0; }
