/* =============================================================================
   XQV-DOC - Instalador web
   Paleta extraida del sitio del cliente. Ver docs/branding.md.
   Sin CDN, sin preprocesadores, sin build step.
   ========================================================================== */

:root {
    /* -- Marca (hex reales del sitio, ver docs/branding.md s1.1) ------------ */
    --xqv-primary:        #5B087A;   /* rgb(91,8,122)   - 65 ocurrencias      */
    --xqv-primary-light:  #7E3896;   /* muestreado del isotipo               */
    --xqv-primary-dark:   #45055C;   /* derivado para estados activos        */
    --xqv-ink:            #3D3844;   /* color del wordmark XQV               */
    --xqv-ink-soft:       #3A3A3A;   /* rgb(58,58,58)                        */
    --xqv-surface:        #DCD6DE;   /* rgb(220,214,222)                     */
    --xqv-border:         #BFB4C3;   /* rgb(191,180,195)                     */
    --xqv-white:          #FFFFFF;

    /* -- Derivados neutros -------------------------------------------------- */
    --xqv-bg:             #F7F5F8;
    --xqv-surface-soft:   #F2EEF4;
    --xqv-muted:          #6B6472;

    /* -- Estado: NO son colores de marca. Ver docs/branding.md s1.2 --------- */
    /* TODO: confirmar con cliente */
    --xqv-ok:             #15803D;
    --xqv-ok-bg:          #F0FDF4;
    --xqv-warn:           #B45309;
    --xqv-warn-bg:        #FFFBEB;
    --xqv-danger:         #B91C1C;
    --xqv-danger-bg:      #FEF2F2;
    --xqv-info-bg:        #F4F0F7;

    /* -- Tipografia (Montserrat, del sitio; auto-hospedada) ----------------- */
    --font-sans: 'Montserrat', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'SF Mono', Menlo, monospace;

    --radius: 4px;
    --shadow: 0 1px 3px rgba(61, 56, 68, .10);
}

/* -- Fuente auto-hospedada. Si el .woff2 no esta presente, el stack de
      respaldo del navegador cubre sin romper nada. -------------------------- */
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/montserrat-400.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/montserrat-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/montserrat-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* =============================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--xqv-ink);
    background: var(--xqv-bg);
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; color: var(--xqv-primary); }
h3 { font-size: 1rem; }
p  { margin: 0 0 .75rem; }

a { color: var(--xqv-primary); }
a:hover { color: var(--xqv-primary-dark); }

code, .mono {
    font-family: var(--font-mono);
    font-size: .875em;
}
code {
    background: var(--xqv-surface-soft);
    border: 1px solid var(--xqv-border);
    border-radius: 3px;
    padding: .1em .35em;
    word-break: break-all;
}

.muted { color: var(--xqv-muted); }

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

/* Foco visible en todo elemento interactivo: requisito de accesibilidad. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--xqv-primary-light);
    outline-offset: 2px;
}

/* =============================================================================
   Encabezado
   ========================================================================== */

.inst-header {
    background: var(--xqv-primary);
    color: var(--xqv-white);
    padding: 1.25rem 1rem;
}
.inst-header__inner {
    max-width: 940px; margin: 0 auto;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.inst-header__logo {
    background: var(--xqv-white);
    border-radius: var(--radius);
    padding: .4rem .6rem;
    height: auto;
}
.inst-header__titles { flex: 1 1 260px; }
.inst-header__titles h1 { margin: 0; color: var(--xqv-white); font-size: 1.35rem; letter-spacing: .02em; }
.inst-header__titles p  { margin: 0; font-size: .85rem; opacity: .85; }
.inst-header__version {
    font-family: var(--font-mono); font-size: .8rem;
    background: rgba(255, 255, 255, .15);
    padding: .2rem .6rem; border-radius: 999px;
}

/* =============================================================================
   Barra de pasos
   ========================================================================== */

.inst-steps {
    background: var(--xqv-white);
    border-bottom: 1px solid var(--xqv-border);
    padding: .75rem 1rem;
    overflow-x: auto;
}
.inst-steps ol {
    max-width: 940px; margin: 0 auto; padding: 0;
    list-style: none; display: flex; gap: .35rem; min-width: max-content;
}
.inst-steps__item {
    display: flex; align-items: center; gap: .45rem;
    padding: .3rem .7rem; border-radius: 999px;
    font-size: .8rem; white-space: nowrap;
    color: var(--xqv-muted); background: var(--xqv-surface-soft);
}
.inst-steps__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--xqv-border); color: var(--xqv-ink);
    font-size: .72rem; font-weight: 700;
}
.inst-steps__item--current {
    background: var(--xqv-primary); color: var(--xqv-white); font-weight: 600;
}
.inst-steps__item--current .inst-steps__num { background: var(--xqv-white); color: var(--xqv-primary); }
.inst-steps__item--done { background: var(--xqv-surface); color: var(--xqv-primary-dark); }
.inst-steps__item--done .inst-steps__num { background: var(--xqv-primary); color: var(--xqv-white); }

/* =============================================================================
   Disposicion
   ========================================================================== */

.inst-main { max-width: 940px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.inst-main--centered { display: flex; align-items: center; min-height: 80vh; }

.card {
    background: var(--xqv-white);
    border: 1px solid var(--xqv-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.card--muted   { background: var(--xqv-surface-soft); }
.card--success { border-left: 4px solid var(--xqv-ok); }
.card--action  { border-left: 4px solid var(--xqv-primary); }
.card--locked  { max-width: 560px; margin: 0 auto; text-align: left; }
.card__logo    { display: block; margin-bottom: 1rem; }

.card__head { margin-bottom: 1.25rem; }
.card__sub  { color: var(--xqv-muted); font-size: .9rem; margin: 0; }

.card__foot {
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--xqv-border);
    display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
}

.group-title {
    margin: 1.75rem 0 .6rem;
    padding-bottom: .3rem;
    border-bottom: 2px solid var(--xqv-surface);
    color: var(--xqv-primary);
    font-size: .8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
}
.group-title:first-of-type { margin-top: 0; }

/* =============================================================================
   Resumen de verificaciones
   ========================================================================== */

.summary { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.summary__item {
    flex: 1 1 120px; padding: .75rem 1rem;
    border-radius: var(--radius); border: 1px solid var(--xqv-border);
    display: flex; flex-direction: column; gap: .1rem;
}
.summary__num   { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.summary__label { font-size: .78rem; font-weight: 600; }
.summary__item--ok   { background: var(--xqv-ok-bg);     border-color: var(--xqv-ok);     color: var(--xqv-ok); }
.summary__item--warn { background: var(--xqv-warn-bg);   border-color: var(--xqv-warn);   color: var(--xqv-warn); }
.summary__item--fail { background: var(--xqv-danger-bg); border-color: var(--xqv-danger); color: var(--xqv-danger); }

/* =============================================================================
   Tablas - densidad alta, minimo 14px (docs/branding.md s4)
   ========================================================================== */

.table {
    width: 100%; border-collapse: collapse;
    font-size: 14px; margin-bottom: 1rem;
}
.table th, .table td {
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--xqv-border);
    text-align: left; vertical-align: top;
}
.table thead th {
    background: var(--xqv-surface);
    color: var(--xqv-ink);
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 2px solid var(--xqv-border);
}
.table tbody tr:hover { background: var(--xqv-surface-soft); }

.row--fail { background: var(--xqv-danger-bg); }
.row--warn { background: var(--xqv-warn-bg); }

/* Estado = color + texto + icono. Nunca solo color: una fotocopia B/N de
   auditoria debe seguir siendo inequivoca. */
.dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    font-size: .8rem; font-weight: 700; color: var(--xqv-white);
}
.dot--ok   { background: var(--xqv-ok); }
.dot--warn { background: var(--xqv-warn); }
.dot--fail { background: var(--xqv-danger); }

.fix {
    margin: .35rem 0 0; font-size: .82rem;
    color: var(--xqv-ink-soft); line-height: 1.5;
    padding-left: .7rem; border-left: 2px solid var(--xqv-border);
}

/* =============================================================================
   Formularios
   ========================================================================== */

.form { max-width: 100%; }

.field { margin-bottom: 1.1rem; }
.field--narrow { max-width: 300px; }

.field label, .fieldset legend {
    display: block; margin-bottom: .3rem;
    font-size: .82rem; font-weight: 600; color: var(--xqv-ink);
}

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select {
    width: 100%; padding: .5rem .65rem;
    font-family: inherit; font-size: 14px; color: var(--xqv-ink);
    background: var(--xqv-white);
    border: 1px solid var(--xqv-border); border-radius: var(--radius);
}
.field input.mono { font-family: var(--font-mono); font-size: 13px; }
.field input:focus, .field select:focus { border-color: var(--xqv-primary); }

.hint { margin: .3rem 0 0; font-size: .8rem; color: var(--xqv-muted); line-height: 1.5; }

.grid { display: grid; gap: 0 1rem; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.fieldset {
    border: 1px solid var(--xqv-border); border-radius: var(--radius);
    padding: .85rem 1rem; margin: 0 0 1.1rem;
}
.check {
    display: block; font-weight: 400; font-size: 14px;
    margin-bottom: .35rem; cursor: pointer;
}
.check input { margin-right: .45rem; }

/* =============================================================================
   Botones
   ========================================================================== */

.btn {
    display: inline-block; padding: .55rem 1.1rem;
    font-family: inherit; font-size: 14px; font-weight: 600;
    text-decoration: none; text-align: center; cursor: pointer;
    border: 1px solid transparent; border-radius: var(--radius);
}
.btn--lg { padding: .7rem 1.6rem; font-size: 15px; }

.btn--primary   { background: var(--xqv-primary); color: var(--xqv-white); }
.btn--primary:hover { background: var(--xqv-primary-dark); color: var(--xqv-white); }

.btn--secondary { background: var(--xqv-surface); color: var(--xqv-primary-dark); border-color: var(--xqv-border); }
.btn--secondary:hover { background: var(--xqv-border); }

.btn--ghost     { background: transparent; color: var(--xqv-muted); }
.btn--ghost:hover { color: var(--xqv-ink); background: var(--xqv-surface-soft); }

/* =============================================================================
   Avisos
   ========================================================================== */

.alert {
    border: 1px solid; border-left-width: 4px;
    border-radius: var(--radius);
    padding: .9rem 1.1rem; margin-bottom: 1.25rem;
}
.alert__title { display: block; margin-bottom: .35rem; font-size: .95rem; }
.alert__icon  { margin-right: .3rem; }
.alert ul     { margin: .35rem 0 0; padding-left: 1.2rem; font-size: 14px; }
.alert li     { margin-bottom: .2rem; }

.alert--danger  { background: var(--xqv-danger-bg); border-color: var(--xqv-danger); color: var(--xqv-danger); }
.alert--success { background: var(--xqv-ok-bg);     border-color: var(--xqv-ok);     color: var(--xqv-ok); }

.callout {
    border-radius: var(--radius);
    border-left: 4px solid;
    padding: .8rem 1rem; margin: 1rem 0;
    font-size: 14px; line-height: 1.6;
}
.callout--info { background: var(--xqv-info-bg);  border-color: var(--xqv-primary); }
.callout--warn { background: var(--xqv-warn-bg);  border-color: var(--xqv-warn); }

.blocked-note {
    color: var(--xqv-danger); font-weight: 600;
    font-size: 14px; margin: 0 0 .75rem; flex-basis: 100%;
}

/* =============================================================================
   Listas de datos
   ========================================================================== */

.kv {
    display: grid; grid-template-columns: 190px 1fr;
    gap: .35rem 1rem; margin: 0 0 1rem; font-size: 14px;
}
.kv dt { font-weight: 600; color: var(--xqv-muted); }
.kv dd { margin: 0; }

.steps-list, .check-list { margin: .5rem 0 1rem; padding-left: 1.3rem; font-size: 14px; }
.steps-list li, .check-list li { margin-bottom: .4rem; line-height: 1.55; }
.check-list { list-style: none; padding-left: 0; }
.check-list li {
    padding: .4rem .6rem; border-bottom: 1px solid var(--xqv-surface);
}

.log-list { list-style: none; margin: .5rem 0 1rem; padding: 0; font-size: 14px; }
.log-list li {
    display: flex; gap: .55rem; align-items: flex-start;
    padding: .35rem 0; border-bottom: 1px solid var(--xqv-surface-soft);
}
.log-list__dot { color: var(--xqv-ok); font-weight: 700; flex-shrink: 0; }

.token-box {
    background: var(--xqv-surface-soft);
    border: 1px solid var(--xqv-border); border-radius: var(--radius);
    padding: .9rem 1rem; margin: .75rem 0 1rem;
}
.token-box label { display: block; margin-bottom: .35rem; font-size: .82rem; font-weight: 600; }
.token-box input {
    width: 100%; padding: .5rem .65rem; font-size: 13px;
    background: var(--xqv-white); color: var(--xqv-ink);
    border: 1px solid var(--xqv-border); border-radius: var(--radius);
}

/* =============================================================================
   Pie
   ========================================================================== */

.inst-footer {
    max-width: 940px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
    border-top: 1px solid var(--xqv-border);
    font-size: .78rem; color: var(--xqv-muted); text-align: center;
}
.inst-footer p { margin: 0 0 .3rem; }
.inst-footer__note { font-style: italic; }

/* =============================================================================
   Responsive - usable en tablet (URS-023)
   ========================================================================== */

@media (max-width: 720px) {
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; gap: 0 0; }
    .kv dt { margin-top: .5rem; }
    .inst-header__inner { gap: .75rem; }
    .card { padding: 1.1rem; }
    .table { font-size: 13px; }
    .table th, .table td { padding: .4rem .35rem; }
}

/* =============================================================================
   Impresion - la pantalla del paso 1 es evidencia de IQ
   ========================================================================== */

@media print {
    body { background: var(--xqv-white); }
    .inst-steps, .card__foot, .btn { display: none !important; }
    .card { box-shadow: none; border: 1px solid #999; page-break-inside: avoid; }
    .inst-header { background: var(--xqv-white); color: var(--xqv-ink); border-bottom: 2px solid var(--xqv-primary); }
    .inst-header__titles h1 { color: var(--xqv-primary); }
    .dot { border: 1px solid #333; }
}
