/*
 * Registro — marca Grupo Vanguardia, mobile first.
 * Lienzo #f4f5f7, tarjeta blanca, texto #212529 / secundario #6c757d,
 * acento #1a1a1a (hover #2a2a2a), bordes #adb5bd, campos #eef0f3. Montserrat.
 * Base = teléfono (una columna, controles altos, campos de 16px para que
 * iOS no haga zoom). Desde 768px la tarjeta se centra con ancho máximo.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    background: #f4f5f7;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
}

.container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 24px 16px;
    width: 100%;
    max-width: 480px;
    margin: auto 0;
}

button {
    font-family: inherit;
    touch-action: manipulation;
}

/* ---------- Marca ---------- */
.marca {
    display: block;
    width: 152px;
    height: 36px;
    margin: 0 auto 20px;
    background: #1a1a1a;
    -webkit-mask: url("assets/grupo-vanguardia-logo.png") center / contain no-repeat;
    mask: url("assets/grupo-vanguardia-logo.png") center / contain no-repeat;
}

h1 {
    color: #212529;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.subtitulo {
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    margin: -12px 0 20px;
    overflow-wrap: anywhere;
}

.estado-carga {
    color: #6c757d;
    text-align: center;
    padding: 16px 0;
}

/* ---------- Registro cerrado ---------- */
.aviso-cerrado {
    background: #eef0f3;
    border-left: 4px solid #1a1a1a;
    padding: 20px 16px;
    color: #212529;
}

.aviso-cerrado h2 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.aviso-cerrado p {
    overflow-wrap: anywhere;
}

/* ---------- Formulario ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: #eef0f3;
    color: #212529;
    font: inherit;
    font-size: 16px;
}

.form-group select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    text-overflow: ellipsis;
}

.form-group input:focus,
.form-group select:focus {
    outline: 2px solid #adb5bd;
    outline-offset: 0;
}

.error-form {
    color: #b02a37;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}

/* ---------- Botones ---------- */
.btn-submit,
.btn-download,
.btn-new {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 20px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.btn-submit,
.btn-new {
    background: #1a1a1a;
    color: #fff;
    border: 0;
}

.btn-submit:hover:not(:disabled),
.btn-new:hover {
    background: #2a2a2a;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-download {
    background: #fff;
    color: #212529;
    border: 1px solid #adb5bd;
    margin-top: 16px;
}

.btn-download:hover {
    background: #f4f5f7;
}

.btn-new {
    margin-top: 12px;
}

/* ---------- Confirmación y QR ---------- */
.confirmation-card {
    background: #f4f5f7;
    padding: 16px;
    margin: 16px 0;
}

.ticket-info h3 {
    color: #212529;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.ticket-info p {
    margin: 8px 0;
    color: #6c757d;
    overflow-wrap: anywhere;
}

.ticket-info strong {
    color: #212529;
    font-weight: 600;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #adb5bd;
}

/* El QR ocupa el ancho disponible (con tope para escritorio) */
#qrCode {
    width: 100%;
    max-width: 320px;
    margin: 4px 0;
}

#qrCode img {
    display: block;
    width: 100% !important;
    height: auto !important;
    image-rendering: pixelated;
}

/* ---------- Pie ---------- */
.pie {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0 4px;
}

.pie a {
    color: #6c757d;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 6px 8px;
}

.pie a:hover {
    color: #212529;
}

/* ---------- Escritorio: la tarjeta se centra y no se estira ---------- */
@media (min-width: 768px) {
    body {
        padding: 24px;
    }

    .container {
        padding: 40px;
    }

    .form-group input,
    .form-group select {
        height: 44px;
        padding: 0 12px;
        font-size: 14px;
    }

    .form-group select {
        padding-right: 40px;
    }

    .btn-submit,
    .btn-download,
    .btn-new {
        height: 44px;
    }

    .confirmation-card {
        padding: 24px;
    }
}
