:root {
    --fondo: #eef2f7;
    --superficie: #fff;
    --texto: #17253a;
    --texto-suave: #4e6076;
    --borde: #d8e1ec;
    --azul: #244ab5;
    --azul-oscuro: #193684;
    --azul-claro: #eaf0ff;
    --sombra: 0 16px 40px rgba(23, 37, 58, .08);
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--fondo);
    color: var(--texto);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.6;
}

    body > .container {
        flex: 1;
        padding: clamp(1.25rem, 4vw, 3rem) .875rem;
    }

    body > footer.footer {
        position: static;
        width: auto;
        padding: 1rem 0;
        background: var(--superficie);
        white-space: normal;
        line-height: 1.5;
    }

a {
    color: var(--azul);
    text-underline-offset: .2em;
}

    a:hover {
        color: var(--azul-oscuro);
    }

:where(a, button, input, select, textarea, table):focus-visible {
    outline: 3px solid #5477dc;
    outline-offset: 3px;
}

body > header .navbar.bg-white {
    margin-bottom: 0 !important;
    padding: .875rem 0;
    border-bottom-color: #30445f !important;
    background: #15263e !important;
}

body > header .navbar > .container-fluid {
    max-width: 1320px;
    padding-inline: clamp(.875rem, 3vw, 2rem);
}

body > header .navbar .navbar-brand {
    margin-right: 1.5rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 750;
    word-break: normal;
}

.navbar .navbar-nav {
    gap: .25rem;
    flex-wrap: wrap;
}

body > header .navbar .nav-link.text-dark {
    padding: .45rem .75rem;
    border-radius: .5rem;
    color: #e2eaf6 !important;
    font-size: .9rem;
    font-weight: 550;
}

    body > header .navbar .nav-link.text-dark:hover,
    body > header .navbar .nav-link.text-dark:focus-visible {
        background: #30445f;
        color: #fff !important;
    }

body > header .navbar .navbar-toggler {
    border-color: #91a3bc;
    filter: brightness(0) invert(1);
}

main[role="main"].pb-3 {
    min-width: 0;
    padding: clamp(1.25rem, 4vw, 3rem) !important;
    border: 1px solid var(--borde);
    border-radius: 1.25rem;
    background: var(--superficie);
    box-shadow: var(--sombra);
    overflow-wrap: anywhere;
}

main[role="main"] h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(1.85rem, 4.5vw, 3rem);
    font-weight: 760;
    letter-spacing: -.045em;
    line-height: 1.12;
}

main[role="main"] h2 {
    margin: 2rem 0 .875rem;
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 720;
    letter-spacing: -.02em;
}

main[role="main"] p {
    max-width: 70ch;
    color: var(--texto-suave);
}

main[role="main"] > p:empty {
    display: none;
}

main[role="main"] > p.text-danger:not(:empty) {
    padding: .75rem 1rem;
    border: 1px solid #f0c5cb;
    border-radius: .625rem;
    background: #fff2f4;
}

main[role="main"] > h1.text-danger {
    padding-left: 1rem;
    border-left: 4px solid #bb344a;
}

main[role="main"]:has(> form input[type="password"]) {
    max-width: 34rem;
    margin: clamp(0rem, 3vw, 2rem) auto;
    border-top: 4px solid var(--azul);
}

    main[role="main"]:has(> form input[type="password"]) button[type="submit"] {
        width: 100%;
    }

main[role="main"]:has(> h1 + p + .btn + .btn),
main[role="main"]:has(> h1 + p + p + p):not(:has(> h2)) {
    padding-block: clamp(2rem, 7vw, 5rem) !important;
    background: linear-gradient(125deg, #fff 35%, #e6eeff 100%);
}

main[role="main"] > form {
    margin-bottom: 1.25rem;
}

    main[role="main"] > form[method="post"]:not(:has(input[type="password"])) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        padding: clamp(1rem, 3vw, 1.5rem);
        border: 1px solid var(--borde);
        border-radius: .875rem;
        background: #f6f8fc;
    }

        main[role="main"] > form[method="post"]:not(:has(input[type="password"])) > .mb-3 {
            margin-bottom: 0 !important;
        }

        main[role="main"] > form[method="post"]:not(:has(input[type="password"])) > button {
            grid-column: 1 / -1;
            justify-self: start;
        }

    main[role="main"] > form:has(input[name="edad"]) {
        padding: 1rem;
        border: 1px solid var(--borde);
        border-radius: .875rem;
        background: #f6f8fc;
    }

main[role="main"] input[name="edad"] {
    max-width: 16rem;
}

main[role="main"] .form-label {
    margin-bottom: .375rem;
    color: var(--texto);
    font-size: .9rem;
    font-weight: 650;
}

main[role="main"] .form-control,
main[role="main"] .form-select {
    min-height: 2.875rem;
    padding: .625rem .8rem;
    border-color: #b7c6d8;
    border-radius: .625rem;
    color: var(--texto);
}

    main[role="main"] .form-control:focus,
    main[role="main"] .form-select:focus {
        border-color: var(--azul);
        box-shadow: 0 0 0 .2rem rgba(36, 74, 181, .15);
    }

main[role="main"] .btn {
    padding: .6rem 1rem;
    border-radius: .625rem;
    font-weight: 650;
}

main[role="main"] > .btn {
    margin: 0 .375rem .75rem 0;
}

main[role="main"] .btn-primary {
    border-color: var(--azul);
    background: var(--azul);
    color: #fff;
}

    main[role="main"] .btn-primary:hover,
    main[role="main"] .btn-primary:active {
        border-color: var(--azul-oscuro);
        background: var(--azul-oscuro);
        color: #fff;
    }

main[role="main"] .btn-secondary {
    border-color: #c4d3f5;
    background: var(--azul-claro);
    color: var(--azul-oscuro);
}

    main[role="main"] .btn-secondary:hover,
    main[role="main"] .btn-secondary:active {
        border-color: #a8bcec;
        background: #d9e4ff;
        color: var(--azul-oscuro);
    }

main[role="main"] > a:not(.btn) {
    display: inline-block;
    margin-top: .375rem;
    font-weight: 650;
}

main[role="main"] > p:has(> strong:first-child) {
    max-width: none;
    margin-bottom: .375rem;
    padding: .7rem .9rem;
    border-left: 3px solid #bdcdf3;
    border-radius: 0 .5rem .5rem 0;
    background: #f6f8fc;
}

main[role="main"] > p > strong {
    color: var(--texto);
}

main[role="main"] > h2 + p {
    padding: .8rem 1rem;
    border-radius: .625rem;
    background: var(--azul-claro);
}

main[role="main"] .table {
    --bs-table-color: var(--texto);
    --bs-table-striped-bg: #f6f8fc;
    --bs-table-striped-color: var(--texto);
    width: 100%;
    margin: .5rem 0 1.5rem;
    border: 1px solid var(--borde);
    vertical-align: middle;
}

    main[role="main"] .table > :not(caption) > * > * {
        padding: .8rem .875rem;
        border-color: var(--borde);
    }

    main[role="main"] .table thead th {
        background: var(--azul-claro);
        color: #253b60;
        font-size: .875rem;
        font-weight: 700;
    }

    main[role="main"] .table tbody th {
        color: #253b60;
    }

    main[role="main"] .table tbody tr:hover > * {
        background: #edf3ff;
    }

    main[role="main"] .table .btn {
        padding: .4rem .7rem;
        font-size: .875rem;
        white-space: nowrap;
    }

@media (max-width: 767.98px) {
    main[role="main"] .table:has(thead) {
        display: block;
        overflow-x: auto;
    }

        main[role="main"] .table:has(thead) th,
        main[role="main"] .table:has(thead) td {
            min-width: 5rem;
            overflow-wrap: normal;
        }
}

@media (max-width: 575.98px) {
    body > header .navbar .navbar-collapse {
        padding-top: .75rem;
    }

    main[role="main"].pb-3 {
        border-radius: .875rem;
    }

    main[role="main"] > form[method="post"]:not(:has(input[type="password"])) {
        grid-template-columns: minmax(0, 1fr);
    }
}
