/* ============================================================
   Estilos del marbete (marbete.php) y de la selfie (registro.html)
   ============================================================ */

/* ---------- Selfie en el formulario de registro ---------- */
.selfie {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.selfie-visor {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3 / 4;
    background: #1b1b1b;
    border-radius: 12px;
    overflow: hidden;
}

.selfie-visor video,
.selfie-visor img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selfie-visor video {
    transform: scaleX(-1); /* vista tipo espejo; la foto guardada no se voltea */
}

.selfie-estado {
    margin: 0;
    text-align: center;
    color: var(--texto-suave);
}

.selfie-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.boton.secundario {
    background: #fff;
    color: var(--guinda);
    border: 2px solid var(--guinda);
}

.boton.secundario:hover {
    background: #f3e6ec;
}

[hidden] {
    display: none !important;
}

/* ---------- Página del marbete ---------- */
.pagina-marbete {
    margin: 0;
    padding: 1.5rem 1rem 3rem;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background: #dfe3ea;
    color: #1d2f63;
}

.pagina-marbete .barra {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.pagina-marbete .barra h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.pagina-marbete .barra p {
    margin: 0 0 1rem;
}

.pagina-marbete .barra .boton {
    margin: 0.25rem;
}

.tarjetones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

/* ---------- Tarjetón (formato colgador) ---------- */
.tarjeton {
    position: relative;
    width: 300px;
    height: 560px;
    border: 3px solid #1d2f63;
    border-radius: 150px 150px 34px 34px;
    background: linear-gradient(135deg, #eceef1 0%, #b7bac2 45%, #f4f5f7 62%, #a9acb5 100%);
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.orificio {
    position: absolute;
    top: 38px;
    left: 50%;
    width: 150px;
    height: 150px;
    margin-left: -75px;
    border: 3px solid #1d2f63;
    border-radius: 50%;
    background: #dfe3ea; /* mismo color que el fondo de la página */
}

/* Frente */
.frente-contenido {
    position: absolute;
    inset: 215px 0 0;
    padding: 0 20px 20px;
}

.frente-contenido p {
    margin: 0;
}

.sigla {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.titulo {
    margin-top: 0.5rem !important;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.banda {
    margin: 0 -20px !important;
    padding: 0.4rem 20px;
    font-weight: 700;
    font-size: 1rem;
}

.banda-clara {
    margin-top: 1rem !important;
    background: #fff;
}

.banda-oscura {
    background: linear-gradient(90deg, #9fa2ab, #d8dae0);
}

.frente-datos {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 0.9rem;
    color: #111;
    font-weight: 700;
}

.frente-datos span {
    font-weight: 600;
}

.frente-datos p {
    margin-bottom: 0.3rem !important;
    font-size: 0.95rem;
}

.frente-datos .nombre {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.foto {
    width: 96px;
    height: 128px;
    object-fit: cover;
    border: 3px solid #1d2f63;
    border-radius: 8px;
    background: #fff;
}

/* Vuelta */
.vuelta {
    border-color: #1d2f63;
    box-shadow: inset 0 0 0 10px #1d2f63;
}

.vuelta-contenido {
    position: absolute;
    inset: 215px 0 0;
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
}

.folio-grande {
    margin: 0;
    padding: 0.35rem 0;
    background: #fff;
    color: #000;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.ficha {
    margin: 0.75rem 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.6rem;
    font-size: 0.78rem;
    color: #111;
}

.ficha dt {
    font-weight: 700;
}

.ficha dd {
    margin: 0;
}

.reglas {
    margin: 0.75rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.72rem;
    color: #111;
    line-height: 1.35;
}

.pie {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.pie-sigla {
    font-size: 1.2rem;
    font-weight: 800;
}

.firma {
    flex: 1;
    border-top: 1px solid #1d2f63;
    font-size: 0.65rem;
    text-align: center;
    color: #3a4660;
}

/* ---------- Impresión ---------- */
@media print {
    .no-imprimir {
        display: none !important;
    }

    .pagina-marbete {
        padding: 0;
        background: #fff;
    }

    .orificio {
        background: #fff;
    }

    .tarjetones {
        gap: 10mm;
    }

    .tarjeton {
        break-inside: avoid;
    }
}

/* Cámara trasera: sin efecto espejo */
.selfie-visor video.sin-espejo {
    transform: none;
}
