/* =========================================================
   CONSULTA ELECTORAL
   Interfaz institucional independiente
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f4f4f1;
    --surface: #ffffff;
    --text: #181818;
    --muted: #6d706f;
    --line: #deded9;

    --primary: #172c3d;
    --primary-hover: #0e202e;

    --radius: 18px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: "Inter", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input {
    font: inherit;
}


/* =========================================================
   ESTRUCTURA
   ========================================================= */

.site {
    width: min(calc(100% - 48px), var(--max-width));
    min-height: 100vh;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    min-height: 145px;

    display: flex;
    align-items: center;

    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-kicker {
    margin-bottom: 8px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.brand-country {
    margin-top: 4px;

    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;

    color: var(--muted);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    flex: 1;

    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 100px;
    align-items: center;

    padding: 90px 0 110px;
}

.hero-copy {
    max-width: 650px;
}

.eyebrow {
    margin: 0 0 22px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;

    color: var(--muted);
}

.hero h1 {
    margin: 0;

    font-size: clamp(48px, 5vw, 76px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 600;
}

.intro {
    max-width: 470px;

    margin: 32px 0 0;

    font-size: 17px;
    line-height: 1.6;

    color: var(--muted);
}


/* =========================================================
   FORMULARIO
   ========================================================= */

.search-card {
    padding: 36px;

    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    box-shadow:
        0 2px 3px rgba(0, 0, 0, .02),
        0 20px 50px rgba(0, 0, 0, .04);
}

.field {
    padding: 0;
    margin: 0 0 28px;

    border: 0;
}

.field > label,
.field legend {
    display: block;

    margin-bottom: 10px;

    font-size: 13px;
    font-weight: 600;
}

#dni {
    width: 100%;
    height: 54px;

    padding: 0 17px;

    border: 1px solid #cacbc7;
    border-radius: 10px;
    outline: none;

    background: #fff;
    color: var(--text);

    font-size: 16px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

#dni::placeholder {
    color: #a1a39f;
}

#dni:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(23, 44, 61, .09);
}


/* =========================================================
   SEXO
   ========================================================= */

.sex-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.radio-option {
    position: relative;

    cursor: pointer;
}

.radio-option input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.radio-option span {
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #cacbc7;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 500;

    transition: all .18s ease;
}

.radio-option:hover span {
    border-color: #969a98;
}

.radio-option input:checked + span {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.radio-option input:focus-visible + span {
    outline: 3px solid rgba(23, 44, 61, .15);
}


/* =========================================================
   BOTÓN
   ========================================================= */

.submit-button {
    width: 100%;
    min-height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 10px;

    background: var(--primary);
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .1s ease,
        opacity .2s ease;
}

.submit-button:hover {
    background: var(--primary-hover);
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: .65;
}


/* =========================================================
   ESTADOS / RESULTADOS
   ========================================================= */

.status {
    display: none;

    margin-top: 22px;

    font-size: 14px;
    line-height: 1.5;

    color: var(--muted);
}

.status.visible {
    display: block;
}

.resultado {
    margin-top: 30px;
    padding-top: 30px;

    border-top: 1px solid var(--line);
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    padding: 28px 0 35px;

    border-top: 1px solid var(--line);

    font-size: 10px;
    line-height: 1.7;
    color: var(--muted);

    text-align: center;
}

.footer p {
    max-width: 820px;
    margin: 0 auto;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .header {
        min-height: 120px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 45px;

        padding: 60px 0 80px;

        justify-items: center;
    }

    .hero-copy {
        width: 100%;
        max-width: 600px;

        text-align: center;
    }

    .intro {
        margin-left: auto;
        margin-right: auto;
    }

    .search-card {
        width: 100%;
        max-width: 520px;
    }

}


@media (max-width: 600px) {

    .site {
        width: calc(100% - 32px);
        min-height: 100svh;
    }

    /* HEADER */

    .header {
        min-height: auto;
        padding: 28px 0 24px;
    }

    .brand-kicker {
        margin-bottom: 6px;
        font-size: 9px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-country {
        margin-top: 3px;
        font-size: 9px;
    }


    /* HERO */

    .hero {
        display: block;

        padding: 32px 0 38px;
    }

    .hero-copy {
        margin-bottom: 28px;
    }

    .eyebrow {
        margin-bottom: 12px;

        font-size: 10px;
    }

    .hero h1 {
        max-width: 500px;

        font-size: clamp(38px, 11vw, 48px);
        line-height: .98;
        letter-spacing: -.055em;
    }

    .intro {
        margin-top: 18px;

        font-size: 14px;
        line-height: 1.5;
    }


    /* CARD */

    .search-card {
        width: 100%;
        max-width: none;

        padding: 24px;

        border-radius: 14px;
    }

    .field {
        margin-bottom: 20px;
    }

    .field > label,
    .field legend {
        margin-bottom: 8px;

        font-size: 12px;
    }

    #dni {
        height: 50px;

        padding: 0 14px;

        font-size: 16px;
    }


    /* SEXO EN DOS COLUMNAS TAMBIÉN EN MOBILE */

    .sex-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .radio-option span {
        height: 46px;

        font-size: 13px;
    }


    /* BOTÓN */

    .submit-button {
        min-height: 50px;

        font-size: 13px;
    }


    /* RESULTADO */

    .result-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }


    /* FOOTER */

    .footer {
        padding: 22px 0 28px;

        font-size: 9px;
        line-height: 1.6;
    }

}

/* =========================================================
   RESULTADO DE CONSULTA
   ========================================================= */

.resultado {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.result-header {
    display: flex;
    gap: 14px;
    align-items: center;

    margin-bottom: 28px;
}

.result-check {
    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--primary);
    color: #fff;

    font-size: 15px;
    font-weight: 700;
}

.result-kicker {
    display: block;

    margin-bottom: 5px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;

    color: var(--muted);
}

.result-header h2 {
    margin: 0;

    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -.025em;
}

.result-data {
    border-top: 1px solid var(--line);
}

.result-item {
    padding: 19px 0;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-person {
    border-bottom: 1px solid var(--line);
}

.result-item span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;

    color: var(--muted);
}

.result-item strong {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.result-grid {
    display: grid;
    grid-template-columns: .65fr 1.35fr;
    gap: 22px;
}

.result-grid .result-item {
    border-bottom: 1px solid var(--line);
}

.new-search {
    margin-top: 24px;
    padding: 0;

    border: 0;
    background: transparent;

    color: var(--primary);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.new-search:hover {
    text-decoration: underline;
}


@media (max-width: 600px) {

    .result-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

}

/* =========================================================
   ESTADO DE BÚSQUEDA
   ========================================================= */

.searching {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 18px 0 2px;
}

.searching-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.searching-dots span {
    width: 5px;
    height: 5px;

    display: block;

    border-radius: 50%;
    background: var(--primary);

    animation: searchingPulse 1.2s infinite ease-in-out;
}

.searching-dots span:nth-child(2) {
    animation-delay: .15s;
}

.searching-dots span:nth-child(3) {
    animation-delay: .30s;
}

.searching-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.searching-copy strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.searching-copy span {
    font-size: 11px;
    color: var(--muted);
}

@keyframes searchingPulse {

    0%,
    60%,
    100% {
        opacity: .25;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }

}