/* Form đăng ký chèn trong bài (WP7.4). Đổi bố cục theo độ rộng khung (container query), không theo màn hình: cột bài viết hẹp hơn màn hình. */
.vd-eform {
    container-type: inline-size;
    max-width: 784px;
    margin: 24px auto;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #4d4d4d;
}

.vd-eform__form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 32px;
    padding: 20px;
    border: 1px solid #a24d24;
    border-radius: 12px;
    background: #f9f4f0;
}

.vd-eform__form:not(:has(.vd-eform__media)) {
    grid-template-columns: minmax(0, 1fr);
}

.vd-eform__form[hidden],
.vd-eform__done[hidden],
.vd-eform__error[hidden] {
    display: none;
}

.vd-eform__media {
    position: relative;
    grid-row: 1 / span 2;
    min-height: 100%;
}

.vd-eform__media img {
    /* !important: CSS nội dung bài ép ảnh height:auto */
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: cover;
    border-radius: 10px;
}

.vd-eform__head {
    text-align: center;
}

.vd-eform__title {
    font-size: 24px;
    font-weight: 600;
    font-style: italic;
    line-height: 1.35;
    text-transform: uppercase;
    text-wrap: balance;
    color: #a24d24;
}

.vd-eform__done .vd-eform__title {
    max-width: 340px;
}

.vd-eform__subtitle {
    margin-top: 6px;
    font-size: 15px;
    font-style: italic;
}

.vd-eform__fields {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

.vd-eform__fields input[type="text"],
.vd-eform__fields input[type="email"],
.vd-eform__fields select {
    width: 100%;
    height: 48px;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #d4d4d4;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    background-color: transparent;
    font: inherit;
    font-weight: 400;
    color: inherit;
}

.vd-eform__fields input::placeholder {
    color: #4d4d4d;
    opacity: 1;
}

.vd-eform__fields input:focus,
.vd-eform__fields select:focus {
    border-bottom-color: #a24d24;
}

.vd-eform__fields select {
    padding-right: 20px;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M0 0h12L6 6z' fill='%234d4d4d'/%3E%3C/svg%3E") no-repeat right 2px center / 12px 6px;
    cursor: pointer;
}

.vd-eform__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 18px;
    font-size: 13px;
    font-weight: 400;
    color: #1a1a1a;
    cursor: pointer;
}

.vd-eform__consent input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #a24d24;
}

.vd-eform__error {
    margin-bottom: 12px;
    font-size: 13px;
    text-align: center;
    color: #b3261e;
}

.vd-eform__fields button {
    align-self: center;
    min-width: 116px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: #a24d24;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.vd-eform__fields button:hover {
    background: #8a4120;
}

.vd-eform__fields button:disabled {
    opacity: .6;
    cursor: wait;
}

.vd-eform__done {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 428px;
    padding: 32px 20px;
    border: 1px solid #a24d24;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.vd-eform__check {
    width: 48px;
    height: 48px;
    margin: 28px 0 20px;
    color: #00c853;
}

.vd-eform__message {
    font-size: 17px;
    line-height: 1.75;
}

@container (max-width: 560px) {
    .vd-eform__form {
        grid-template-columns: 134px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 14px;
        padding: 16px;
    }

    .vd-eform__form:not(:has(.vd-eform__media)) .vd-eform__fields {
        grid-column: auto;
    }

    .vd-eform__media {
        grid-row: auto;
        min-height: 0;
        /* Cùng tỉ lệ khung ảnh desktop (cột ~355px × cao form ~414px) để ảnh cắt giống nhau trên hai bố cục */
        aspect-ratio: 6 / 7;
    }

    .vd-eform__head {
        align-self: center;
    }

    .vd-eform__title {
        font-size: 18px;
    }

    .vd-eform__subtitle {
        font-size: 14px;
    }

    .vd-eform__fields {
        grid-column: 1 / -1;
        margin-top: 16px;
    }

    .vd-eform__done {
        min-height: 400px;
    }

    .vd-eform__message {
        font-size: 15px;
    }
}
