/* =========================================================
   GCEC CAPTCHA - REPRESENTACIÓN VISUAL
   Basado en Captcha(2).png
   ========================================================= */

:root {
    --blue-dark: #062d63;
    --blue: #176db4;
    --blue-button: #347fbd;
    --blue-panel: #e7f4fc;
    --text: #082e68;

    --red: #ef3030;
    --blue-tile: #0874e8;
    --green: #16a45a;
    --yellow: #ffc21b;
    --purple: #8250d0;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: #0b477e;
}

.security-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            #0a4b82 0%,
            #3e83ad 17%,
            #dcecf8 31%,
            #dcecf8 84%,
            #0b3c6b 100%
        );
}

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

.top-banner {
    position: relative;
    width: 100%;
    height: 250px;
    min-height: 250px;
    overflow: hidden;
    flex-shrink: 0;
}

.header-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/captcha-header.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* =========================
   MAIN
   ========================= */

.content {
    position: relative;
    z-index: 2;
    width: min(1195px, calc(100% - 70px));
    margin: 20px auto 22px;
    flex: 1 0 auto;
}

.captcha-panel {
    width: 100%;
    min-height: auto;
    padding: 25px 40px 25px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.98),
            rgba(246,251,254,.98)
        );

    border: 1px solid rgba(255,255,255,.98);
    border-radius: 18px;

    box-shadow:
        0 5px 18px rgba(15, 58, 91, .22);
}

/* =========================
   TITLE
   ========================= */

.captcha-panel h1 {
    margin: 0;
    text-align: center;

    color: var(--text);

    font-size: clamp(38px, 4.1vw, 56px);
    line-height: 1.1;
    font-weight: 700;
}

.title-line {
    width: 78%;
    height: 2px;
    margin: 14px auto 17px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #a7bfd4 15%,
            #a7bfd4 85%,
            transparent
        );
}

/* =========================
   INSTRUCTION
   ========================= */

.instruction {
    margin: 0 auto 20px;
    text-align: center;

    color: var(--text);
    font-size: clamp(22px, 2.25vw, 32px);
    line-height: 1.25;
}

.instruction strong {
    font-weight: 800;
}

.target-rojo { color: var(--red); }
.target-azul { color: var(--blue-tile); }
.target-verde { color: var(--green); }
.target-amarillo { color: #eaaa00; }
.target-morado { color: var(--purple); }

/* =========================
   GRID 4 x 2
   ========================= */

.captcha-grid {
    width: min(760px, 100%);
    margin: 0 auto 27px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 31px;
}

.captcha-box {
    position: relative;
    display: block;

    aspect-ratio: 1 / .72;
    padding: 6px;

    border: 2px solid #cbdbe8;
    border-radius: 15px;
    background: #fff;

    box-shadow:
        0 3px 6px rgba(0, 0, 0, .15);

    cursor: pointer;

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

.captcha-box:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 10px rgba(0,0,0,.18);
}

.captcha-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.color-box {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.color-rojo { background: var(--red); }
.color-azul { background: var(--blue-tile); }
.color-verde { background: var(--green); }
.color-amarillo { background: var(--yellow); }
.color-morado { background: var(--purple); }

.captcha-box:has(input:checked) {
    border-color: #2674b3;
    box-shadow:
        0 0 0 4px rgba(52,127,189,.20),
        0 5px 11px rgba(0,0,0,.18);
    transform: translateY(-2px);
}

.captcha-box:has(input:checked)::after {
    content: "✓";

    position: absolute;
    top: 9px;
    right: 9px;

    width: 30px;
    height: 30px;

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

    border-radius: 50%;
    background: #fff;

    color: #176db4;
    font-size: 21px;
    font-weight: 700;

    box-shadow: 0 2px 5px rgba(0,0,0,.24);
}

/* =========================
   INFORMATION BAR
   ========================= */

.captcha-information {
    width: 100%;
    min-height: 126px;

    display: grid;
    grid-template-columns:
        1fr
        1px
        1fr
        1px
        1.35fr;

    align-items: center;

    padding: 18px 38px;

    background:
        linear-gradient(
            90deg,
            #e9f5fc,
            #e3f1fa
        );

    border: 2px solid #c5deef;
    border-radius: 14px;
}

.information-item {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.information-icon {
    flex: 0 0 auto;

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

    color: var(--text);
    font-size: 39px;
    line-height: 1;
}

.information-content {
    color: var(--text);
    font-size: 16px;
    line-height: 1.25;
}

.information-content strong {
    display: block;
    margin-top: 4px;
    font-size: 28px;
    line-height: 1.05;
}

.information-content small {
    display: block;
    max-width: 270px;
    margin-top: 5px;

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

.information-divider {
    width: 1px;
    height: 70px;
    background: #a9c4d8;
}

/* =========================
   MESSAGE
   ========================= */

.message {
    min-height: 30px;
    margin: 10px 0 0;

    text-align: center;

    color: #bd202d;
    font-size: 14px;
    font-weight: 700;
}

/* =========================
   BUTTON
   ========================= */

#verify-button {
    display: block;

    width: min(510px, 70%);
    height: 67px;

    margin: 0 auto;

    border: 0;
    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #3e86c4,
            #2f77b7
        );

    color: #fff;

    font-size: 25px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 4px 8px rgba(0,0,0,.18);

    transition:
        transform .12s ease,
        filter .12s ease;
}

#verify-button:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

#verify-button:disabled {
    background: #9caab5;
    cursor: not-allowed;
    transform: none;
}

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

.bottom-banner {
    position: relative;
    width: 100%;
    height: 199px;
    flex: 0 0 auto;
    overflow: hidden;

    background: #0a3b69;
}

.footer-background {
    position: absolute;
    inset: 0;

    background-image: url("../images/captcha-footer.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* =========================
   TABLET
   ========================= */

@media (max-width: 900px) {

    .content {
        width: calc(100% - 35px);
        margin-top: -4px;
    }

    .captcha-panel {
        padding: 30px 25px;
        min-height: auto;
    }

    .captcha-grid {
        gap: 12px 18px;
    }

    .captcha-information {
        padding: 15px 18px;
    }

    .information-item {
        gap: 9px;
    }

    .information-content {
        font-size: 13px;
    }

    .information-content strong {
        font-size: 22px;
    }

    .information-content small {
        font-size: 11px;
    }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 650px) {

    .top-banner {
        height: 130px;
    }

    .content {
        width: calc(100% - 18px);
        margin-top: -2px;
        margin-bottom: 10px;
    }

    .captcha-panel {
        padding: 24px 13px 27px;
        border-radius: 13px;
    }

    .captcha-panel h1 {
        font-size: 29px;
    }

    .instruction {
        font-size: 18px;
    }

    .captcha-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 95%;
    }

    .captcha-information {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .information-divider {
        width: 80%;
        height: 1px;
        margin: 0 auto;
    }

    .information-item {
        justify-content: flex-start;
    }

    #verify-button {
        width: 92%;
        height: 57px;
        font-size: 22px;
    }

    .bottom-banner {
        height: 125px;
    }
}

/* =========================================================
   GCEC CAPTCHA - DISEÑO FINAL COMPACTO Y CENTRADO
   ========================================================= */

/* Página completa */
.security-page {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-rows: 105px 1fr 58px;
    overflow: hidden;
}

/* =========================
   CABECERA
   ========================= */

.top-banner {
    width: 100%;
    height: 105px;
    min-height: 105px;
}

.header-background {
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-position: center center;
}

/* =========================
   CONTENIDO CENTRAL
   ========================= */

.content {
    width: min(900px, calc(100% - 30px));
    height: auto;
    margin: auto;
    padding: 0;
    flex: none;
}

/* =========================
   PANEL CAPTCHA
   ========================= */

.captcha-panel {
    width: 100%;
    min-height: 0;
    padding: 18px 28px 17px;
    border-radius: 14px;
}

/* =========================
   TÍTULO
   ========================= */

.captcha-panel h1 {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.05;
}

.title-line {
    width: 78%;
    height: 2px;
    margin: 7px auto 9px;
}

/* =========================
   INSTRUCCIÓN
   ========================= */

.instruction {
    margin: 0 auto 10px;
    font-size: clamp(17px, 1.7vw, 21px);
    line-height: 1.15;
}

/* =========================
   GRID 4 x 2
   ========================= */

.captcha-grid {
    width: min(560px, 100%);
    margin: 0 auto 11px;
    gap: 8px 14px;
}

.captcha-box {
    aspect-ratio: 1 / .68;
    padding: 5px;
    border-radius: 11px;
}

.color-box {
    border-radius: 7px;
}

.captcha-box:has(input:checked)::after {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 17px;
}

/* =========================
   BARRA DE INFORMACIÓN
   ========================= */

.captcha-information {
    min-height: 70px;
    padding: 8px 18px;
    border-radius: 10px;
}

.information-item {
    gap: 9px;
}

.information-icon {
    font-size: 27px;
}

.information-content {
    font-size: 12px;
    line-height: 1.15;
}

.information-content strong {
    margin-top: 2px;
    font-size: 19px;
    line-height: 1.05;
}

.information-content small {
    max-width: 210px;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.15;
}

.information-divider {
    height: 45px;
}

/* =========================
   MENSAJE
   ========================= */

.message {
    min-height: 20px;
    margin: 5px 0 0;
    font-size: 12px;
}

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

#verify-button {
    width: min(430px, 70%);
    height: 48px;
    margin: 0 auto;
    border-radius: 9px;
    font-size: 19px;
}

/* =========================
   PIE
   ========================= */

.bottom-banner {
    width: 100%;
    height: 58px;
    min-height: 58px;
}

.footer-background {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .security-page {
        grid-template-rows: 90px 1fr 52px;
    }

    .top-banner {
        height: 90px;
        min-height: 90px;
    }

    .content {
        width: min(760px, calc(100% - 24px));
    }

    .captcha-panel {
        padding: 16px 22px 15px;
    }

    .captcha-grid {
        width: min(520px, 100%);
    }

    .captcha-information {
        padding: 7px 12px;
    }

    .information-content {
        font-size: 11px;
    }

    .information-content strong {
        font-size: 17px;
    }

    .information-content small {
        font-size: 9px;
    }

    #verify-button {
        height: 45px;
        font-size: 18px;
    }

    .bottom-banner {
        height: 52px;
        min-height: 52px;
    }
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 650px) {

    .security-page {
        grid-template-rows: 75px 1fr 45px;
    }

    .top-banner {
        height: 75px;
        min-height: 75px;
    }

    .content {
        width: calc(100% - 12px);
    }

    .captcha-panel {
        padding: 13px 10px 12px;
        border-radius: 11px;
    }

    .captcha-panel h1 {
        font-size: 25px;
    }

    .title-line {
        margin: 5px auto 7px;
    }

    .instruction {
        margin-bottom: 8px;
        font-size: 16px;
    }

    .captcha-grid {
        width: 94%;
        gap: 7px 9px;
        margin-bottom: 9px;
    }

    .captcha-box {
        padding: 4px;
        border-radius: 9px;
    }

    .color-box {
        border-radius: 6px;
    }

    .captcha-information {
        min-height: 61px;
        padding: 6px 8px;
        grid-template-columns: 1fr 1px 1fr 1px 1.2fr;
        gap: 3px;
    }

    .information-item {
        gap: 5px;
    }

    .information-icon {
        font-size: 22px;
    }

    .information-content {
        font-size: 9px;
    }

    .information-content strong {
        font-size: 14px;
    }

    .information-content small {
        font-size: 7px;
        max-width: 130px;
    }

    .information-divider {
        height: 38px;
    }

    .message {
        min-height: 16px;
        margin-top: 3px;
        font-size: 10px;
    }

    #verify-button {
        width: 75%;
        height: 40px;
        font-size: 16px;
    }

    .bottom-banner {
        height: 45px;
        min-height: 45px;
    }
}
