:root {
    --ink: #16233a;
    --muted: #64748b;
    --line: #dce5ef;
    --surface: #ffffff;
    --soft: #f4f8fc;
    --primary: #176b87;
    --primary-dark: #10546b;
    --accent: #e39a32;
    --danger: #b42318;
    --shadow: 0 22px 60px rgba(20, 50, 75, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: linear-gradient(180deg, #edf5f8 0, #f8fafc 480px, #fff 100%);
    font-family: "Manrope", system-ui, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
    width: min(1180px, calc(100% - 40px));
    height: 86px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
    width: 46px; height: 46px; display: grid; place-items: center;
    color: #fff; border-radius: 14px; background: var(--primary);
    box-shadow: 0 8px 22px rgba(23, 107, 135, .24);
}
.brand-mark svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-badge { padding: 8px 13px; color: var(--primary); background: rgba(255,255,255,.7); border: 1px solid rgba(23,107,135,.18); border-radius: 999px; font-size: 12px; font-weight: 700; }

main { width: min(1100px, calc(100% - 40px)); margin: 0 auto 64px; }
.hero { padding: 54px 0 30px; }
.hero-copy { max-width: 750px; margin: 0 auto 34px; text-align: center; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 12px 0 15px; font-size: clamp(34px, 5vw, 56px); line-height: 1.08; letter-spacing: -.05em; }
.hero-copy p { max-width: 670px; margin: auto; color: var(--muted); font-size: 17px; line-height: 1.7; }

.search-card {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    gap: 22px;
    padding: 32px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(220,229,239,.85);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.field label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 800; }
.field small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 15px; top: 50%; width: 20px; transform: translateY(-50%); fill: none; stroke: #7a8ba1; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.input-wrap input {
    width: 100%; height: 52px; padding: 0 15px 0 45px;
    color: var(--ink); background: var(--soft); border: 1px solid transparent; border-radius: 12px;
    outline: 0; transition: .2s ease;
}
.input-wrap input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23,107,135,.1); }
.input-wrap input::placeholder { color: #95a2b3; }
.divider { display: flex; align-items: center; justify-content: center; padding-top: 21px; }
.divider span { display: grid; width: 30px; height: 30px; place-items: center; color: #8795a8; background: var(--soft); border-radius: 50%; font-size: 11px; font-weight: 700; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.button { min-height: 46px; padding: 0 22px; border: 0; border-radius: 11px; font-size: 13px; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; margin-right: 7px; }
.button-primary { min-width: 145px; color: #fff; background: var(--primary); box-shadow: 0 9px 22px rgba(23,107,135,.2); }
.button-primary:hover { background: var(--primary-dark); }
.button-primary:disabled { opacity: .65; cursor: wait; }
.button-secondary { color: #53657b; background: #edf2f7; }
.form-message { grid-column: 1 / -1; min-height: 18px; margin: -6px 0 0; color: var(--danger); text-align: center; font-size: 12px; font-weight: 700; }

.results { margin-top: 34px; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 15px 45px rgba(20,50,75,.08); }
.results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.results h2 { margin: 7px 0 5px; font-size: 27px; letter-spacing: -.035em; }
.results-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.button-print { color: var(--primary); background: #eaf4f7; white-space: nowrap; }
.result-actions { display: flex; gap: 9px; }
.button-download { display: inline-flex; align-items: center; color: #fff; background: var(--primary); text-decoration: none; white-space: nowrap; }
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #66758b; background: var(--soft); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.person-name { font-weight: 800; }
.area-pill { display: inline-flex; padding: 6px 10px; color: var(--primary-dark); background: #eaf4f7; border-radius: 999px; font-size: 11px; font-weight: 800; }
.empty-state { padding: 52px 24px; text-align: center; }
.empty-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 13px; place-items: center; color: var(--primary); background: #eaf4f7; border-radius: 50%; }
.empty-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.empty-state strong { display: block; font-size: 15px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.source { margin: 14px 2px 0; color: #8491a3; font-size: 11px; }
.source span { color: #5c6b7e; font-weight: 700; }
footer { padding: 22px; color: #8390a2; border-top: 1px solid #edf1f5; text-align: center; font-size: 11px; }

@media (max-width: 760px) {
    .site-header, main { width: min(100% - 28px, 1100px); }
    .site-header { height: 74px; }
    .header-badge { display: none; }
    .hero { padding-top: 36px; }
    .hero-copy { margin-bottom: 26px; }
    .hero-copy p { font-size: 15px; }
    .search-card { grid-template-columns: 1fr; gap: 20px; padding: 22px; border-radius: 18px; }
    .divider { display: none; }
    .form-actions { flex-direction: column; }
    .results { padding: 22px; }
    .results-heading { align-items: stretch; flex-direction: column; }
    .result-actions { align-items: stretch; flex-direction: column; }
    .button-print, .button-download { justify-content: center; }
    .table-shell { overflow-x: auto; }
    table { min-width: 650px; }
}

@media print {
    @page { size: A4; margin: 18mm; }
    body { background: #fff; color: #111; }
    .site-header, .hero, footer, .result-actions { display: none !important; }
    main { width: 100%; margin: 0; }
    .results { display: block !important; margin: 0; padding: 0; border: 0; box-shadow: none; }
    .results::before { content: "CONSULTA DE DATOS"; display: block; margin-bottom: 28px; font-family: Georgia, serif; font-size: 17px; }
    .results-heading { margin-bottom: 26px; }
    .results h2 { font-size: 28px; }
    .eyebrow { color: #555; }
    .table-shell { border-radius: 0; }
    th { color: #111; background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .area-pill { padding: 0; color: #111; background: transparent; }
}
