/* ---------- Escritorio ---------- */
.container-form {
    display: grid;
    grid-template-columns: 800px 1fr;
    grid-template-areas: "imagen formulario";
    height: 840px;
    background-color: #fff;
}

.form-img {
    grid-area: imagen;
    position: relative;
}

/* Capa marrón suave encima de la foto */
.form-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(111, 84, 57, 0.18);
}

.form-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right bottom;
}

.formulario {
    grid-area: formulario;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 72px 64px;
}

.encabezado,
form,
.boton-gracias {
    width: 100%;
    max-width: 560px;
}

.encabezado {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 36px;
}

.etiqueta {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.formulario h1 {
    font-family: 'Inter', sans-serif;
    font-size: 34px;
    font-weight: 300;
    line-height: 1.15;
}

.intro {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(80, 66, 52, 0.85);
}

/* ---------- Formulario ---------- */
form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fila {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* el campo "rubro" aparece con un fundido suave */
.campo-rubro:not([hidden]),
#campo-tamano:not([hidden]) {
    animation: aparece 0.35s ease;
}

@keyframes aparece {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    display: block;
    width: 100%;
    height: 54px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--brown);
    border-radius: 0;
    background-color: transparent;
    font-size: 13px;
    color: var(--brown);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 1px 0 var(--brown);
}

::placeholder {
    color: rgba(111, 84, 57, 0.6);
    opacity: 1;
}

/* ---------- Etiqueta flotante ----------
   La etiqueta hace de placeholder. Al entrar al campo (o si ya tiene algo
   escrito) sube y se achica, para que se recuerde qué va ahí. */
.campo {
    position: relative;
}

.etiqueta-campo {
    position: absolute;
    left: 0;
    top: 19px;
    font-size: 13px;
    color: rgba(111, 84, 57, 0.6);
    pointer-events: none;
    transform-origin: left top;
    transition: top 0.25s ease, font-size 0.25s ease, color 0.25s ease;
}

/* el placeholder deja de verse: lo reemplaza la etiqueta */
.campo input::placeholder,
.campo textarea::placeholder {
    color: transparent;
}

.campo input,
.campo select,
.campo textarea {
    padding-top: 22px;
    padding-bottom: 6px;
}

.campo textarea {
    padding-top: 26px;
}

/* etiqueta arriba: al enfocar, o con texto escrito, o con una opción elegida */
.campo:focus-within .etiqueta-campo,
.campo:has(input:not(:placeholder-shown)) .etiqueta-campo,
.campo:has(textarea:not(:placeholder-shown)) .etiqueta-campo,
.campo:has(select option[value=""]:not(:checked)) .etiqueta-campo {
    top: 4px;
    font-size: 10.5px;
}

.campo:focus-within .etiqueta-campo {
    color: var(--brown);
}

/* en los select vacíos el texto de la opción vacía no se muestra (ya lo dice la etiqueta) */
.campo select:has(option[value=""]:checked) {
    color: transparent;
}

/* ---------- Aviso de campo obligatorio ---------- */
.aviso-campo {
    max-height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 11.5px;
    letter-spacing: 0.3px;
    color: var(--brown);
    transition: max-height 0.3s ease, margin-top 0.3s ease, opacity 0.3s ease;
}

.con-error .aviso-campo {
    max-height: 24px;
    margin-top: 6px;
    opacity: 1;
}

.con-error input,
.con-error select,
.con-error textarea {
    box-shadow: 0 1px 0 var(--brown);
}

.con-error .etiqueta-campo {
    color: var(--brown);
}

@media (prefers-reduced-motion: reduce) {
    .etiqueta-campo,
    .aviso-campo {
        transition: none;
    }
}

textarea {
    height: 110px;
    padding: 16px 0 12px 0;
    resize: none;
}

select {
    appearance: none;
    padding-right: 24px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236F5439' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

/* Mientras no se elige nada, se ve como un placeholder */
select:required:invalid {
    color: rgba(111, 84, 57, 0.6);
}

/* El tamaño es opcional: mientras no se elige, se ve como un placeholder */
select:has(option[value=""]:checked) {
    color: rgba(111, 84, 57, 0.6);
}

option {
    color: var(--brown);
}

.check {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

input[type="checkbox"] {
    appearance: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid rgba(111, 84, 57, 0.4);
    border-radius: 5px;
    background-color: var(--soft-white);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    border-color: var(--brown);
    background-color: var(--brown);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffdfc' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 2px;
}

form button,
.boton-gracias {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    border: 0;
    border-bottom: 1px solid var(--brown);
    background-color: transparent;
    color: var(--brown);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    /* Color que va a "subir" desde abajo al pasar el mouse */
    background-image: linear-gradient(var(--brown), var(--brown));
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% 0;
    transition: background-size 0.3s ease, color 0.3s ease;
}

form button:hover,
.boton-gracias:hover {
    background-size: 100% 100%;
    color: var(--soft-white);
}

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
    .container-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            "formulario"
            "imagen";
        height: auto;
    }

    .formulario {
        padding: 48px 40px;
    }

    .form-img {
        height: 560px;
    }
}

/* ---------- Celular ---------- */
@media (max-width: 809.98px) {
    .formulario {
        padding: 32px 24px 40px 24px;
    }

    .fila {
        grid-template-columns: 1fr;
    }

    .form-img {
        height: 380px;
    }
}
