/* Shared frontend form styles for WooCommerce Email Marketing. */
.wcemp-subscribe-box,
.wcemp-lead-form {
    --wcemp-border: #d7dce2;
    --wcemp-border-strong: #9aa6b2;
    --wcemp-text: #1f2933;
    --wcemp-muted: #667085;
    --wcemp-surface: #fff;
    --wcemp-soft: #f6f8fb;
    --wcemp-primary: #2271b1;
    --wcemp-focus: rgba(34, 113, 177, 0.18);
}

.wcemp-subscribe-box {
    width: 100%;
    max-width: 680px;
    margin: 18px auto;
}

.wcemp-subscribe-title {
    margin-top: 0;
    letter-spacing: 0;
}

.wcemp-static-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.wcemp-subscribe-form {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.wcemp-subscribe-form .wcep_inp,
.wcemp-lead-form input,
.wcemp-lead-form textarea,
.wcemp-lead-form select,
.wcemp-country-picker-button,
.wcemp-country-search {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--wcemp-border);
    border-radius: 6px;
    background: var(--wcemp-surface);
    color: var(--wcemp-text);
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.wcemp-subscribe-form .wcep_inp,
.wcemp-lead-form input,
.wcemp-lead-form textarea,
.wcemp-lead-form select {
    padding: 10px 12px;
}

.wcemp-subscribe-form .wcep_inp {
    min-width: 0;
    flex: 1 1 260px;
}

.wcemp-lead-form textarea {
    resize: vertical;
}

.wcemp-name-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wcemp-choice-group {
    display: grid;
    gap: 6px;
}

.wcemp-lead-form .wcemp-choice-group label,
.wcemp-lead-form .wcemp-consent-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    line-height: 1.45;
    font-weight: 400;
    color: var(--wcemp-text);
    transition: none;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.wcemp-choice-group input[type="checkbox"],
.wcemp-choice-group input[type="radio"],
.wcemp-consent-field input[type="checkbox"] {
    appearance: auto;
    flex: 0 0 16px;
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}

.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-square input[type="checkbox"],
.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-square input[type="radio"],
.wcemp-lead-form .wcemp-multi-select.wcemp-choice-style-square input[type="checkbox"] {
    appearance: none;
    border: 1px solid var(--wcemp-border-strong) !important;
    border-radius: 4px;
    background: #fff !important;
}

.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-round input[type="checkbox"],
.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-round input[type="radio"],
.wcemp-lead-form .wcemp-multi-select.wcemp-choice-style-round input[type="checkbox"] {
    appearance: none;
    border: 1px solid var(--wcemp-border-strong) !important;
    border-radius: 999px;
    background: #fff !important;
}

.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-square input:checked,
.wcemp-lead-form .wcemp-choice-group.wcemp-choice-style-round input:checked,
.wcemp-lead-form .wcemp-multi-select.wcemp-choice-style-square input:checked,
.wcemp-lead-form .wcemp-multi-select.wcemp-choice-style-round input:checked {
    border-color: var(--wcemp-primary) !important;
    background:
        radial-gradient(circle, #fff 0 34%, transparent 36%),
        var(--wcemp-primary) !important;
}

.wcemp-multi-select {
    position: relative;
}

.wcemp-multi-select-native {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    opacity: 0 !important;
}

.wcemp-multi-select-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    border: 1px solid var(--wcemp-border);
    border-radius: 6px;
    background: var(--wcemp-surface);
    color: var(--wcemp-muted);
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.wcemp-multi-select-button:after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    flex: 0 0 auto;
    margin-left: 12px;
}

.wcemp-multi-select-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcemp-multi-select-summary.has-value {
    color: var(--wcemp-text);
    font-weight: 600;
}

.wcemp-multi-select-panel {
    display: none;
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--wcemp-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.wcemp-multi-select.is-open .wcemp-multi-select-panel {
    display: grid;
    gap: 6px;
}

.wcemp-lead-form .wcemp-multi-select-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.4;
    font-weight: 400;
    color: var(--wcemp-text);
    transition: none;
}

.wcemp-lead-form .wcemp-multi-select-panel input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}

.wcemp-multi-select-panel label:hover {
    background: var(--wcemp-soft);
}

.wcemp-file-input {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
}

.wcemp-lead-form .wcemp-file-upload {
    min-height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px 12px;
    border: 1px dashed var(--wcemp-border-strong);
    border-radius: 8px;
    background: var(--wcemp-soft);
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.wcemp-file-upload:hover {
    border-color: var(--wcemp-primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--wcemp-focus);
}

.wcemp-file-upload-title {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    background: var(--wcemp-primary);
    color: #fff;
    font-weight: 600;
}

.wcemp-file-upload-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--wcemp-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcemp-date-picker {
    position: relative;
}

.wcemp-date-panel {
    display: none;
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, 100%);
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--wcemp-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.wcemp-date-picker.is-open .wcemp-date-panel {
    display: block;
}

.wcemp-date-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.wcemp-date-head button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--wcemp-text);
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.wcemp-date-head button:hover {
    border-color: var(--wcemp-border);
    background: var(--wcemp-soft);
}

.wcemp-date-head button:focus {
    outline: 0;
    border-color: var(--wcemp-primary);
    box-shadow: 0 0 0 3px var(--wcemp-focus);
}

.wcemp-date-head svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.wcemp-date-week,
.wcemp-date-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.wcemp-date-week {
    margin-bottom: 6px;
    color: var(--wcemp-muted);
    font-size: 12px;
    text-align: center;
}

.wcemp-date-grid button {
    min-width: 0;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #fff;
    color: var(--wcemp-text);
    cursor: pointer;
}

.wcemp-date-grid button:hover {
    border-color: var(--wcemp-primary);
    background: var(--wcemp-soft);
}

.wcemp-date-grid button.is-today {
    border-color: #d7dce2;
    background: #fff;
    color: var(--wcemp-text);
}

.wcemp-date-grid button.is-selected {
    border-color: var(--wcemp-primary);
    background: var(--wcemp-primary);
    color: #fff;
    font-weight: 700;
}

.wcemp-time-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wcemp-border);
}

.wcemp-time-row label {
    margin: 0;
    color: var(--wcemp-muted);
    font-size: 13px;
    font-weight: 600;
}

.wcemp-time-input {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 6px;
}

.wcemp-subscribe-form .wcep_inp:focus,
.wcemp-lead-form input:focus,
.wcemp-lead-form textarea:focus,
.wcemp-lead-form select:focus,
.wcemp-country-picker-button:focus,
.wcemp-country-search:focus {
    outline: 0;
    border-color: var(--wcemp-primary);
    box-shadow: 0 0 0 3px var(--wcemp-focus);
}

.wcemp-subscribe-form .wcep_bnt,
.wcemp-lead-form-submit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 0 20px;
    background: var(--wcemp-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.wcemp-lead-form-submit {
    flex: 0 0 100%;
    width: auto;
    max-width: max-content;
}

.wcemp-subscribe-form .wcep_bnt:hover,
.wcemp-lead-form-submit:hover {
    opacity: 0.92;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.wcemp-subscribe-form .wcep_bnt:active,
.wcemp-lead-form-submit:active {
    transform: translateY(1px);
}

.wcemp-subscribe-form .wcep_bnt:disabled,
.wcemp-lead-form-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.wcemp-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wcemp-spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes wcemp-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.wcemp-message {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.wcemp-message p {
    margin: 0;
    padding: 9px 12px;
    border-radius: 6px;
}

.wcemp-message .success {
    color: #0f5132;
    background: #eaf7ef;
}

.wcemp-message .error {
    color: #842029;
    background: #fbeaec;
}

.wcemp-lead-form {
    max-width: 760px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--wcemp-text);
}

.wcemp-lead-form-row {
    width: 100%;
    margin-bottom: 0;
}

.wcemp-lead-form-row-half {
    width: calc(50% - 8px);
}

.wcemp-lead-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--wcemp-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.wcemp-lead-form .required {
    color: #b42318;
}

.wcemp-lead-container {
    display: grid;
    gap: 16px;
    width: 100%;
}

.wcemp-lead-container-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wcemp-lead-container-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wcemp-lead-container-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wcemp-lead-container .wcemp-lead-form-row {
    width: 100%;
}

.wcemp-phone-field {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.wcemp-phone-field .wcemp-country-picker {
    width: 200px;
    flex: 0 0 200px;
}

.wcemp-phone-field .wcemp-phone-code-picker-compact {
    position: static;
    width: 172px;
    flex-basis: 172px;
}

.wcemp-phone-field .wcemp-phone-code-picker-compact .wcemp-country-picker-panel {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
}

.wcemp-phone-field input {
    flex: 1;
}

.wcemp-country-picker {
    position: relative;
}

.wcemp-country-picker-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    text-align: left;
    cursor: pointer;
}

.wcemp-country-picker-button:after {
    content: "";
    margin-left: auto;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #667085;
    flex: 0 0 auto;
}

.wcemp-country-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
    flex: 0 0 22px;
}

.wcemp-country-selected {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcemp-country-selected-short {
    display: none;
}

.wcemp-phone-code-picker-compact .wcemp-country-selected-full {
    display: none;
}

.wcemp-phone-code-picker-compact .wcemp-country-selected-short {
    display: inline;
}

.wcemp-country-picker-panel {
    display: none;
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 300px;
    padding: 10px;
    background: var(--wcemp-surface);
    border: 1px solid var(--wcemp-border);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.wcemp-country-picker.is-open .wcemp-country-picker-panel {
    display: block;
}

.wcemp-country-search {
    min-height: 38px;
    margin-bottom: 8px;
    padding: 5px;
}

.wcemp-country-options {
    max-height: 270px;
    overflow: auto;
    padding-right: 2px;
}

.wcemp-country-option {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    padding: 8px;
    color: var(--wcemp-text);
    text-align: left;
    cursor: pointer;
}

.wcemp-country-option:hover,
.wcemp-country-option.is-active {
    background: var(--wcemp-soft);
}

.wcemp-country-option[hidden] {
    display: none;
}

.wcemp-country-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcemp-country-option small {
    margin-left: auto;
    color: var(--wcemp-muted);
    flex: 0 0 auto;
}

.wcemp-country-empty {
    display: none;
    padding: 10px 8px;
    color: var(--wcemp-muted);
    font-size: 14px;
}

.wcemp-country-empty.is-visible {
    display: block;
}

.wcemp-lead-form-message {
    width: 100%;
    margin: 12px 0;
    padding: 11px 13px;
    border-left: 4px solid var(--wcemp-primary);
    border-radius: 6px;
    background: #eef6fc;
    color: #1f4e79;
}

@media (max-width: 640px) {
    .wcemp-lead-form-row-half {
        width: 100%;
    }

    .wcemp-lead-container,
    .wcemp-lead-container-2,
    .wcemp-lead-container-3 {
        grid-template-columns: 1fr;
    }

    .wcemp-phone-field {
        flex-direction: row;
    }

    .wcemp-phone-field .wcemp-country-picker {
        width: 172px;
        flex: 0 0 172px;
    }

    .wcemp-phone-field .wcemp-phone-code-picker {
        position: static;
    }

    .wcemp-phone-field .wcemp-phone-code-picker .wcemp-country-picker-panel {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
    }

    .wcemp-phone-field input {
        min-width: 0;
    }

    .wcemp-country-picker-panel {
        min-width: 100%;
    }

    .wcemp-phone-code-picker .wcemp-country-selected-full {
        display: none;
    }

    .wcemp-phone-code-picker .wcemp-country-selected-short {
        display: inline;
    }
}

@media (max-width: 480px) {
    .wcemp-subscribe-form {
        flex-wrap: wrap;
    }

    .wcemp-subscribe-form .wcep_bnt {
        width: 100%;
    }
}
