:root {
    --azul: #263475;
    --azul-2: #2b377f;
    --amarillo: #f4ad31;
    --texto: #263475;
    --fondo: #eef1f9;
    --banda: #838db6;
    --qr-size: 94px;
    --qr-lift: 47px;
    --qr-padding: 8px;
    --qr-clearance: 22px;
    --footer-height: 78px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    align-items: center;
    background: radial-gradient(circle at top, #f8f9fd 0, var(--fondo) 55%, #dfe4f3 100%);
    color: var(--texto);
    display: flex;
    font-family: "Montserrat", "Poppins", "Segoe UI", Arial, sans-serif;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px;
}

a {
    color: inherit;
    text-decoration: none;
}

.credencial-shell {
    width: min(100%, 390px);
}

.credencial {
    background: #fff;
    border: 1px solid rgba(38, 52, 117, .18);
    box-shadow: 0 18px 45px rgba(38, 52, 117, .18);
    min-height: 760px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.credencial-header {
    background-color: var(--banda);
    background-image:
        linear-gradient(rgba(38, 52, 117, .18), rgba(38, 52, 117, .18)),
        url("../img/patron-superior.png");
    background-position: center;
    background-size: cover;
    height: 146px;
}

.credencial-body {
    padding: 0 42px 34px;
    text-align: center;
}

.foto-marco {
    background: var(--azul);
    border-radius: 50%;
    height: 148px;
    margin: -74px auto 28px;
    padding: 6px;
    width: 148px;
}

.foto-marco img {
    border-radius: inherit;
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: var(--foto-pos, center);
    width: 100%;
}

.nombre {
    color: var(--azul);
    font-size: clamp(1.55rem, 7vw, 2.05rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0;
}

.cargo {
    color: var(--azul);
    font-size: clamp(1rem, 4.5vw, 1.24rem);
    font-weight: 500;
    line-height: 1.2;
    margin: 8px 0 28px;
}

.acciones {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 14px;
}

.accion {
    align-items: center;
    background: var(--azul);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    width: 34px;
}

.accion svg {
    height: 18px;
    width: 18px;
}

.accion[href]:hover,
.accion[href]:focus-visible {
    box-shadow: 0 8px 18px rgba(38, 52, 117, .26);
    transform: translateY(-2px);
}

.guardar-contacto {
    background: var(--azul);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 500;
    justify-content: center;
    line-height: 1;
    margin-bottom: 64px;
    min-width: 196px;
    padding: 13px 24px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.guardar-contacto:hover,
.guardar-contacto:focus-visible {
    box-shadow: 0 10px 22px rgba(38, 52, 117, .28);
    transform: translateY(-2px);
}

.datos {
    display: grid;
    gap: 26px;
    margin: 0 auto 58px;
    max-width: 305px;
    text-align: left;
}

.dato {
    align-items: center;
    display: grid;
    gap: 20px;
    grid-template-columns: 44px 1fr;
}

.dato-icono {
    align-items: center;
    color: var(--azul);
    display: inline-flex;
    justify-content: center;
}

.dato-icono svg {
    height: 34px;
    width: 34px;
}

.dato-etiqueta {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 3px;
}

.dato-valor {
    display: block;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.12;
}

.marca {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-bottom: calc(var(--qr-lift) + var(--qr-clearance));
}

.marca img {
    display: block;
    height: auto;
    margin-bottom: 12px;
    width: 142px;
}

.slogan {
    color: var(--azul);
    font-size: .82rem;
    font-style: italic;
    font-weight: 400;
}

.credencial-footer {
    align-items: flex-start;
    background: var(--azul);
    display: flex;
    flex-shrink: 0;
    height: var(--footer-height);
    justify-content: center;
    margin: 0 -42px -34px;
    position: relative;
}

.qr {
    background: #fff;
    border: 1px solid rgba(38, 52, 117, .32);
    box-shadow: 0 8px 22px rgba(15, 25, 70, .14);
    display: block;
    flex-shrink: 0;
    height: var(--qr-size);
    margin-top: calc(var(--qr-lift) * -1);
    padding: var(--qr-padding);
    width: var(--qr-size);
}

.qr img {
    display: block;
    height: 100%;
    width: 100%;
}

.lista-contactos {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.lista-contactos a {
    background: var(--azul);
    border-radius: 999px;
    color: #fff;
    display: block;
    font-weight: 700;
    padding: 13px 18px;
    text-align: center;
}

@media (max-width: 520px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    .credencial-shell {
        width: 100%;
    }

    .credencial {
        border: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100svh;
        --footer-height: clamp(64px, 17vw, 78px);
        --qr-clearance: clamp(14px, 4vw, 22px);
        --qr-lift: clamp(34px, 10vw, 42px);
        --qr-padding: clamp(6px, 1.8vw, 8px);
        --qr-size: clamp(78px, 22vw, 94px);
    }

    .credencial-body {
        display: flex;
        flex: 1;
        flex-direction: column;
        padding: 0 clamp(20px, 6vw, 28px) 26px;
    }

    .credencial-header {
        height: clamp(108px, 31vw, 138px);
    }

    .foto-marco {
        height: clamp(112px, 34vw, 140px);
        margin-bottom: clamp(14px, 4vw, 20px);
        margin-top: clamp(-70px, -17vw, -56px);
        padding: 5px;
        width: clamp(112px, 34vw, 140px);
    }

    .nombre {
        font-size: clamp(1.42rem, 7vw, 1.88rem);
    }

    .cargo {
        font-size: clamp(.94rem, 4.2vw, 1.13rem);
        margin: 6px 0 clamp(14px, 4.2vw, 20px);
    }

    .acciones {
        gap: 12px;
    }

    .accion {
        height: clamp(36px, 10vw, 42px);
        width: clamp(36px, 10vw, 42px);
    }

    .accion svg {
        height: clamp(18px, 5vw, 21px);
        width: clamp(18px, 5vw, 21px);
    }

    .guardar-contacto {
        font-size: clamp(.9rem, 3.7vw, 1rem);
        margin-bottom: clamp(18px, 6vw, 34px);
        min-width: min(210px, 100%);
        padding: clamp(11px, 3.4vw, 14px) 24px;
    }

    .datos {
        gap: clamp(12px, 4vw, 18px);
        margin-bottom: clamp(18px, 7vw, 34px);
        max-width: 100%;
    }

    .dato {
        gap: 16px;
        grid-template-columns: 38px 1fr;
    }

    .dato-icono svg {
        height: 30px;
        width: 30px;
    }

    .marca {
        margin-bottom: calc(var(--qr-lift) + var(--qr-clearance));
    }

    .marca img {
        width: clamp(112px, 34vw, 142px);
    }

    .slogan {
        font-size: clamp(.73rem, 3.4vw, .82rem);
    }

    .credencial-footer {
        margin-left: calc(clamp(20px, 6vw, 28px) * -1);
        margin-right: calc(clamp(20px, 6vw, 28px) * -1);
    }

}

@media (max-width: 340px) {
    .credencial-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .acciones {
        gap: 8px;
    }

    .accion {
        height: 38px;
        width: 38px;
    }

    .dato {
        gap: 12px;
    }

    .credencial-footer {
        margin-left: -20px;
        margin-right: -20px;
    }
}

@media (max-width: 520px) and (max-height: 780px) {
    .credencial {
        --footer-height: 58px;
        --qr-clearance: 14px;
        --qr-lift: 28px;
        --qr-padding: 6px;
        --qr-size: 72px;
    }

    .credencial-header {
        height: 96px;
    }

    .foto-marco {
        height: 104px;
        margin-bottom: 12px;
        margin-top: -52px;
        width: 104px;
    }

    .nombre {
        font-size: clamp(1.28rem, 6vw, 1.62rem);
    }

    .cargo {
        font-size: .88rem;
        margin-bottom: 12px;
    }

    .acciones {
        gap: 9px;
        margin-bottom: 10px;
    }

    .accion {
        height: 34px;
        width: 34px;
    }

    .accion svg {
        height: 17px;
        width: 17px;
    }

    .guardar-contacto {
        margin-bottom: 14px;
        padding-bottom: 11px;
        padding-top: 11px;
    }

    .datos {
        gap: 10px;
        margin-bottom: 16px;
    }

    .dato {
        gap: 10px;
        grid-template-columns: 30px 1fr;
    }

    .dato-icono svg {
        height: 24px;
        width: 24px;
    }

    .dato-etiqueta {
        font-size: .7rem;
    }

    .dato-valor {
        font-size: .78rem;
    }

    .marca {
        margin-bottom: calc(var(--qr-lift) + var(--qr-clearance));
    }

    .marca img {
        margin-bottom: 7px;
        width: 104px;
    }

    .slogan {
        font-size: .72rem;
    }

}

@media (max-width: 380px) and (max-height: 620px) {
    .credencial {
        --qr-clearance: 12px;
        --qr-lift: 24px;
        --qr-size: 68px;
    }

    .credencial-body {
        padding-bottom: 20px;
    }

    .credencial-header {
        height: 86px;
    }

    .foto-marco {
        height: 92px;
        margin-bottom: 10px;
        margin-top: -46px;
        width: 92px;
    }

    .cargo {
        margin-bottom: 10px;
    }

    .guardar-contacto {
        margin-bottom: 12px;
    }

    .marca img {
        width: 96px;
    }

}
