/* Formulario publico de preinscripcion (pagina del evento e iframe) */
.pri-form {
    --pri-brand: #022F96;
    --pri-brand-hover: #0338b0;
    --pri-brand-soft: rgba(2, 47, 150, .07);
    --pri-brand-ring: rgba(2, 47, 150, .14);
    --pri-on-brand: #fff;
    --pri-ink: #1c1c1e;
    --pri-muted: #6c6c74;
    --pri-line: rgba(0, 0, 0, .1);
    --pri-field: rgba(0, 0, 0, .16);
    --pri-surface: #fff;
    --pri-subtle: #f6f7f9;
    --pri-danger: #c62828;
    --pri-danger-soft: rgba(198, 40, 40, .08);
    --pri-notice: #fff8e6;
    --pri-notice-line: #f3d48a;
    --pri-notice-ink: #7a4d00;
    font-family: "GreyCliffRegular", sans-serif;
    color: var(--pri-ink);
    min-width: 0;
}
.pri-form.pri-dark {
    --pri-brand: #f1f2f3;
    --pri-brand-hover: #fff;
    --pri-brand-soft: rgba(255, 255, 255, .1);
    --pri-brand-ring: rgba(255, 255, 255, .2);
    --pri-on-brand: #0B0C10;
    --pri-ink: #f5f5f7;
    --pri-muted: #a8a8b0;
    --pri-line: rgba(255, 255, 255, .14);
    --pri-field: rgba(255, 255, 255, .24);
    --pri-surface: #16171d;
    --pri-subtle: #1f2028;
    --pri-danger: #ff8a80;
    --pri-danger-soft: rgba(255, 138, 128, .12);
    --pri-notice: rgba(243, 212, 138, .1);
    --pri-notice-line: rgba(243, 212, 138, .35);
    --pri-notice-ink: #f3d48a;
}
.pri-form *, .pri-form *::before, .pri-form *::after { box-sizing: border-box; }
.pri-form [hidden] { display: none !important; }
.pri-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Bloques */
.pri-section {
    background: var(--pri-surface);
    border: 1px solid var(--pri-line);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
}
.pri-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.pri-step {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pri-brand-soft);
    color: var(--pri-brand);
    font-family: "BalooBold", sans-serif;
    font-size: .88rem;
    line-height: 1;
}
.pri-section-title {
    margin: 0;
    font-family: "BalooBold", sans-serif;
    font-size: 1.08rem;
    font-weight: normal;
    line-height: 1.25;
    color: var(--pri-ink);
}

/* Campos */
.pri-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.pri-field { min-width: 0; }
.pri-field-full { grid-column: 1 / -1; }
.pri-label {
    display: block;
    margin: 0 0 6px;
    font-family: "GreyCliffBold", sans-serif;
    font-size: .84rem;
    line-height: 1.3;
    color: var(--pri-ink);
}
.pri-req { color: var(--pri-danger); }
.pri-control { position: relative; }
.pri-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: var(--pri-muted);
    fill: currentColor;
    pointer-events: none;
}
.pri-form .pri-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px 0 42px;
    background: var(--pri-surface);
    border: 1px solid var(--pri-field);
    border-radius: 12px;
    outline: none;
    box-shadow: none;
    font-family: "GreyCliffRegular", sans-serif;
    font-size: 1rem;
    color: var(--pri-ink);
    transition: border-color .15s, box-shadow .15s;
}
.pri-form .pri-input::placeholder { color: var(--pri-muted); opacity: .75; }
.pri-form .pri-input:focus {
    border-color: var(--pri-brand);
    box-shadow: 0 0 0 3px var(--pri-brand-ring);
}
.pri-form select.pri-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%236c6c74'%3E%3Cpath d='M1.6 4.6a.75.75 0 0 1 1.06 0L8 9.94l5.34-5.34a.75.75 0 1 1 1.06 1.06l-5.87 5.87a.75.75 0 0 1-1.06 0L1.6 5.66a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
/* En iOS un campo de fecha vacio pierde la altura si conserva su aspecto nativo */
.pri-form input[type="date"].pri-input {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    text-align: left;
    line-height: 46px;
}
.pri-form input[type="date"].pri-input::-webkit-date-and-time-value { text-align: left; }
.pri-dark input[type="date"].pri-input { color-scheme: dark; }
.pri-error {
    display: none;
    margin: 6px 0 0;
    font-size: .78rem;
    line-height: 1.35;
    color: var(--pri-danger);
}
.pri-field.is-invalid .pri-error,
.pri-group.is-invalid .pri-error { display: block; }
.pri-form .pri-field.is-invalid .pri-input { border-color: var(--pri-danger); }
.pri-form .pri-field.is-invalid .pri-input:focus { box-shadow: 0 0 0 3px var(--pri-danger-soft); }

/* Tarjetas de eleccion: entradas y metodos de pago */
.pri-options { display: grid; gap: 10px; }
.pri-options-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pri-option { display: block; margin: 0; cursor: pointer; }
.pri-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.pri-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 12px 14px;
    background: var(--pri-surface);
    border: 1px solid var(--pri-field);
    border-radius: 12px;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pri-option:hover .pri-option-card { border-color: var(--pri-brand); }
.pri-option-dot {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--pri-field);
    border-radius: 50%;
    transition: border-color .15s;
}
.pri-option-dot::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--pri-brand);
    transform: scale(0);
    transition: transform .15s;
}
.pri-option input:checked + .pri-option-card {
    border-color: var(--pri-brand);
    background: var(--pri-brand-soft);
    box-shadow: inset 0 0 0 1px var(--pri-brand);
}
.pri-option input:checked + .pri-option-card .pri-option-dot { border-color: var(--pri-brand); }
.pri-option input:checked + .pri-option-card .pri-option-dot::after { transform: scale(1); }
.pri-option input:focus-visible + .pri-option-card { box-shadow: 0 0 0 3px var(--pri-brand-ring); }
/* Sin entradas a la venta: aviso en el paso 1 y el resto apagado */
.pri-lock { border: 0; margin: 0; padding: 0; min-width: 0; }
.pri-lock:disabled { opacity: .45; filter: grayscale(1); pointer-events: none; user-select: none; }
.pri-empty {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px dashed var(--pri-field);
    border-radius: 14px;
    background: var(--pri-subtle);
}
.pri-empty-ico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--pri-brand-soft);
    color: var(--pri-brand);
}
.pri-empty-ico svg { width: 20px; height: 20px; fill: currentColor; }
.pri-empty-title {
    margin: 0 0 4px;
    font-family: "BalooBold", sans-serif;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--pri-ink);
}
.pri-empty-text { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--pri-muted); }
.pri-option input:disabled + .pri-option-card {
    opacity: .5;
    cursor: not-allowed;
    border-color: var(--pri-line);
    background: var(--pri-subtle);
}
.pri-option-body { flex: 1; min-width: 0; }
.pri-option-name {
    display: block;
    font-family: "GreyCliffBold", sans-serif;
    font-size: .95rem;
    line-height: 1.3;
    color: var(--pri-ink);
    overflow-wrap: anywhere;
}
.pri-option-desc {
    display: block;
    margin-top: 2px;
    font-size: .8rem;
    line-height: 1.35;
    color: var(--pri-muted);
    overflow-wrap: anywhere;
}
.pri-option-desc:empty { display: none; }
.pri-option-price {
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}
.pri-option-price b {
    display: block;
    font-family: "BalooBold", sans-serif;
    font-size: 1.05rem;
    font-weight: normal;
    line-height: 1.2;
    color: var(--pri-ink);
}
.pri-option-price small {
    display: block;
    font-size: .72rem;
    color: var(--pri-muted);
}
.pri-option-price small:empty { display: none; }
.pri-group .pri-error { margin-top: 8px; }

/* Codigo promocional */
.pri-promo { margin-top: 16px; }
.pri-promo-row {
    display: flex;
    gap: 10px;
}
.pri-promo-row .pri-control { flex: 1; min-width: 0; }
.pri-promo-btn {
    flex-shrink: 0;
    height: 48px;
    min-width: 104px;
    padding: 0 18px;
    background: transparent;
    border: 1px solid var(--pri-brand);
    border-radius: 12px;
    color: var(--pri-brand);
    font-family: "GreyCliffBold", sans-serif;
    font-size: .9rem;
    cursor: pointer;
    transition: background-color .15s;
}
.pri-promo-btn:hover { background: var(--pri-brand-soft); }
.pri-promo-btn:disabled { opacity: .6; cursor: wait; }
.pri-promo-msg {
    margin: 6px 0 0;
    font-size: .78rem;
    line-height: 1.35;
    color: var(--pri-muted);
}
.pri-promo-msg:empty { display: none; }
.pri-promo-msg.is-error { color: var(--pri-danger); }

/* Mayoria de edad */
.pri-form .pre-form-box {
    margin: 0 0 14px !important;
    padding: 14px 16px;
    background: var(--pri-surface);
    border: 1px solid var(--pri-line);
    border-radius: 12px;
    font-size: .9rem;
    color: var(--pri-ink);
}
.pri-form .pre-form-box input { accent-color: var(--pri-brand); }

/* Resumen */
.pri-summary {
    background: var(--pri-subtle);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.pri-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    font-size: .9rem;
    color: var(--pri-muted);
}
.pri-summary-row strong {
    font-family: "GreyCliffBold", sans-serif;
    font-weight: normal;
    color: var(--pri-ink);
    white-space: nowrap;
}
.pri-summary-discount strong { color: #1b7f4b; }
.pri-dark .pri-summary-discount strong { color: #7ddba8; }
.pri-summary-total {
    align-items: baseline;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--pri-line);
    font-family: "BalooBold", sans-serif;
    font-size: 1.05rem;
    color: var(--pri-ink);
}
.pri-summary-total strong {
    font-family: "BalooBold", sans-serif;
    font-size: 1.5rem;
    color: var(--pri-brand);
}

/* Aviso de retencion */
.pri-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: var(--pri-notice);
    border: 1px solid var(--pri-notice-line);
    border-radius: 12px;
    color: var(--pri-notice-ink);
}
.pri-notice svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; fill: currentColor; }
.pri-notice-title {
    margin: 0 0 3px;
    font-family: "GreyCliffBold", sans-serif;
    font-size: .88rem;
    color: inherit;
}
.pri-notice-text {
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
    color: inherit;
}

/* Error general y boton */
.pri-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--pri-danger-soft);
    border-radius: 12px;
    font-size: .86rem;
    line-height: 1.4;
    color: var(--pri-danger);
}
.pri-alert:empty { display: none; }
.pri-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    background: var(--pri-brand);
    border: 0;
    border-radius: 12px;
    color: var(--pri-on-brand);
    font-family: "BalooBold", sans-serif;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color .15s;
}
.pri-submit:hover { background: var(--pri-brand-hover); }
.pri-submit:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pri-brand-ring); }
.pri-submit:disabled { opacity: .7; cursor: wait; }
.pri-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: pri-spin .7s linear infinite;
}
@keyframes pri-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .pri-section { padding: 16px; }
    .pri-grid { grid-template-columns: minmax(0, 1fr); }
    .pri-field-full { grid-column: auto; }
    .pri-options-inline { grid-template-columns: minmax(0, 1fr); }
    .pri-promo-btn { min-width: 88px; padding: 0 14px; }
    .pri-group .pri-option-card { flex-wrap: wrap; }
    .pri-option-body { flex-basis: calc(100% - 30px); }
    .pri-option-price {
        display: flex;
        flex-basis: 100%;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        gap: 2px 10px;
        padding-left: 30px;
        text-align: left;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pri-form * { transition: none !important; }
    .pri-spinner { animation-duration: 1.6s; }
}
