/* =========================================================
   HOME - Consulta de títulos
   ========================================================= */

/* ------------------------------
   Variables (fácil de mantener)
------------------------------ */
:root {
    --color-primary: #0072CE;
    --color-text: #3c3c3c;
    --color-border: #d9d9d9;

    --color-success: #0F7B4D;
    --color-warn: #B45309;
    --color-info: #1F2937;
    --color-error: #B91C1C;

    --radius-sm: 6px;
    --radius-md: 10px;

    --shadow-soft: 0 2px 8px rgb(0 0 0 / .12);
    --color-delivered: #6D28D9;
}

/* ------------------------------
   Layout base
------------------------------ */
.container {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 0 1rem;
    background-color: #fff;
}

/* ------------------------------
   Títulos / textos
------------------------------ */
.title {
    font-size: clamp(1.4rem, 2.3vw, 2.5rem);
    text-align: center;
    margin: 10px auto;
    max-width: 850px;
    font-weight: 500;
    text-wrap: balance;
}

.subtitles {
    margin: 2rem auto 0 auto;
    max-width: 1100px;
    padding-left: 4rem;
}

.subtitle {
    font-size: clamp(.7rem, 2vw, 1.5rem);
    max-width: 1000px;
    text-wrap: pretty;
    font-weight: lighter;
}

.subtitle:nth-child(2) {
    margin-top: 2rem;
}

/* ------------------------------
   Formulario
------------------------------ */
.section-form {
    margin-top: 2.3rem;
}

.form-title {
    font-size: clamp(1rem, 1.8vw, 2rem);
    color: var(--color-primary);
    text-align: center;
    margin: 0 auto;
    font-weight: 500;
}

.form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
}

.form-label {
    color: var(--color-text);
    font-size: clamp(.85rem, 1.1vw, 1.3rem);
    margin-bottom: .5rem;
}

.form-input {
    width: 360px;
    max-width: 100%;
    height: 44px;

    color: var(--color-text);
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    font-size: clamp(.85rem, 1.1vw, 1.3rem);
    padding: 0 1rem;

    outline: none;
}

.form-input:focus {
    border-color: rgba(0, 114, 206, 0.55);
    box-shadow: rgba(50, 151, 211, .18) 0 0 0 4px;
}

.form-button {
    width: 100%;
    max-width: 200px;
    height: 44px;

    backface-visibility: hidden;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    border: 0;

    color: #fff;
    cursor: pointer;
    font-size: clamp(.85rem, 1.1vw, 1.3rem);

    outline: none;
    overflow: hidden;
    padding: 0 25px;
    text-align: center;
}

.form-button:disabled {
    cursor: default;
    opacity: .85;
}

.form-button:focus {
    box-shadow:
        rgba(50, 50, 93, .1) 0 0 0 1px inset,
        rgba(50, 50, 93, .2) 0 6px 15px 0,
        rgba(0, 0, 0, .1) 0 2px 2px 0,
        rgba(50, 151, 211, .3) 0 0 0 4px;
}

/* ------------------------------
   Errores
------------------------------ */
.form-error {
    margin-top: .5rem;
    color: var(--color-error);
    font-size: clamp(.8rem, 1vw, 1.05rem);
}

.result-ok,
.result-warn,
.result-info {
    margin: 0;
    font-weight: 600;
    font-size: clamp(.95rem, 1.2vw, 1.25rem);
}

.result-ok {
    color: var(--color-success);
}

.result-warn {
    color: var(--color-warn);
}

.result-info {
    color: var(--color-info);
}

.result-date {
    margin-top: .35rem;
    color: var(--color-text);
    font-size: clamp(.85rem, 1.05vw, 1.1rem);
}

/* ------------------------------
   Responsive
------------------------------ */
@media screen and (max-width: 900px) {
    .container {
        margin-top: 1rem;
        padding: 0 2rem 2rem 2rem;
    }

    .subtitles {
        margin-bottom: .5rem;
        padding-left: 0;
        margin-top: 1rem;
    }

    .subtitle:nth-child(2) {
        margin-top: 1rem;
    }
}

/* =========================================================
   MODAL - Resultado de la consulta (pantalla grande)
   ========================================================= */

.modal-open {
    overflow: hidden;
}

/* Fondo oscuro */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

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

    padding: 0;
    background: rgba(0, 0, 0, 0.6);
}

/* Caja grande (casi toda la pantalla) */
.modal-card {
    width: min(980px, calc(100vw - 24px));
    height: min(720px, calc(100vh - 24px));

    background: #fff;
    border-radius: 18px;
    border: 2px solid var(--color-border);
    box-shadow: 0 18px 60px rgb(0 0 0 / .25);

    padding: 1.25rem;
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    animation: modalIn 160ms ease-out;
}

@keyframes modalIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botón X */
.modal-close {
    position: absolute;
    top: .8rem;
    right: .8rem;

    width: 44px;
    height: 44px;

    border: 0;
    border-radius: 12px;
    background: transparent;

    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #111;
}

.modal-close:hover {
    background: rgba(0, 0, 0, .06);
}

/* Contenido centrado */
.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    padding: 1.5rem 1rem;
}

/* Ícono grande */
.modal-icon {
    width: 120px;
    height: 120px;
    border-radius: 999px;

    display: grid;
    place-items: center;

    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.modal-icon--delivered {
    color: var(--color-delivered);
    background: rgba(109, 40, 217, 0.10);
    border: 3px solid rgba(109, 40, 217, 0.22);
}

.modal-title--delivered {
    color: var(--color-delivered);
}

.modal-icon--ok {
    color: var(--color-success);
    background: rgba(15, 123, 77, 0.10);
    border: 3px solid rgba(15, 123, 77, 0.25);
}

/* 🔁 warn = ROJO (para "sin registro") */
.modal-icon--warn {
    color: #B91C1C;
    background: rgba(185, 28, 28, 0.08);
    border: 3px solid rgba(185, 28, 28, 0.22);
}

/* 🔁 info = AZUL (para "registrado pero no disponible") */
.modal-icon--info {
    color: var(--color-primary);
    background: rgba(0, 114, 206, 0.10);
    border: 3px solid rgba(0, 114, 206, 0.22);
}

/* Texto */
.modal-title {
    margin: 0 0 .75rem 0;
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    font-weight: 800;
}

.modal-title--ok {
    color: var(--color-success);
}

/* 🔁 warn = ROJO */
.modal-title--warn {
    color: #B91C1C;
}

/* 🔁 info = AZUL */
.modal-title--info {
    color: var(--color-primary);
}

.modal-text {
    margin: 0 auto;
    max-width: 720px;
    color: var(--color-text);
    font-size: clamp(1.05rem, 1.3vw, 1.4rem);
}

.modal-date {
    margin-top: 1rem;
    color: var(--color-text);
    font-size: clamp(1.05rem, 1.2vw, 1.35rem);
}

/* Botón Entendido (abajo) */
.modal-button {
    width: 80%;
    height: 60px;
    margin: auto;

    border: 0;
    border-radius: 12px;
    background: var(--color-primary);
    color: #fff;

    cursor: pointer;
    font-size: clamp(1.05rem, 1.2vw, 1.35rem);
    font-weight: 700;
}

.modal-button:focus {
    box-shadow: rgba(50, 151, 211, .35) 0 0 0 4px;
    outline: none;
}

/* En pantallas pequeñas, que no se sienta gigante */
@media (max-width: 520px) {
    .modal-card {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        border-radius: 14px;
    }

    .modal-icon {
        width: 96px;
        height: 96px;
        font-size: 3.25rem;
    }
}

/* Link / botón dentro del modal */
.modal-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;

    width: 60%;
    height: 46px;
    margin: auto;

    border-radius: var(--radius-sm);
    border: 2px solid rgba(0, 114, 206, 0.25);

    background: rgba(0, 114, 206, 0.08);
    color: #0b3a63;

    text-decoration: none;
    font-weight: 700;
    font-size: clamp(.95rem, 1.1vw, 1.15rem);
}

.modal-link:hover {
    background: rgba(0, 114, 206, 0.12);
    border-color: rgba(0, 114, 206, 0.35);
}

.modal-link:focus {
    outline: none;
    box-shadow: rgba(50, 151, 211, .35) 0 0 0 4px;
}

/* Iconito simple con CSS (opcional) */
.modal-link-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 4px;
    background: rgba(0, 114, 206, 0.25);
    position: relative;
}

.modal-link-icon::after {
    content: "";
    position: absolute;
    inset: 4px 5px 6px 5px;
    border: 2px solid rgba(0, 114, 206, 0.75);
    border-top: 0;
    border-left: 0;
    transform: rotate(-45deg);
}
