/* =============================================================================
   Estilos base.

   Sin dependencias externas: la pagina de estado tiene que verse bien aunque
   no haya conexion a ningun CDN. El panel (Fase 2) anadira Bootstrap encima.
   ========================================================================== */

:root {
    --bg: #0B1528; /* Azul Marino Obsidiana Profundo (70%) */
    --surface: #111C30; /* Tarjetas y contenedores oscuros de alta definición */
    --surface-hover: #182844;
    --border: rgba(226, 232, 240, 0.12); /* Gris Titanio Claro sutil */
    --primary: #0B1528;
    --secondary: #0284C7; /* Azul Acero Quirúrgico (20%) */
    --accent: #FF5A36; /* Naranja Coral Cinético (5% CTA) */
    --text: #F8FAFC; /* Texto Blanco/Platino */
    --text-soft: #94A3B8; /* Gris Acero Neutro */

    --ok: #10B981; /* Verde Esmeralda Clínico (5% ROI) */
    --ok-bg: rgba(16, 185, 129, 0.15);
    --warn: #F59E0B;
    --warn-bg: rgba(245, 158, 11, 0.15);
    --fail: #EF4444;
    --fail-bg: rgba(239, 68, 68, 0.15);

    --font-title: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

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

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

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: .88em;
    background: #eef0f3;
    padding: .12em .38em;
    border-radius: 4px;
    word-break: break-word;
}

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

/* ---------------------------------------------------------------- Layout -- */

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
}

.page-head { margin-bottom: 2rem; }

.eyebrow {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
}

.page-head h1 {
    margin: 0 0 .5rem;
    font-size: 1.9rem;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.lede {
    margin: 0;
    max-width: 62ch;
    color: var(--text-soft);
}

/* --------------------------------------------------------------- Resumen -- */

.summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.summary--ok   { border-left: 4px solid var(--ok); }
.summary--fail { border-left: 4px solid var(--fail); }

.summary-status { font-weight: 650; font-size: 1.05rem; }

.summary-counts { display: flex; flex-wrap: wrap; gap: .4rem; }

.pill {
    font-size: .8rem;
    font-weight: 600;
    padding: .18rem .6rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pill--ok   { background: var(--ok-bg);   color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--fail { background: var(--fail-bg); color: var(--fail); }

/* ------------------------------------------------------- Tabla de checks -- */

.checks {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.checks thead th {
    text-align: left;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.checks tbody tr + tr { border-top: 1px solid var(--border); }

.checks td,
.checks tbody th {
    padding: .85rem 1rem;
    vertical-align: top;
    text-align: left;
}

.checks tbody th { font-weight: 600; white-space: nowrap; }

.col-status { width: 2.75rem; }

.checks .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
}

.checks .badge--ok   { background: var(--ok-bg);   color: var(--ok); }
.checks .badge--warn { background: var(--warn-bg); color: var(--warn); }
.checks .badge--fail { background: var(--fail-bg); color: var(--fail); }

.row--fail { background: #fffbfb; }

.detail { word-break: break-word; }

.hint {
    margin: .35rem 0 0;
    font-size: .875rem;
    color: var(--text-soft);
    max-width: 60ch;
}

/* ---------------------------------------------------------- Pasos y pie -- */

.next-steps {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--fail);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.next-steps h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.next-steps ol { margin: 0; padding-left: 1.2rem; }
.next-steps li + li { margin-top: .3rem; }

.page-foot { margin-top: 2rem; }

.page-foot dl {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    margin: 0;
    font-size: .85rem;
}

.page-foot dt {
    color: var(--text-soft);
    font-size: .74rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.page-foot dd { margin: 0; font-weight: 600; }

/* ----------------------------------------------------------------- Error -- */

.error-page {
    max-width: 32rem;
    margin: 0 auto;
    padding: 6rem 1.25rem;
    text-align: center;
}

.error-page .code {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--accent);
    line-height: 1;
}

.error-page h1 { margin: .75rem 0 .5rem; font-size: 1.35rem; }
.error-page p { color: var(--text-soft); margin: 0; }

.error-page a {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.error-page a:hover { text-decoration: underline; }

/* ----------------------------------------------------------- Responsive -- */

@media (max-width: 640px) {
    .page { padding: 2rem 1rem 3rem; }
    .page-head h1 { font-size: 1.55rem; }

    .checks thead { display: none; }

    .checks tbody tr {
        display: grid;
        grid-template-columns: 2.75rem 1fr;
        padding: .35rem 0;
    }

    .checks td,
    .checks tbody th { padding: .45rem .75rem; }

    .checks tbody th { grid-column: 2; white-space: normal; }
    .col-status { grid-row: 1 / span 2; }
}

/* ------------------------------------------------------------- Botones -- */

.page button,
.page .btn {
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: .5rem 1rem;
    cursor: pointer;
    white-space: nowrap;
}

.page button:hover:not(:disabled),
.page .btn:hover { background: #1f47cc; }

.page button:disabled {
    background: #c9ced6;
    cursor: not-allowed;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

pre {
    background: #eef0f3;
    padding: .75rem;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85rem;
}

.page-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.page-foot a:hover { text-decoration: underline; }
