/* ============================================================
   OPEN CALL — /apply, con el diseño limpio (css/clean.css)
   ============================================================ */

.apply {
    max-width: 900px;
    margin-top: 112px;
}

.apply-intro,
.apply .apply-note {
    margin-top: 32px;
}

.apply-intro p + p {
    margin-top: 0;
}

.apply-en { color: var(--black); }

/* Intro: el español debajo, en gris */
.apply-intro-es {
    display: block;
    margin-top: 6px;
}

/* Textos grandes: líneas de largo parecido, sin una palabra suelta al final */
.apply-label .apply-en,
.apply h1,
.apply-thanks .t-big,
.site-header {
    text-wrap: balance;
}
.apply-es { color: var(--light); }

.btn .apply-en { color: inherit; }

.apply-form {
    margin-top: 48px;
}

.apply-form.is-sending {
    opacity: 0.5;
    pointer-events: none;
}

.apply-field {
    display: block;
    min-width: 0;
    margin: 0 0 56px;
    padding: 0;
    border: 0;
}

/* .apply delante: si no, el margin: 0 de los p de clean.css gana */
.apply .apply-label {
    display: block;
    margin: 0 0 12px;
    padding: 0;
}

/* Etiqueta: inglés en grande y debajo el español, pequeño y en gris */
.apply-label .apply-en {
    display: block;
    font-size: var(--fs-big);
}

.apply-label .apply-es {
    display: block;
    margin-top: 6px;
}

.apply-hint .apply-es {
    display: block;
    margin-top: 4px;
}

.apply-hint {
    display: block;
    margin-bottom: 12px;
}

.apply-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Sin estado de foco ni hover: el borde no cambia */
.apply input[type="text"],
.apply input[type="email"],
.apply input[type="number"] {
    display: block;
    width: 100%;
    padding: 4px 0;
    border: 0;
    border-bottom: 2px solid var(--black);
    border-radius: 0;
    background: transparent;
    color: var(--black);
    font: inherit;
    font-size: var(--fs);
    line-height: 1.25;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* País: lista de sugerencias bajo el campo */
.apply-country {
    position: relative;
}

/* El nombre del país sí va en minúsculas, como la lista (el resto de
   campos muestran lo que escribe cada cual tal cual) */
.apply #apply-country {
    text-transform: lowercase;
}

.apply-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 320px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: 2px solid var(--black);
    border-top: 0;
    background: var(--sheet);
    list-style: none;
}

.apply-suggest[hidden] {
    display: none;
}

.apply-suggest li {
    padding: 6px 8px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.apply-suggest li:hover,
.apply-suggest li.is-active {
    background: var(--black);
    color: var(--sheet);
}

.apply textarea {
    display: block;
    width: 100%;
    padding: 6px;
    border: 2px solid var(--black);
    border-radius: 0;
    background: transparent;
    color: var(--black);
    font: inherit;
    font-size: var(--fs);
    line-height: 1.25;
    outline: 0;
    resize: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Cantidad de títulos por tipo */
/* Cantidades: 7 tipos y el total, en 4 columnas (2 en móvil) */
.apply-qty {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 24px;
}

.apply-qty label,
.apply-total span {
    display: block;
    margin-bottom: 6px;
}

.apply-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.apply .apply-stepper input {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-big);   /* a juego con − + y el total */
    text-align: center;
    -moz-appearance: textfield;
}

/* Sin las flechas del navegador: van − y + con la tipografía */
.apply input[type="number"]::-webkit-inner-spin-button,
.apply input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.apply-step {
    position: relative;
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--black);
    font: inherit;
    font-size: var(--fs-big);
    line-height: 1;
    cursor: pointer;
}

.apply-step::after {
    content: '';
    position: absolute;
    inset: -8px -6px;
}

.apply-total output {
    display: block;
    padding: 4px 0;             /* mismo alto que los campos, para alinear los números */
    font-size: var(--fs-big);
    line-height: 1.25;
}

/* Lo que se pulsa no se selecciona como texto al hacer clic (o doble clic) */
.apply-chips label,
.apply-step,
.apply .btn,
.apply-photo,
.apply-terms,
#apply-info-open {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Casillas: como los botones pero en gris; marcadas, en negro */
.apply-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
}

/* En grande: casillas, botones y el total */
.apply-chips span,
.apply-button .btn {
    font-size: var(--fs-big);
}

/* Botón con el español debajo, pequeño y en gris, fuera de la caja negra */
.apply-button {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.apply-chips input {
    position: absolute;
    opacity: 0;
}

.apply-chips span {
    --box: var(--chip);
    display: block;
    cursor: pointer;
}

/* Al pasar el ratón, un gris más oscuro: se ve que se puede marcar */
@media (hover: hover) {
    .apply-chips label:hover input:not(:checked) + span {
        --box: #B5B5B5;
    }

    .apply-terms:hover input:not(:checked) {
        background: #B5B5B5;
    }
}

.apply-chips input:checked + span {
    --box: var(--black);
    color: var(--sheet);
}

.apply-chips input:focus-visible + span,
.apply-photo input:focus-visible + .btn {
    outline: 1px solid var(--black);
    outline-offset: 2px;
}

.apply-terms {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    margin-bottom: 32px;
    cursor: pointer;
}

.apply-terms input {
    display: block;
    width: 0.72em;              /* alto de la mayúscula: va de la ascendente a la base */
    height: 0.72em;
    margin: 0.21em 0 0;         /* donde empieza la ascendente con interlineado 1 */
    border: 0;
    border-radius: 0;
    background: var(--chip);
    -webkit-appearance: none;
    appearance: none;
}

.apply-terms input:checked {
    background: var(--black);
}

.apply-terms a {
    text-decoration: underline;
}

/* touch-action: sin esto el móvil hace scroll en vez de dibujar */
#apply-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 2px solid var(--black);
    background: var(--sheet);
    cursor: crosshair;
    touch-action: none;
}

.apply-tools {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 12px;
}

.apply-tool-right {
    margin-left: auto;
}

/* Botones pegados al texto: el área para el dedo es más grande que el negro */
.apply .btn {
    position: relative;
}

.apply .btn::after {
    content: '';
    position: absolute;
    inset: -10px -6px;
}

.apply-photo {
    position: relative;
}

.apply-photo input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.apply-photo-preview[hidden] {
    display: none;
}

.apply-photo-preview {
    display: block;
    max-width: 100%;
    max-height: 420px;
    margin-top: 8px;
    object-fit: contain;
    object-position: left;
}

.apply-trap {
    position: absolute !important;
    left: -9999px;
}

.apply .apply-error {
    margin-bottom: 16px;
}

.apply-error[hidden] {
    display: none;
}

.apply-submit:disabled {
    cursor: default;
}

.apply-thanks {
    margin-top: 32px;
}

/* Enviado: solo el mensaje de gracias, sin título, intro ni avisos */
.apply.is-sent > h1,
.apply.is-sent > h1 + p,
.apply.is-sent .apply-intro,
.apply.is-sent .apply-note {
    display: none;
}

.apply.is-sent .apply-thanks {
    margin-top: 0;
}

.apply-thanks .apply-es {
    margin-top: 6px;
}

.apply .apply-again {
    margin-top: 32px;
}

.apply-thanks img {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    margin-top: 16px;
    border: 1px solid var(--black);
}


/* ============================================================
   + INFO — panel negro que entra por la derecha, sin velo
   ============================================================ */

.apply .apply-info-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 16px;
}

.apply .apply-info-link .hl {
    font-size: var(--fs-big);
}

.apply-info {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    width: min(640px, 100%);
    padding: var(--pad);
    overflow-y: auto;
    background: var(--black);
    color: var(--sheet);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0s 0.35s;
}

.apply-info.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.35s ease;
}

.apply-info-close {
    margin-bottom: 48px;
}

/* Botón en negativo: caja blanca sobre el negro */
.apply-info-close .btn {
    --box: var(--sheet);
    color: var(--black);
}

.apply-info-text p + p {
    margin-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
    .apply-info,
    .apply-info.is-open {
        transition: none;
    }
}


@media only screen and (max-width: 768px) {

    .apply {
        margin-top: 64px;
    }

    .apply-pair {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .apply-qty {
        grid-template-columns: repeat(2, 1fr);
    }

}
