/* Done Digital Lead Machine Forms Styles */

/* Global theme override protection */
.ddlm-form,
.ddlm-form *,
.ddlm-form *::before,
.ddlm-form *::after {
    box-sizing: border-box !important;
}

/*
 * Wrapper reset — avoid `all: unset` here: it resets every property on this node and is known
 * to interact badly with themes, inheritance, and custom properties. Use explicit resets only.
 */
.ddlm-form {
    display: block;
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: 0;
    max-width: 100%;
    min-width: 0;
    vertical-align: baseline;
    background: transparent;
    box-shadow: none;
    font: inherit;
    color: inherit;
    text-align: inherit;
    text-decoration: none;
    list-style: none;
}

/* Custom form styling - target only custom forms, not widget forms */
.ddlm-custom-form {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    padding: 24px !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    /* Font family intentionally omitted so the form inherits the site's body font.
       Headings (<h3>) naturally pick up the theme's heading font via the h1–h6 cascade. */
    line-height: 1.5 !important;
    color: #333 !important;
    width: 100% !important;
}

/* Disable form styling when option is checked */
.ddlm-custom-form.ddlm-disable-styling {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Keep field/button component styling in reduced-styling mode */
.ddlm-custom-form.ddlm-disable-styling .ddlm-form-input {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 5px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    background: #fff !important;
}

.ddlm-custom-form.ddlm-disable-styling .ddlm-submit-btn {
    width: 100% !important;
    height: 48px !important;
    padding: 12px 24px !important;
    background: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
    border: none !important;
    border-radius: 8px !important;
}

/* Popup dialog: always show card background (disable-styling is for embedded/theme blocks only) */
.ddlm-popup-dialog .ddlm-custom-form.ddlm-disable-styling {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    padding: 24px !important;
    border-radius: var(--ddlm-form-border-radius, 15px) !important;
}

/*
 * Form popup shell (footer-injected overlay). The dialog must have an explicit width;
 * otherwise flex + width:100% on the inner form can collapse the modal to a narrow strip.
 */
.ddlm-popup-overlay {
    box-sizing: border-box;
}

.ddlm-popup-overlay.ddlm-popup-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ddlm-popup-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, calc(100vw - 32px));
    max-width: min(720px, calc(100vw - 32px));
    min-width: min(300px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    flex: 0 0 auto;
    flex-shrink: 0;
    box-sizing: border-box;
    background: transparent;
    border-radius: 12px;
}

.ddlm-popup-dialog .ddlm-custom-form {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

.ddlm-form form {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Form heading and subheading (tight line-height: wrapper uses 1.5 for body copy).
   font-family is intentionally not set here so the theme's cascade applies:
   - Heading (<h3>): theme's h1–h6 rule wins, so it uses the site's heading font.
   - Subheading (<p>): inherits the site's body font. */
.ddlm-form-heading {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2 !important;
}

/* Add bottom margin when subheading is disabled */
.ddlm-form-heading.ddlm-heading-no-subheading {
    margin: 0 0 15px 0 !important;
}

.ddlm-form-subheading {
    margin: 0 0 15px 0 !important;
    color: #666;
    font-size: 18px;
    line-height: 1.35 !important;
}

/* Inline markup in heading/subheading: parent is already 600 / normal weight — step up bold so <b> reads */
.ddlm-form-heading b,
.ddlm-form-heading strong {
    font-weight: 700;
}

.ddlm-form-subheading b,
.ddlm-form-subheading strong {
    font-weight: 700;
}

.ddlm-form-heading i,
.ddlm-form-heading em,
.ddlm-form-subheading i,
.ddlm-form-subheading em {
    font-style: italic;
}

.ddlm-form-heading u,
.ddlm-form-subheading u {
    text-decoration: underline;
}

/* Heading field styles */
.ddlm-heading-field {
    margin: 20px 0 15px 0;
    padding: 0;
    border: none;
    background: none;
}

.ddlm-field-heading {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.2 !important;
    border: none !important;
    background: none !important;
}

.ddlm-field-description {
    margin: 0 !important;
    padding: 0 0 16px 0 !important;
    color: #959595 !important;
    line-height: 1.4 !important;
    font-weight: normal !important;
    border: none !important;
    background: none !important;
}

/* When horizontal line is present, reduce description bottom padding */
.ddlm-field-description + .ddlm-heading-line {
    margin-top: 8px !important;
}

.ddlm-heading-line {
    border: none !important;
    height: 1px !important;
    background: #e0e0e0 !important;
    margin: 16px 0 20px 0 !important;
    padding: 0 !important;
}

.ddlm-form-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ddlm-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Strong overrides to prevent theme interference */
.ddlm-form-content > *,
.ddlm-form-field > * {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Additional theme override for any form-related elements */
.ddlm-form * {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override any theme input styling */
.ddlm-form-input,
.ddlm-form-input:focus,
.ddlm-form-input:hover,
.ddlm-form-input:active {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override theme form element styling */
.ddlm-form form,
.ddlm-form form:focus,
.ddlm-form form:hover,
.ddlm-form form:active {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Override any theme form element styling */
.ddlm-form fieldset,
.ddlm-form fieldset:focus,
.ddlm-form fieldset:hover,
.ddlm-form fieldset:active {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: none !important;
}

/* Override theme textarea styling */
.ddlm-textarea,
.ddlm-textarea:focus,
.ddlm-textarea:hover,
.ddlm-textarea:active {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override theme select styling */
.ddlm-select,
.ddlm-select:focus,
.ddlm-select:hover,
.ddlm-select:active {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override theme label styling */
.ddlm-field-label {
    margin: 0 !important;
    margin-bottom: 4px !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Override specific theme selectors that target our form elements */
#top .ddlm-form-input,
#top .ddlm-textarea,
#top .ddlm-select,
#top .ddlm-form input[type="text"],
#top .ddlm-form input[type="email"],
#top .ddlm-form input[type="tel"],
#top .ddlm-form input[type="password"],
#top .ddlm-form input[type="number"],
#top .ddlm-form input[type="url"],
#top .ddlm-form input[type="search"],
#top .ddlm-form textarea,
#top .ddlm-form select {
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Override any other potential theme selectors */
.ddlm-form input,
.ddlm-form textarea,
.ddlm-form select,
.ddlm-form button {
    margin: 0 !important;
    margin-bottom: 0 !important;
}

.ddlm-field-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.ddlm-required {
    color: #a8bed9;
    margin-left: 2px;
}

.ddlm-form-input {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 5px !important;
    font-size: 16px;
    font-family: inherit !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    background: #fff !important;
}

.ddlm-form-input:focus {
    outline: none !important;
    border-color: var(--ddlm-primary-color, #007cba) !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}

.ddlm-form-input::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.ddlm-textarea {
    min-height: 100px !important;
    resize: vertical !important;
    font-family: inherit !important;
}

.ddlm-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
    appearance: none !important;
}

.ddlm-checkbox-group,
.ddlm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ddlm-checkbox-label,
.ddlm-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 8px 0;
}

.ddlm-checkbox,
.ddlm-radio {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--ddlm-primary-color, #007cba);
    -webkit-appearance: auto;
    appearance: auto;
}

/* Suppress theme custom-checkbox pseudo-elements (e.g. FontAwesome) — use native accent-color UI */
.ddlm-form input.ddlm-checkbox::before,
.ddlm-form input.ddlm-checkbox::after,
.ddlm-form input.ddlm-radio::before,
.ddlm-form input.ddlm-radio::after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
}

.ddlm-checkbox-text,
.ddlm-radio-text {
    flex: 1;
    line-height: 1.25;
}

.ddlm-terms-link {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ddlm-primary-color, #007cba);
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.ddlm-terms-link:hover,
.ddlm-terms-link:focus {
    color: var(--ddlm-primary-color, #007cba);
    opacity: 0.85;
}

.ddlm-terms-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.ddlm-terms-modal.is-open {
    display: flex;
}

.ddlm-terms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
}

.ddlm-terms-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 50px;
}

.ddlm-terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 42px 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.ddlm-terms-modal-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.ddlm-terms-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ddlm-terms-modal-body {
    padding: 20px 0 0;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.ddlm-terms-modal-footer {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
    position: static !important;
}

.ddlm-terms-modal-agree-label {
    margin: 0 0 18px;
}

.ddlm-terms-modal-close-link {
    display: block;
    margin: 8px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ddlm-primary-color, #007cba);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.ddlm-terms-modal-close-link:hover,
.ddlm-terms-modal-close-link:focus {
    color: var(--ddlm-primary-color, #007cba);
    opacity: 0.85;
}

.ddlm-terms-modal .ddlm-terms-modal-body,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #1f2937 !important;
}

.ddlm-terms-modal .ddlm-terms-modal-body p,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p {
    margin: 0 0 14px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

.ddlm-terms-modal .ddlm-terms-modal-body h1,
.ddlm-terms-modal .ddlm-terms-modal-body h2,
.ddlm-terms-modal .ddlm-terms-modal-body h3,
.ddlm-terms-modal .ddlm-terms-modal-body h4,
.ddlm-terms-modal .ddlm-terms-modal-body h5,
.ddlm-terms-modal .ddlm-terms-modal-body h6,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h1,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h2,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h3,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h4,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h5,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body h6 {
    margin: 0 0 10px !important;
    font-size: 19px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}

.ddlm-terms-modal .ddlm-terms-modal-body p + h1,
.ddlm-terms-modal .ddlm-terms-modal-body p + h2,
.ddlm-terms-modal .ddlm-terms-modal-body p + h3,
.ddlm-terms-modal .ddlm-terms-modal-body p + h4,
.ddlm-terms-modal .ddlm-terms-modal-body p + h5,
.ddlm-terms-modal .ddlm-terms-modal-body p + h6,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h1,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h2,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h3,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h4,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h5,
.ddlm-terms-modal .ddlm-terms-modal-body ul + h6,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h1,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h2,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h3,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h4,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h5,
.ddlm-terms-modal .ddlm-terms-modal-body ol + h6,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h1,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h2,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h3,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h4,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h5,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body p + h6,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h1,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h2,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h3,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h4,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h5,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul + h6,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h1,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h2,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h3,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h4,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h5,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol + h6 {
    margin-top: 18px !important;
}

.ddlm-terms-modal .ddlm-terms-modal-body ul,
.ddlm-terms-modal .ddlm-terms-modal-body ol,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ul,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body ol {
    margin: 0 0 14px !important;
    padding-left: 1.2em !important;
}

.ddlm-terms-modal .ddlm-terms-modal-body li,
.ddlm-form .ddlm-terms-modal .ddlm-terms-modal-body li {
    margin: 0 0 6px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

@media (max-width: 768px) {
    .ddlm-terms-modal-dialog {
        padding: 20px;
    }
}

/* Spacing before submit comes from parent flex gap (.ddlm-form-two-column / .ddlm-form-content) */
.ddlm-form-submit {
    margin-top: 0;
}

.ddlm-submit-btn {
    width: 100% !important;
    height: 48px !important;
    padding: 12px 24px !important;
    background: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: var(--ddlm-button-font-size, 16px);
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ddlm-submit-btn:hover {
    background: var(--ddlm-primary-color, #007cba) !important;
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.ddlm-submit-btn:active {
    transform: translateY(0);
}

.ddlm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ddlm-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

.ddlm-form-message.ddlm-success {
    background: rgba(var(--ddlm-primary-color-rgb, 0, 124, 186), 0.08);
    color: var(--ddlm-primary-color, #007cba);
    border: 1px solid rgba(var(--ddlm-primary-color-rgb, 0, 124, 186), 0.1);
    text-align: center;
}

.ddlm-form-message.ddlm-error {
    background: #e2f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

.ddlm-form-message.ddlm-loading {
    background: #e2f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] {
        padding: 20px;
        margin: 0 10px;
    }
    
    .ddlm-form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .ddlm-submit-btn {
        padding: 14px 24px;
        font-size: var(--ddlm-button-font-size, 16px);
        height: 52px !important;
    }
}

@media (max-width: 480px) {
    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] {
        padding: 16px;
        border-radius: 8px;
    }
    
    .ddlm-form-content {
        gap: 12px;
    }
    
    .ddlm-form-field {
        gap: 6px;
    }
    
    .ddlm-field-label {
        font-size: 13px;
    }
    
    .ddlm-form-input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .ddlm-submit-btn {
        padding: 12px 20px;
        font-size: var(--ddlm-button-font-size, 16px);
        height: 38px !important;
    }
}

/* Loading state */
.ddlm-submit-btn.ddlm-loading {
    position: relative !important;
    color: transparent !important;
    /* Ensure the button itself doesn't spin */
    transform: none !important;
    animation: none !important;
}

.ddlm-submit-btn.ddlm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: ddlm-spin 1s linear infinite;
    /* Ensure only the spinner rotates */
    transform-origin: center;
    z-index: 1;
}

@keyframes ddlm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error states */
.ddlm-form-input.ddlm-error {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Success: pulse wrapper after confirmation message flow */
.ddlm-form.ddlm-submitted {
    animation: ddlm-success-pulse 0.6s ease;
}

@keyframes ddlm-success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Layout Options */

/* Size container + stacking context: half-width follows form width; resists theme bleed */
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] {
    container-type: inline-size;
    container-name: ddlm-form;
    isolation: isolate;
    position: relative;
    z-index: 0;
    max-width: 100%;
}

/* Two-Column Layout — vertical rhythm uses column gap only (no row margin-bottom) */
.ddlm-form-two-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ddlm-form .ddlm-field-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 0;
}

.ddlm-field-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ddlm-form .ddlm-field-column.ddlm-field-half-width {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(50% - 6px);
}

.ddlm-form .ddlm-field-column.ddlm-field-full-width {
    flex: 1 1 100% !important;
    width: 100%;
    max-width: 100%;
}

.ddlm-form .ddlm-field-column.ddlm-empty-column {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(50% - 6px);
}


/* In-Line Form Layout */
.ddlm-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
}

.ddlm-form-inline .ddlm-form-field {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.ddlm-form-inline .ddlm-form-submit {
    flex-shrink: 0;
    margin-bottom: 0;
}

.ddlm-form-inline .ddlm-submit-btn {
    white-space: nowrap;
}

/* Only apply responsive wrapping and stacking on frontend forms, not in preview */
.ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline {
    flex-wrap: wrap;
}

@media (max-width: 500px) {
    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-form-field {
        min-width: auto;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-form-submit {
        margin-top: 8px;
        width: 100%;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-submit-btn {
        width: 100%;
    }
}

/* Stack in-line forms based on their available container width, not only the viewport. */
@container ddlm-form (max-width: 500px) {
    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-form-field {
        min-width: auto;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-form-submit {
        margin-top: 8px;
        width: 100%;
    }

    .ddlm-form:not(#ddlm-form-preview) .ddlm-form-inline .ddlm-submit-btn {
        width: 100%;
    }
}

/* Stack half-width columns when the form itself is narrow (container query) */
@container ddlm-form (max-width: 400px) {
    .ddlm-field-row {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 12px;
    }

    .ddlm-field-column.ddlm-field-half-width,
    .ddlm-field-column.ddlm-field-full-width,
    .ddlm-field-column.ddlm-empty-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }
}

/* Browsers without container queries: stack on typical phone/tablet portrait widths */
@supports not (container-type: inline-size) {
    @media (max-width: 768px) {
        .ddlm-form .ddlm-field-row {
            flex-direction: column !important;
            flex-wrap: nowrap !important;
            gap: 12px;
        }

        .ddlm-field-column.ddlm-field-half-width,
        .ddlm-field-column.ddlm-field-full-width,
        .ddlm-field-column.ddlm-empty-column {
            width: 100% !important;
            max-width: 100% !important;
            flex: 1 1 auto !important;
        }
    }
}

@media (max-width: 350px) {
    .ddlm-form .ddlm-field-row {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .ddlm-form-inline {
        gap: 8px;
    }
}

/* Field Modal Styles */
.ddlm-field-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ddlm-field-modal > div {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ddlm-field-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.ddlm-field-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.ddlm-field-modal input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ddlm-field-modal select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background: white;
}

.ddlm-field-modal textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    min-height: 80px !important;
    resize: vertical !important;
    font-family: inherit !important;
    margin: 0 !important;
    display: block !important;
}

/* Override any conflicting styles */
.ddlm-field-modal .ddlm-form-textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
}

/* Override WordPress core and theme styles */
.ddlm-field-modal textarea,
.ddlm-field-modal .ddlm-form-textarea,
.ddlm-field-modal #edit_heading_description {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

.ddlm-field-modal input[type="checkbox"] {
    margin-right: 8px;
}

.ddlm-field-modal .button {
    margin-left: 10px;
}

/* Ensure the width dropdown is visible */
#edit_field_width {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: white !important;
    color: #333 !important;
}

#edit_field_width option {
    padding: 4px 8px;
    background: white;
    color: #333;
}

/* === DDLM_EMBED_SHIELD:start (also printed in wp_footer for late cascade — keep in sync) === */
/* ========= Embedded / shortcode / popup / preview: parity with iframe preview + theme resistance ========= */
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] form.ddlm-form-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading {
    /* font-family intentionally not forced: let the site/theme style the h3 and p
       so headings use the heading font family and subheadings use the body font family. */
    font-style: normal !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading {
    color: #333 !important;
    line-height: 1.2 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading {
    color: #666 !important;
    line-height: 1.35 !important;
}

/* Beat theme resets on heading children (font-weight inherit, font-style on h3/p, etc.) */
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading b,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading strong,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading b,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading strong {
    font-weight: 700 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading i,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading em,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading i,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading em {
    font-style: italic !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-heading u,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-subheading u {
    text-decoration: underline !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-heading,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-description {
    /* font-family intentionally not forced: let the site/theme style the h4 and p
       so headings use the heading font family and descriptions use the body font family. */
    font-style: normal !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-label,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] label.ddlm-field-label {
    display: block !important;
    font-family: inherit !important;
    font-style: normal !important;
    font-weight: 500 !important;
    color: #333 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] textarea.ddlm-form-input,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] textarea.ddlm-textarea,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] select.ddlm-form-input,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] select.ddlm-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    font-style: normal !important;
    color: #333 !important;
    background-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    height: auto !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] select.ddlm-form-input.ddlm-select {
    padding-right: 40px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    background-color: #fff !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-submit-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    padding: 12px 24px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: var(--ddlm-button-font-size, 16px) !important;
    line-height: 1.2 !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--ddlm-primary-color, #007cba) !important;
    background-color: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-submit-btn:hover,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-submit-btn:focus {
    background: var(--ddlm-primary-color, #007cba) !important;
    background-color: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
    opacity: 0.9 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-submit {
    margin: 0 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-checkbox-label,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-radio-label {
    display: flex !important;
    align-items: center !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    color: #333 !important;
    text-decoration: none !important;
    line-height: 1.25 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-checkbox-text,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-radio-text {
    line-height: 1.25 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-checkbox,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-radio {
    width: 16px !important;
    height: 16px !important;
    margin: 0 8px 0 0 !important;
    flex-shrink: 0 !important;
    accent-color: var(--ddlm-primary-color, #007cba) !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
}

/* Hide theme custom-checkbox ::before/::after (e.g. FontAwesome) — keep native primary-colour control */
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-checkbox::before,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-checkbox::after,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-radio::before,
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-radio::after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-message {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="text"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="email"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="tel"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="number"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="url"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="search"],
.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] input.ddlm-form-input[type="password"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    font-style: normal !important;
    color: #333 !important;
    background-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    height: auto !important;
}

/* In-line forms use field-only validation feedback. */
.ddlm-form.ddlm-custom-form.ddlm-form-layout-inline[data-ddlm-embed="1"] .ddlm-form-message.ddlm-error {
    display: none !important;
}

.ddlm-form.ddlm-custom-form.ddlm-form-layout-inline[data-ddlm-embed="1"] .ddlm-form-input.ddlm-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px #dc3545 !important;
}

.ddlm-form.ddlm-custom-form.ddlm-form-layout-inline[data-ddlm-embed="1"] .ddlm-checkbox.ddlm-error,
.ddlm-form.ddlm-custom-form.ddlm-form-layout-inline[data-ddlm-embed="1"] .ddlm-radio.ddlm-error {
    outline: 2px solid #dc3545 !important;
    outline-offset: 1px;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-form-two-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-field-half-width {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(50% - 6px) !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-field-full-width {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-empty-column {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(50% - 6px) !important;
}

/* Embedded two-column: stack only on typical phone portrait (narrow + tall). Excludes phone landscape and tablet portrait. */
@media (max-width: 540px) and (orientation: portrait) {
    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-row {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
    }

    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-field-half-width,
    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-field-full-width,
    .ddlm-form.ddlm-custom-form[data-ddlm-embed="1"] .ddlm-field-column.ddlm-empty-column {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }
}
/* === DDLM_EMBED_SHIELD:end === */

/*
 * Post-submit (confirmation message flow): hide fields, honeypot, and submit; keep form title + subtitle and the message.
 * Placed after EMBED_SHIELD so these beat .ddlm-form-field { display:flex!important } etc.
 */
.ddlm-form.ddlm-custom-form.ddlm-submitted[data-ddlm-embed="1"] form.ddlm-form-content > :not(.ddlm-form-message):not(.ddlm-form-heading):not(.ddlm-form-subheading),
.ddlm-form.ddlm-submitted .ddlm-form-content > :not(.ddlm-form-message):not(.ddlm-form-heading):not(.ddlm-form-subheading) {
    display: none !important;
}

.ddlm-form.ddlm-custom-form.ddlm-submitted[data-ddlm-embed="1"] form.ddlm-form-content > .ddlm-form-message,
.ddlm-form.ddlm-submitted .ddlm-form-content > .ddlm-form-message {
    display: block !important;
    margin-top: 12px;
}

/* Stripe payment field */
.ddlm-stripe-payment-field {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.ddlm-stripe-coupon-wrap {
    margin-bottom: 0 !important;
}

.ddlm-stripe-coupon-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ddlm-primary-color, #007cba);
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    margin: 0 0 8px 0;
    cursor: pointer;
    text-decoration: none;
}

.ddlm-stripe-coupon-toggle:hover,
.ddlm-stripe-coupon-toggle:focus {
    text-decoration: underline;
    color: var(--ddlm-primary-color, #007cba);
    outline: none;
}

.ddlm-stripe-coupon-panel {
    margin-top: 6px;
}

.ddlm-stripe-coupon-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
}

.ddlm-stripe-coupon-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ddlm-stripe-coupon-row .ddlm-stripe-coupon-input {
    flex: 1 1 auto;
}

.ddlm-stripe-coupon-apply {
    min-width: 110px !important;
    height: 42px !important;
    padding: 10px 18px !important;
    background: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.ddlm-stripe-coupon-apply:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.ddlm-stripe-coupon-apply:active {
    transform: translateY(0) !important;
}

.ddlm-stripe-coupon-feedback {
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
    color: #6b7280;
}

.ddlm-stripe-coupon-feedback.ddlm-success {
    color: #166534;
}

.ddlm-stripe-coupon-feedback.ddlm-error {
    color: #b91c1c;
}

.ddlm-stripe-payment-meta {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.ddlm-stripe-payment-pricing {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.ddlm-stripe-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.ddlm-stripe-pricing-row:last-child {
    margin-bottom: 0;
}

.ddlm-stripe-pricing-discount {
    color: #166534;
}

.ddlm-stripe-pricing-subtotal {
    font-weight: 500;
    color: #111827;
}

.ddlm-hidden {
    display: none !important;
}

.ddlm-stripe-tax-ex-note {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
}

.ddlm-stripe-pricing-tax-row {
    color: #1f6f43;
}

.ddlm-stripe-pricing-processing-fee {
    color: #374151;
}

.ddlm-stripe-pricing-total {
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.ddlm-stripe-pricing-total-value-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ddlm-stripe-processing-fee-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.ddlm-stripe-processing-fee-info-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #9ca3af;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    line-height: 14px;
    text-align: center;
    cursor: help;
    flex-shrink: 0;
}

.ddlm-stripe-processing-fee-info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    z-index: 20;
    min-width: 180px;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #111827;
    color: #f9fafb;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.ddlm-stripe-processing-fee-info-tooltip-label,
.ddlm-stripe-processing-fee-info-tooltip-values {
    display: block;
}

.ddlm-stripe-processing-fee-info-tooltip-values {
    margin-top: 2px;
}

.ddlm-stripe-processing-fee-info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 8px;
    border: 6px solid transparent;
    border-top-color: #111827;
}

.ddlm-stripe-processing-fee-info:hover .ddlm-stripe-processing-fee-info-tooltip,
.ddlm-stripe-processing-fee-info:focus .ddlm-stripe-processing-fee-info-tooltip,
.ddlm-stripe-processing-fee-info:focus-within .ddlm-stripe-processing-fee-info-tooltip {
    visibility: visible;
    opacity: 1;
}

.ddlm-stripe-payment-amount {
    font-weight: 600;
    color: #1f2937;
}

.ddlm-stripe-payment-element {
    min-height: 42px;
}

.ddlm-stripe-payment-preview,
.ddlm-stripe-payment-unavailable {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
}

.ddlm-stripe-payment-preview {
    border: 1px solid #dfe3ea;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}

.ddlm-stripe-mock-link-row {
    margin-bottom: 14px;
    color: #0f6ac9;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ddlm-stripe-mock-lock {
    font-size: 18px;
    line-height: 1;
}

.ddlm-stripe-mock-link-text {
    font-size: 14px;
}

.ddlm-stripe-mock-link-chevron {
    margin-left: auto;
    font-size: 16px;
    color: #4b5563;
}

.ddlm-stripe-mock-label {
    display: block;
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
    margin-bottom: 6px;
}

.ddlm-stripe-mock-input {
    border: 1px solid #d8dee7;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 16px;
    color: #6b7280;
    background: #ffffff;
    margin-bottom: 10px;
    min-height: 46px;
    display: flex;
    align-items: center;
}

.ddlm-stripe-mock-card-input {
    justify-content: space-between;
}

.ddlm-stripe-mock-cards {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ddlm-stripe-mock-card-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
}

.ddlm-card-visa { background: #1a4ab9; }
.ddlm-card-mastercard { background: #e4572e; }
.ddlm-card-unionpay { background: #1f9d55; }

.ddlm-stripe-mock-cvc {
    justify-content: space-between;
}

.ddlm-stripe-mock-cvc-icon {
    font-size: 13px;
    color: #9ca3af;
}

.ddlm-stripe-mock-country {
    justify-content: space-between;
}

.ddlm-stripe-mock-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ddlm-stripe-mock-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.45;
}

.ddlm-woo-payment-field {
    margin-top: 8px;
}

.ddlm-woo-line-items {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.ddlm-woo-line-item,
.ddlm-woo-line-total,
.ddlm-woo-coupon-discount-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ddlm-woo-line-total {
    border-bottom: 0;
    font-weight: 600;
}

.ddlm-woo-coupon-discount-row {
    color: #166534;
}

.ddlm-woo-line-item-qty {
    color: #64748b;
}

.ddlm-woo-gateway-list {
    margin: 20px 0 15px 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ddlm-woo-gateway-option {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
}

.ddlm-woo-gateway-option-inline {
    cursor: default;
}

.ddlm-woo-gateway-option input[type="radio"] {
    margin-right: 8px;
}

.ddlm-woo-gateway-title {
    font-weight: 600;
}

.ddlm-woo-gateway-description {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.ddlm-woo-variation-picker {
    margin: 6px 0 10px;
}

.ddlm-woo-variation-grid {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.ddlm-woo-variation-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.ddlm-woo-variation-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ddlm-woo-variation-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ddlm-woo-variation-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ddlm-woo-variation-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ddlm-woo-variation-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.ddlm-woo-variation-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.ddlm-woo-variation-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ddlm-woo-variation-card-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.ddlm-woo-variation-card-price {
    font-size: 13px;
    color: #475569;
}

.ddlm-woo-variation-card.is-selected {
    border-color: var(--ddlm-primary-color, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.12);
}

@media (max-width: 767px) {
    .ddlm-woo-variation-grid-cols-3,
    .ddlm-woo-variation-grid-cols-4,
    .ddlm-woo-variation-grid-cols-5,
    .ddlm-woo-variation-grid-cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ddlm-woo-inline-gateway-fields {
    margin-top: 16px;
}

.ddlm-woo-gateway-select {
    margin-bottom: 10px;
}

.ddlm-woo-coupon-wrap {
    margin-top: 12px;
}

.ddlm-woo-coupon-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ddlm-primary-color, #007cba);
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    margin: 0 0 8px 0;
    cursor: pointer;
}

.ddlm-woo-coupon-toggle:hover,
.ddlm-woo-coupon-toggle:focus {
    text-decoration: underline;
    outline: none;
}

.ddlm-woo-coupon-panel {
    margin-top: 6px;
}

.ddlm-woo-coupon-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
}

.ddlm-woo-coupon-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ddlm-woo-coupon-row .ddlm-woo-coupon-input {
    flex: 1 1 auto;
}

.ddlm-woo-coupon-apply {
    min-width: 94px !important;
    height: 42px !important;
    padding: 10px 16px !important;
    background: var(--ddlm-primary-color, #007cba) !important;
    color: var(--ddlm-button-text-color, #ffffff) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

.ddlm-woo-coupon-feedback {
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
    color: #6b7280;
}

.ddlm-woo-coupon-feedback.ddlm-success {
    color: #166534;
}

.ddlm-woo-coupon-feedback.ddlm-error {
    color: #b91c1c;
}

.ddlm-woo-gateway-radios {
    display: none;
}

/* Keep Lead Machine checkout minimal: hide account/saved-method controls. */
.ddlm-woo-inline-gateway-fields .woocommerce-SavedPaymentMethods,
.ddlm-woo-inline-gateway-fields .woocommerce-SavedPaymentMethods-saveNew,
.ddlm-woo-inline-gateway-fields .wc-stripe-payment-methods,
.ddlm-woo-inline-gateway-fields .wc-stripe-new-payment-method-container,
.ddlm-woo-inline-gateway-fields .wc-stripe-save-source,
.ddlm-woo-payment-field .form-row.woocommerce-SavedPaymentMethods-saveNew,
.ddlm-woo-inline-gateway-fields .payment_method_stripe .payment_box .woocommerce-SavedPaymentMethods,
.ddlm-woo-inline-gateway-fields .payment_method_stripe .payment_box .woocommerce-SavedPaymentMethods-saveNew,
.ddlm-woo-inline-gateway-fields .payment_method_stripe .payment_box .wc-stripe-save-source {
    display: none !important;
}
