:root {
    --navy: #13233a;
    --blue: #1967d2;
    --blue-dark: #0e4ea8;
    --green: #16845b;
    --red: #bd2c2c;
    --amber: #9a6500;
    --surface: #ffffff;
    --page: #f3f6fa;
    --border: #d9e1ea;
    --text: #172033;
    --muted: #637083;
    --shadow: 0 18px 45px rgba(19, 35, 58, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(circle at top right, #e5efff 0, var(--page) 38%);
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin-top: 0; }
.center-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card {
    width: min(920px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--shadow);
}
.narrow { max-width: 560px; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.brand-mark {
    display: grid; place-items: center; width: 48px; height: 48px;
    background: var(--blue); color: white; border-radius: 14px; font-weight: 800;
}
.brand strong { display: block; color: var(--navy); font-size: 18px; }
.brand span, .muted { color: var(--muted); }
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
label { font-weight: 650; }
input, textarea, select {
    width: 100%; padding: 12px 14px; border: 1px solid #b8c4d2;
    border-radius: 10px; background: white; color: var(--text); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid #cfe1ff; border-color: var(--blue); }
.token-input { text-transform: uppercase; letter-spacing: .08em; text-align: center; font-weight: 750; font-size: 20px; }
.button, button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 10px; padding: 12px 18px; color: white;
    background: var(--blue); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.button:hover, button:hover { background: var(--blue-dark); }
.button.secondary { background: #e8eef6; color: var(--navy); }
.button.danger { background: var(--red); }
.button.small { padding: 8px 11px; font-size: 14px; }
.button.full { width: 100%; }
.alert { border-radius: 10px; padding: 12px 14px; border: 1px solid; }
.alert.error { color: #851c1c; background: #fff0f0; border-color: #f1b7b7; }
.alert.success { color: #0b6544; background: #eaf9f3; border-color: #9edbc6; }
.alert.info { color: #164c89; background: #edf5ff; border-color: #b5d3f6; }
.admin-header { background: var(--navy); color: white; }
.admin-header-inner {
    width: min(1220px, calc(100% - 32px)); margin: auto; min-height: 68px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.admin-header a { color: white; text-decoration: none; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.admin-nav form { margin: 0; }
.admin-nav button {
    padding: 0; border: 0; border-radius: 0; background: transparent;
    color: white; font-weight: 400; cursor: pointer;
}
.admin-nav button:hover { background: transparent; text-decoration: underline; }
.admin-main { width: min(1220px, calc(100% - 32px)); margin: 28px auto 50px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 22px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat strong { font-size: 30px; color: var(--navy); display: block; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f7f9fc; color: var(--navy); font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 750; }
.badge.pending, .badge.draft { color: #775000; background: #fff2c7; }
.badge.completed, .badge.published { color: #076144; background: #dff7ed; }
.badge.revoked, .badge.closed { color: #7c2424; background: #ffe3e3; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline; }
.question-card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.question-number { color: var(--blue); font-weight: 800; font-size: 14px; text-transform: uppercase; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.choice input { width: auto; margin-top: 4px; }
.survey-lock {
    position: fixed; inset: 0; z-index: 1000; overflow-y: auto; padding: 20px;
    background: radial-gradient(circle at top, #eaf2ff, #eef2f7 55%, #dce4ed);
}
.survey-shell { width: min(900px, 100%); margin: 0 auto; }
.survey-top { position: sticky; top: 0; z-index: 3; background: rgba(238,242,247,.96); padding: 12px 0; }
.progress { height: 8px; background: #d7e0eb; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.privacy-note { border-left: 4px solid var(--green); padding: 10px 14px; background: #ecf9f4; }
.no-select { user-select: none; -webkit-user-select: none; }
.screen-shield { display: none; }
.security-notice {
    position: fixed; right: 18px; bottom: 18px; z-index: 3000;
    max-width: 360px;
}
.token-code { font: 700 15px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.footer-note { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .page-head, .admin-header-inner { flex-direction: column; align-items: stretch; padding: 14px 0; }
    .card { padding: 22px; }
}

@media print {
    body * { display: none !important; visibility: hidden !important; }
    body::before {
        content: "La impresión de esta evaluación está deshabilitada.";
        display: block !important; visibility: visible !important; padding: 40px; font-size: 20px;
    }
}
