.vmp-template-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 12px;
    padding: 0 24px 24px;
}

.vmp-template-card-actions form,
.vmp-template-preview-dialog form {
    margin: 0;
}

.vmp-template-alert {
    border: 1px solid;
    border-radius: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    margin-top: 18px;
    padding: 14px 18px;
}

.vmp-template-alert-success {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.vmp-template-alert-error {
    background: #fff1f2;
    border-color: #fda4af;
    color: #9f1239;
}

.vmp-template-use-button:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.vmp-template-preview-button,
.vmp-template-use-button {
    align-items: center;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 9px;
    justify-content: center;
    min-height: 48px;
    padding: 11px 16px;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    width: 100%;
}

.vmp-template-preview-button {
    background: #fff;
    border: 1px solid #cbdaf3;
    color: #10213f;
}

.vmp-template-use-button {
    background: linear-gradient(135deg, #0867f2, #3188ff);
    border: 1px solid transparent;
    box-shadow: 0 12px 26px rgba(8, 103, 242, .2);
    color: #fff;
}

.vmp-template-preview-button:hover,
.vmp-template-use-button:hover {
    transform: translateY(-2px);
}

.vmp-template-preview-modal[hidden] {
    display: none;
}

.vmp-template-preview-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 10050;
}

.vmp-template-preview-backdrop {
    background: rgba(5, 19, 45, .78);
    border: 0;
    cursor: pointer;
    inset: 0;
    padding: 0;
    position: absolute;
    width: 100%;
}

.vmp-template-preview-dialog {
    background: #f8fbff;
    border: 1px solid rgba(183, 207, 244, .8);
    border-radius: 26px;
    box-shadow: 0 32px 90px rgba(3, 18, 48, .35);
    display: grid;
    gap: 18px;
    max-height: calc(100vh - 48px);
    max-width: 720px;
    overflow: auto;
    padding: 28px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.vmp-template-preview-close {
    align-items: center;
    background: #edf4ff;
    border: 0;
    border-radius: 50%;
    color: #10213f;
    cursor: pointer;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 20px;
    width: 42px;
}

.vmp-template-preview-heading {
    padding-right: 48px;
}

.vmp-template-preview-heading span {
    color: #0867f2;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.vmp-template-preview-heading h2 {
    color: #071936;
    font-size: clamp(25px, 4vw, 38px);
    margin: 5px 0 7px;
}

.vmp-template-preview-heading p {
    color: #61708b;
    margin: 0;
}

.vmp-template-preview-image-wrap {
    background: #eaf2ff;
    border-radius: 20px;
    max-height: 58vh;
    overflow: auto;
    padding: 12px;
    text-align: center;
}

.vmp-template-preview-image-wrap img {
    border-radius: 14px;
    height: auto;
    max-width: 100%;
}

body.vmp-template-preview-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .vmp-template-card-actions {
        grid-template-columns: 1fr;
        padding: 0 18px 20px;
    }

    .vmp-template-preview-modal {
        padding: 12px;
    }

    .vmp-template-preview-dialog {
        max-height: calc(100vh - 24px);
        padding: 22px 18px 18px;
    }
}
