/**
 * Corporate Christmas eCards
 * Customisation Editor Styles
 *
 * File:
 * /assets/css/cce-customisation.css
 */


/* =========================================================
   ROOT / BASE
========================================================= */

.cce-editor {
    --cce-primary: #c0226d;
    --cce-primary-dark: #961950;
    --cce-dark: #241f22;
    --cce-text: #3b3438;
    --cce-muted: #70666b;
    --cce-border: #eadfe5;
    --cce-background: #faf7f8;
    --cce-white: #ffffff;
    --cce-success: #2eaf68;
    --cce-danger: #e5484d;

    width: 100%;
    max-width: 1600px;
    margin: 30px auto;
    padding: 0;
    box-sizing: border-box;

    font-family: "Poppins", Arial, sans-serif;
    color: var(--cce-text);
}

.cce-editor *,
.cce-editor *::before,
.cce-editor *::after {
    box-sizing: border-box;
}


/* =========================================================
   EDITOR HEADER
========================================================= */

.cce-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 78px;
    padding: 18px 28px;

    background: var(--cce-white);
    border: 1px solid var(--cce-border);
    border-radius: 18px 18px 0 0;

    box-shadow: 0 4px 18px rgba(20, 30, 40, 0.04);
}

.cce-editor-header-left,
.cce-editor-header-right {
    flex: 1;
}

.cce-editor-header-right {
    display: flex;
    justify-content: flex-end;
}

.cce-editor-header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;

    text-align: center;
}

.cce-editor-header-title strong {
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--cce-dark);
}

.cce-editor-header-title span {
    font-size: 12px;
    color: var(--cce-muted);
}

.cce-editor-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--cce-text);
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.cce-editor-back:hover {
    color: var(--cce-primary);
    transform: translateX(-2px);
}

.cce-editor-back span {
    font-size: 18px;
    line-height: 1;
}

.cce-editor-step {
    display: inline-flex;
    align-items: center;

    min-height: 34px;
    padding: 0 13px;

    border-radius: 999px;

    background: #fff0f7;
    color: var(--cce-primary);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}


/* =========================================================
   EDITOR BODY
========================================================= */

.cce-editor-body {
    display: grid;

    grid-template-columns: minmax(620px, 680px) minmax(0, 1fr);

    /*
     * Keep the editor inside the visible browser area.
     * Header is approximately 78px, so this gives the
     * editing workspace the remaining viewport height.
     */
    height: calc(100vh - 108px);

    min-height: 650px;

    background: var(--cce-background);

    border: 1px solid var(--cce-border);
    border-top: 0;

    border-radius: 0 0 18px 18px;

    overflow: hidden;
}


/* =========================================================
   SIDEBAR
========================================================= */

.cce-editor-sidebar {
    width: 100%;

    padding: 24px;

    background: var(--cce-white);

    border-right: 1px solid var(--cce-border);

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;

    align-content: start;

    min-width: 0;
    min-height: 0;

    overflow-y: auto;
}

.cce-editor-section {
    min-width: 0;

    margin: 0;
    padding: 20px;

    border: 1px solid var(--cce-border);
    border-radius: 14px;

    background: var(--cce-white);
}

.cce-editor-section:last-child {
    border-bottom: 1px solid var(--cce-border);
}

/* =========================================================
   DESKTOP FORM LAYOUT
========================================================= */

/* Company Details */
.cce-editor-sidebar > .cce-editor-section:nth-of-type(1) {
    grid-column: 1;
    grid-row: 1;
}

/* Your Message */
.cce-editor-sidebar > .cce-editor-section:nth-of-type(2) {
    grid-column: 2;
    grid-row: 1;
}

/* Message Styling */
.cce-editor-sidebar > .cce-editor-section:nth-of-type(3) {
    grid-column: 1 / -1;
    grid-row: 2;
}


/* =========================================================
   SECTION HEADING
========================================================= */
.cce-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-bottom: 18px;
}

.cce-section-number {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    border-radius: 10px;

    background: #fff0f7;
    color: var(--cce-primary);

    font-size: 11px;
    font-weight: 800;
}

.cce-section-heading h2 {
    margin: 0 0 3px;

    color: var(--cce-dark);

    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}

.cce-section-heading p {
    margin: 0;

    color: var(--cce-muted);

    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   FORM GROUPS
========================================================= */

.cce-form-group {
    position: relative;

    margin-bottom: 14px;
}

.cce-form-group:last-child {
    margin-bottom: 0;
}

.cce-form-group > label {
    display: block;

    margin-bottom: 7px;

    color: var(--cce-dark);

    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.cce-editor input[type="text"],
.cce-editor input[type="email"],
.cce-editor input[type="number"],
.cce-editor select,
.cce-editor textarea {
    width: 100%;

    margin: 0;
    padding: 12px 13px;

    border: 1px solid var(--cce-border);
    border-radius: 10px;

    outline: none;

    background: #fbfcfd;
    color: var(--cce-dark);

    font-family: "Poppins", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;

    box-shadow: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.cce-editor input[type="text"]:hover,
.cce-editor input[type="email"]:hover,
.cce-editor input[type="number"]:hover,
.cce-editor select:hover,
.cce-editor textarea:hover {
    border-color: #cbd4dc;
}

.cce-editor input[type="text"]:focus,
.cce-editor input[type="email"]:focus,
.cce-editor input[type="number"]:focus,
.cce-editor select:focus,
.cce-editor textarea:focus {
    border-color: var(--cce-primary);

    background: var(--cce-white);

    box-shadow: 0 0 0 3px rgba(192, 34, 109, 0.12);
}

.cce-editor textarea {
    min-height: 110px;
    resize: vertical;
}


/* =========================================================
   CHARACTER COUNT
========================================================= */

.cce-character-count {
    display: flex;
    justify-content: flex-end;

    margin-top: 6px;

    color: #9aa3ac;

    font-size: 10px;
}


/* =========================================================
   UPLOAD AREA
========================================================= */

.cce-upload-area {
    position: relative;

    border: 1px dashed #cbd5de;
    border-radius: 12px;

    background: #fafcfe;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.cce-upload-area:hover {
    border-color: var(--cce-primary);
    background: #fff8fb;
}

.cce-upload-area input[type="file"],
.cce-recipient-upload input[type="file"] {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.cce-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 90px;

    padding: 20px;

    cursor: pointer;

    text-align: center;
}

.cce-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    margin-bottom: 9px;

    border-radius: 10px;

    background: #fce8f1;
    color: var(--cce-primary);

    font-size: 20px;
    font-weight: 500;
}

.cce-upload-label strong {
    display: block;

    color: var(--cce-dark);

    font-size: 11px;
    font-weight: 700;
}

.cce-upload-label small {
    display: block;

    margin-top: 4px;

    color: var(--cce-muted);

    font-size: 9px;
}


/* =========================================================
   UPLOADED FILE
========================================================= */

.cce-uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 8px;
    padding: 8px 10px;

    border: 1px solid var(--cce-border);
    border-radius: 9px;

    background: #f8fafc;
}

.cce-file-name {
    min-width: 0;

    overflow: hidden;

    color: var(--cce-text);

    font-size: 10px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.cce-remove-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 25px;

    width: 25px;
    height: 25px;

    padding: 0;

    border: 0;
    border-radius: 7px;

    background: #fff0f0;
    color: var(--cce-danger);

    font-size: 16px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.cce-remove-logo:hover {
    background: #ffe0e0;
    transform: scale(1.05);
}


/* =========================================================
   RECIPIENT ENTRY
========================================================= */

.cce-recipient-method-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cce-recipient-method-fieldset legend {
    display: block;
    width: 100%;
    margin: 0 0 9px;
    padding: 0;
    color: var(--cce-dark);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
}

.cce-recipient-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.cce-recipient-method {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    min-width: 0;
    margin: 0 !important;
    padding: 11px;
    border: 1px solid var(--cce-border);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.cce-recipient-method:hover {
    border-color: rgba(192, 34, 109, .55);
    background: #fff8fb;
}

.cce-recipient-method.is-active {
    border-color: var(--cce-primary);
    background: #fff5f9;
    box-shadow: 0 0 0 2px rgba(192, 34, 109, .10);
}

.cce-recipient-method input {
    flex: 0 0 auto;
    width: 15px !important;
    height: 15px !important;
    min-height: 0 !important;
    margin: 2px 8px 0 0 !important;
    padding: 0 !important;
    accent-color: var(--cce-primary);
}

.cce-recipient-method span,
.cce-recipient-method strong,
.cce-recipient-method small {
    display: block;
}

.cce-recipient-method span {
    min-width: 0;
}

.cce-recipient-method strong {
    color: var(--cce-dark);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.cce-recipient-method small {
    margin-top: 2px;
    color: var(--cce-muted);
    font-size: 8px;
    font-weight: 500;
    line-height: 1.35;
}

.cce-recipient-panel[hidden] {
    display: none !important;
}

.cce-recipient-manual-label {
    display: block;
    margin-bottom: 7px;
    color: var(--cce-dark);
    font-size: 10px;
    font-weight: 700;
}

#cce-recipient-manual {
    min-height: 132px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.6;
    text-transform: none;
}

.cce-recipient-upload {
    border: 1px solid var(--cce-border);
    border-radius: 10px;

    background: #fbfcfd;

    overflow: hidden;
}

.cce-recipient-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 10px 14px;

    cursor: pointer;

    color: var(--cce-primary);

    font-size: 11px;
    font-weight: 700;

    transition: background 0.2s ease;
}

.cce-recipient-upload-label:hover {
    background: #fff5f9;
}

.cce-field-help {
    margin: 6px 0 0;

    color: #98a1aa;

    font-size: 9px;
    line-height: 1.5;
}

/* =====================================================
   RECIPIENT VALIDATION STATUS
===================================================== */

.cce-recipient-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.cce-recipient-status[hidden] {
    display: none;
}

.cce-recipient-status-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cce-recipient-status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cce-recipient-status-title {
    font-weight: 600;
}

.cce-recipient-status-message {
    font-weight: 400;
}


/* SUCCESS */

.cce-recipient-status.is-success {
    background: #eef8f1;
    border-color: #b9dec3;
    color: #1f6b36;
}


/* ERROR */

.cce-recipient-status.is-error {
    background: #fff1f1;
    border-color: #e7b7b7;
    color: #a52d2d;
}


/* WARNING */

.cce-recipient-status.is-warning {
    background: #fff8e8;
    border-color: #ead39a;
    color: #795d15;
}


/* =========================================================
   STYLE CONTROLS
========================================================= */

.cce-style-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 14px;
}

.cce-style-row:last-child {
    margin-bottom: 0;
}

.cce-style-control {
    min-width: 0;
}

.cce-style-control label {
    display: block;

    margin-bottom: 7px;

    color: var(--cce-dark);

    font-size: 10px;
    font-weight: 700;
}

.cce-style-full {
    width: 100%;
}


/* =========================================================
   FONT SIZE CONTROL
========================================================= */

.cce-size-control {
    display: flex;
    align-items: stretch;

    height: 42px;

    border: 1px solid var(--cce-border);
    border-radius: 10px;

    background: #fbfcfd;

    overflow: hidden;
}

.cce-size-control button {
    width: 36px;

    padding: 0;

    border: 0;

    background: transparent;
    color: var(--cce-text);

    font-size: 17px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.cce-size-control button:hover {
    background: #fff0f7;
    color: var(--cce-primary);
}

.cce-size-control input {
    flex: 1;

    width: 100%;

    min-width: 0;

    padding: 0;

    border: 0 !important;

    border-left: 1px solid var(--cce-border) !important;
    border-right: 1px solid var(--cce-border) !important;

    border-radius: 0 !important;

    background: transparent !important;

    text-align: center;

    box-shadow: none !important;
}


/* =========================================================
   COLOR CONTROL
========================================================= */

.cce-color-control {
    display: flex;
    align-items: center;
    gap: 9px;

    height: 42px;

    padding: 5px 9px;

    border: 1px solid var(--cce-border);
    border-radius: 10px;

    background: #fbfcfd;
}

.cce-color-control input[type="color"] {
    width: 31px;
    height: 31px;

    padding: 2px;

    border: 1px solid #d9e0e6;
    border-radius: 7px;

    background: var(--cce-white);

    cursor: pointer;
}

#cce-color-value {
    color: var(--cce-text);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}


/* =========================================================
   ALIGNMENT CONTROLS
========================================================= */

.cce-alignment-controls {
    display: flex;

    height: 42px;

    border: 1px solid var(--cce-border);
    border-radius: 10px;

    overflow: hidden;

    background: #fbfcfd;
}

.cce-align-button {
    flex: 1;

    padding: 0;

    border: 0;
    border-right: 1px solid var(--cce-border);

    background: transparent;
    color: #77818a;

    font-size: 16px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.cce-align-button:last-child {
    border-right: 0;
}

.cce-align-button:hover {
    background: #fff0f7;
    color: var(--cce-primary);
}

.cce-align-button.is-active {
    background: #fce8f1;
    color: var(--cce-primary);
}


/* =========================================================
   FONT WEIGHT CONTROLS
========================================================= */

.cce-weight-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border: 1px solid var(--cce-border);
    border-radius: 10px;

    overflow: hidden;

    background: #fbfcfd;
}

.cce-weight-button {
    min-height: 42px;

    padding: 7px;

    border: 0;
    border-right: 1px solid var(--cce-border);

    background: transparent;
    color: #77818a;

    font-family: "Poppins", Arial, sans-serif;
    font-size: 9px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.cce-weight-button:last-child {
    border-right: 0;
}

.cce-weight-button:hover {
    background: #fff0f7;
    color: var(--cce-primary);
}

.cce-weight-button.is-active {
    background: #fce8f1;
    color: var(--cce-primary);
}


/* =========================================================
   WORKSPACE
========================================================= */

.cce-editor-workspace {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;

    height: 100%;

    padding: 22px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(192, 34, 109, 0.06),
            transparent 35%
        ),
        #f5f7fa;
}


/* =========================================================
   WORKSPACE TOPBAR
========================================================= */

.cce-workspace-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    margin-bottom: 12px;
}

.cce-preview-label {
    display: block;

    margin-bottom: 4px;

    color: var(--cce-primary);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.cce-workspace-topbar h1 {
    margin: 0;

    color: var(--cce-dark);

    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.cce-workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cce-reset-button {
    min-height: 36px;

    padding: 0 14px;

    border: 1px solid var(--cce-border);
    border-radius: 9px;

    background: var(--cce-white);
    color: var(--cce-text);

    font-family: "Poppins", Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.cce-reset-button:hover {
    border-color: var(--cce-primary);
    background: #fff8fb;
    color: var(--cce-primary);
}


/* =========================================================
   CANVAS WRAPPER
========================================================= */

.cce-canvas-wrapper {
    display: flex;

    align-items: flex-start;
    justify-content: center;

    flex: 1;

    min-height: 0;

    padding: 10px 20px 20px;

    border: 1px solid var(--cce-border);
    border-radius: 18px;

    background:
        linear-gradient(
            45deg,
            #edf0f3 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #edf0f3 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #edf0f3 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #edf0f3 75%
        );

    background-size: 20px 20px;

    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0;

    overflow: hidden;

    box-shadow:
        inset 0 0 40px rgba(20, 30, 40, 0.03);
}


/* =========================================================
   ECARD CANVAS
========================================================= */

.cce-card-canvas {
    position: relative;

    width: min(
        100%,
        760px,
        calc(100vh - 245px)
    );

    aspect-ratio: 1 / 1;

    container-type: inline-size;

    flex: 0 0 auto;

    background-color: #ffffff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    border-radius: 4px;

    box-shadow:
        0 25px 60px rgba(21, 31, 42, 0.20),
        0 5px 15px rgba(21, 31, 42, 0.08);

    overflow: hidden;

    user-select: none;
}

/* =========================================================
   CANVAS ELEMENTS
========================================================= */

.cce-canvas-element {
    position: absolute;

    min-width: 40px;

    transform: translate(-50%, -50%);

    cursor: move;

    z-index: 10;

    user-select: none;
    touch-action: none;
}

.cce-canvas-element[hidden] {
    display: none !important;
}


/* =========================================================
   MESSAGE
========================================================= */

.cce-message-element {
    min-height: 40px;

    padding: 8px;

    border: 1px solid transparent;

    text-align: left;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.cce-message-text {
    width: 100%;

    min-height: 25px;

    color: #ffffff;

    font-family: "Poppins", Arial, sans-serif;

    font-size: 28px;
    line-height: 1.22;

    font-weight: 600;

    word-break: break-word;

    white-space: pre-wrap;
}


/* =========================================================
   COMPANY NAME
========================================================= */

.cce-company-element {
    min-height: 35px;

    padding: 7px 10px;

    border: 1px solid transparent;

    text-align: center;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.cce-company-text {
    width: 100%;

    color: #ffffff;

    font-family: "Poppins", Arial, sans-serif;

    font-size: 22px;
    line-height: 1.22;

    font-weight: 600;

    word-break: break-word;

    white-space: pre-wrap;
}


/* =========================================================
   LOGO
========================================================= */

.cce-logo-element {
    min-width: 40px;

    padding: 5px;

    border: 1px solid transparent;

    text-align: center;
}

.cce-logo-element img {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;

    object-fit: contain;

    pointer-events: none;
}


/* =========================================================
   SELECTED ELEMENT
========================================================= */

.cce-element-selected {
    border: 1px solid var(--cce-primary) !important;

    box-shadow:
        0 0 0 3px rgba(192, 34, 109, 0.16);

    z-index: 100 !important;
}

.cce-element-selected::before {
    content: "";

    position: absolute;

    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;

    border: 1px dashed rgba(192, 34, 109, 0.5);

    border-radius: 3px;

    pointer-events: none;
}


/* =========================================================
   RESIZE HANDLE
========================================================= */

.cce-resize-handle {
    position: absolute;

    right: -7px;
    bottom: -7px;

    width: 15px;
    height: 15px;

    border: 2px solid var(--cce-white);
    border-radius: 50%;

    background: var(--cce-primary);

    box-shadow:
        0 2px 7px rgba(20, 30, 40, 0.20);

    cursor: nwse-resize;

    opacity: 0;

    transition: opacity 0.15s ease;

    z-index: 20;
}

.cce-element-selected .cce-resize-handle {
    opacity: 1;
}


/* =========================================================
   DELETE BUTTON
========================================================= */

.cce-element-delete {
    position: absolute;

    top: -10px;
    right: -10px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    padding: 0;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: var(--cce-danger);
    color: #ffffff;

    font-size: 13px;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 2px 8px rgba(20, 30, 40, 0.18);

    opacity: 0;

    transform: scale(0.8);

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.cce-element-selected .cce-element-delete {
    opacity: 1;
    transform: scale(1);
}


/* =========================================================
   FLOATING TOOLBAR
========================================================= */

.cce-floating-toolbar {
    position: absolute;

    z-index: 500;

    display: flex;
    align-items: center;

    padding: 4px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;

    background: rgba(20, 28, 36, 0.94);

    box-shadow:
        0 8px 25px rgba(20, 30, 40, 0.20);

    backdrop-filter: blur(10px);
}

.cce-floating-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #ffffff;

    font-size: 16px;

    cursor: pointer;
}

.cce-floating-toolbar button:hover {
    background: rgba(255, 255, 255, 0.10);
}


/* =========================================================
   CANVAS HELP
========================================================= */

.cce-canvas-help {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    margin-top: 8px;

    color: #8b959f;

    font-size: 9px;
    text-align: center;
}

.cce-canvas-help span {
    color: var(--cce-primary);

    font-size: 14px;
}


/* =========================================================
   FOOTER
========================================================= */

.cce-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    gap: 20px;

    margin-top: 12px;
    padding: 12px 0 0;

    border-top: 1px solid var(--cce-border);
}

.cce-secure-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #eaf9f0;
    color: var(--cce-success);

    font-size: 10px;
    font-weight: 800;
}


/* =========================================================
   NEXT BUTTON
========================================================= */

.cce-next-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    min-width: 150px;
    min-height: 48px;

    padding: 0 22px;

    border: 0;
    border-radius: 11px;

    background: var(--cce-primary);
    color: #ffffff;

    font-family: "Poppins", Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(192, 34, 109, 0.25);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.cce-next-button:hover {
    background: var(--cce-primary-dark);

    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(192, 34, 109, 0.32);
}

.cce-next-button:active {
    transform: translateY(0);
}

.cce-next-button span:last-child {
    font-size: 17px;

    transition: transform 0.2s ease;
}

.cce-next-button:hover span:last-child {
    transform: translateX(3px);
}


/* =========================================================
   INVALID ECARD / ERROR
========================================================= */

.cce-editor-error {
    max-width: 620px;

    margin: 80px auto;
    padding: 50px 35px;

    border: 1px solid var(--cce-border);
    border-radius: 18px;

    background: var(--cce-white);

    text-align: center;

    box-shadow:
        0 20px 50px rgba(20, 30, 40, 0.08);
}

.cce-editor-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #fff1f1;
    color: var(--cce-danger);

    font-size: 22px;
    font-weight: 700;
}

.cce-editor-error h2 {
    margin: 0 0 10px;

    color: var(--cce-dark);

    font-size: 22px;
}

.cce-editor-error p {
    max-width: 460px;

    margin: 0 auto 25px;

    color: var(--cce-muted);

    font-size: 12px;
    line-height: 1.7;
}

.cce-editor-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 20px;

    border-radius: 9px;

    background: var(--cce-primary);
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.cce-editor-back-button:hover {
    background: var(--cce-primary-dark);
    color: #ffffff;

    transform: translateY(-1px);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .cce-editor {
        margin: 15px auto;
    }

    .cce-editor-body {
        grid-template-columns: minmax(520px, 1.2fr) minmax(0, 1fr);
    }

    .cce-editor-sidebar {
        padding: 20px 18px;
        gap: 16px;
    }

    .cce-editor-section {
        padding: 17px;
    }

    .cce-editor-workspace {
        padding: 18px;
    }

    .cce-canvas-wrapper {
        padding: 14px;
    }

}


/* =========================================================
   TABLET / MOBILE
   Live Preview appears BEFORE the long editing form
========================================================= */

@media (max-width: 900px) {

    .cce-editor-body {
        display: flex;
        flex-direction: column;

        height: auto;
        min-height: 0;

        overflow: visible;
    }

    /* =====================================================
       LIVE PREVIEW
    ===================================================== */

    .cce-editor-workspace {
        order: 1;

        width: 100%;
        min-width: 0;
        min-height: 0;

        height: auto;

        padding: 18px;

        display: block;

        overflow: visible;
    }

    .cce-workspace-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;

        margin-bottom: 12px;
    }

    .cce-canvas-wrapper {
        width: 100%;

        min-height: 0;
        height: auto;

        padding: 10px;

        display: flex;
        align-items: flex-start;
        justify-content: center;

        overflow: visible;
    }

    .cce-card-canvas {
        display: block;

        width: 100%;
        max-width: 760px;

        height: auto;

        aspect-ratio: 1 / 1;

        flex: none;
    }

    /* =====================================================
       HELP TEXT
    ===================================================== */

    .cce-canvas-help {
        margin-top: 9px;
    }


    /* =====================================================
       EDITING FORM
    ===================================================== */

    .cce-editor-sidebar {
        order: 2;

        width: 100%;

        display: block;

        padding: 22px 18px;

        border-right: 0;
        border-bottom: 1px solid var(--cce-border);

        overflow: visible;
    }

    .cce-editor-section {
        margin-bottom: 18px;
    }

    .cce-editor-section:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {

    .cce-editor {
        width: 100vw;
        width: 100dvw;
        max-width: 100vw;
        max-width: 100dvw;
        margin: 0;
        margin-left: calc(50% - 50vw);
        margin-left: calc(50% - 50dvw);
    }

    /* =====================================================
       HEADER
    ===================================================== */

    .cce-editor-header {
        display: grid;
        grid-template-columns: 1fr auto;

        gap: 10px;

        min-height: auto;

        padding: 14px;

        border-radius: 0;
    }

    .cce-editor-header-left {
        grid-column: 1;
        grid-row: 1;
    }

    .cce-editor-header-right {
        grid-column: 2;
        grid-row: 1;
    }

    .cce-editor-header-title {
        grid-column: 1 / -1;
        grid-row: 2;

        align-items: flex-start;
        text-align: left;
    }


    /* =====================================================
       LIVE PREVIEW
    ===================================================== */

    .cce-editor-workspace {
        padding: 12px 6px 20px;

        background:
            radial-gradient(
                circle at 50% 0%,
                rgba(192, 34, 109, 0.06),
                transparent 35%
            ),
            #f5f7fa;
    }

    .cce-workspace-topbar {
        gap: 8px;

        margin-bottom: 10px;
    }

    .cce-preview-label {
        font-size: 8px;
    }

    .cce-workspace-topbar h1 {
        max-width: 220px;

        font-size: 15px;
        line-height: 1.3;
    }

    .cce-reset-button {
        min-height: 34px;

        padding: 0 10px;

        font-size: 9px;
    }


    /* =====================================================
       CANVAS
    ===================================================== */

    .cce-canvas-wrapper {
        width: 100%;

        padding: 5px;

        min-height: 0;

        border-radius: 12px;

        overflow: visible;
    }

    .cce-card-canvas {
        width: 100%;
        max-width: 100%;

        height: auto;

        aspect-ratio: 1 / 1;

        flex: none;

        border-radius: 3px;

        box-shadow:
            0 10px 25px rgba(21, 31, 42, 0.16);
    }

    .cce-resize-handle {
        right: -10px;
        bottom: -10px;
        width: 21px;
        height: 21px;
    }


    /* =====================================================
       FORM
    ===================================================== */

    .cce-editor-sidebar {
        padding: 17px 11px;

        overflow: visible;
    }

    .cce-editor-section {
        padding: 17px;

        margin-bottom: 18px;
    }

    .cce-section-heading h2 {
        font-size: 18px;
    }

    .cce-section-heading p {
        font-size: 13px;
    }

    .cce-form-group > label,
    .cce-style-control label {
        font-size: 14px;
    }

    .cce-editor input[type="text"],
    .cce-editor input[type="email"],
    .cce-editor input[type="number"],
    .cce-editor select,
    .cce-editor textarea {
        min-height: 48px;
        font-size: 16px;
    }

    .cce-upload-label strong,
    .cce-recipient-upload-label {
        font-size: 14px;
    }

    .cce-upload-label small,
    .cce-field-help,
    .cce-file-name,
    .cce-character-count {
        font-size: 12px;
    }

    .cce-size-control,
    .cce-color-control,
    .cce-alignment-controls,
    .cce-weight-button {
        min-height: 46px;
        height: auto;
    }

    .cce-weight-button {
        font-size: 13px;
    }


    /* =====================================================
       STYLE CONTROLS
    ===================================================== */

    .cce-style-row {
        grid-template-columns: 1fr;

        gap: 12px;

        margin-bottom: 12px;
    }


    /* =====================================================
       FOOTER
    ===================================================== */

    .cce-editor-footer {
        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        margin-top: 16px;

        padding-top: 15px;
    }

    .cce-next-button {
        width: 100%;

        min-height: 46px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .cce-editor-header-title strong {
        font-size: 15px;
    }

    .cce-editor-header-title span {
        font-size: 10px;
    }

   .cce-editor-sidebar {
        padding: 17px 11px;
    }

    .cce-editor-workspace {
        padding: 15px 10px 22px;
    }

    .cce-canvas-wrapper {
        padding: 7px;
    }

    .cce-workspace-topbar {
        gap: 8px;
    }

    .cce-workspace-topbar h1 {
        max-width: 180px;
        font-size: 14px;
    }

    .cce-reset-button {
        min-height: 32px;
        padding: 0 9px;
    }

    .cce-canvas-help {
        font-size: 8px;
    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.cce-editor button:focus-visible,
.cce-editor input:focus-visible,
.cce-editor select:focus-visible,
.cce-editor textarea:focus-visible,
.cce-editor a:focus-visible {
    outline: 2px solid var(--cce-primary);
    outline-offset: 2px;
}


/* =========================================================
   REDUCE MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .cce-editor *,
    .cce-editor *::before,
    .cce-editor *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }

}



/* ---------------------------------------------------------
   v1.10.43 STATIC ECARD PHONE/TABLET EDITOR
   Below 901px: image-first preview, three fixed tabs, and Next at bottom.
   Desktop retains the original v1.10.41 two-column form layout.
--------------------------------------------------------- */
.cce-mobile-editor-tabs,
.cce-mobile-sheet-header { display: none; }

@media (max-width: 900px) {
  html.cce-mobile-editor-is-open,
  html.cce-mobile-editor-is-open body { overflow: hidden !important; }

  /* Leave the canvas in the workspace; move no controls in the DOM. */
  .cce-editor .cce-editor-body {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
    position: relative;
  }
  .cce-editor .cce-editor-workspace {
    display: block;
    order: 1;
    width: 100%;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 14px 12px 170px;
  }
  .cce-editor .cce-canvas-wrapper {
    min-height: 0;
    height: auto;
    display: flex;
    justify-content: center;
    padding: 6px;
  }
  .cce-editor .cce-card-canvas {
    width: min(calc(100vw - 38px), calc(100dvh - 275px), 680px);
    max-width: 100%;
    max-height: none;
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
  }
  .cce-editor .cce-canvas-help { font-size: 10px; }

  /* Form never sits below the live preview: it is a full-screen editor. */
  .cce-editor .cce-editor-sidebar {
    display: none !important;
    order: 2;
  }
  .cce-editor .cce-editor-sidebar.cce-mobile-sheet-open {
    display: flex !important;
    position: fixed !important;
    inset: 0;
    z-index: 2147483002;
    background: #fff;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    min-width: 0;
    padding: 0 16px calc(26px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex-direction: column;
    gap: 0;
  }
  .cce-editor .cce-mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    min-height: 76px;
    gap: 10px;
    padding: 12px 0;
    background: #fff;
    border-bottom: 1px solid #e8dde3;
  }
  .cce-editor .cce-mobile-sheet-header strong {
    font-size: 17px;
    color: #241f22;
    line-height: 1.3;
  }
  .cce-editor .cce-mobile-sheet-header > div { display: flex; gap: 8px; }
  .cce-editor .cce-mobile-sheet-header button {
    border: 1px solid #e9cdd9;
    background: #fff7fb;
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 44px;
    color: #9d1a54;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .cce-editor .cce-mobile-sheet-header .cce-mobile-sheet-done {
    background: #c0226d;
    color: white;
    border-color: #c0226d;
  }
  .cce-editor .cce-editor-sidebar.cce-mobile-sheet-open > .cce-editor-section {
    display: none !important;
  }
  .cce-editor .cce-editor-sidebar.cce-mobile-sheet-open > .cce-editor-section.cce-mobile-active-section {
    display: block !important;
    flex: 0 0 auto;
    order: 0;
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    margin: 14px 0 28px;
    padding: 14px 0;
    border: 0;
    box-shadow: none;
  }
  .cce-editor .cce-editor-sidebar.cce-mobile-sheet-open .cce-style-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .cce-editor .cce-mobile-sheet-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    background: rgba(22, 19, 23, .52);
  }

  /* Sticky tab row sits ABOVE the final Next action. */
  .cce-editor .cce-mobile-editor-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 7px;
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 2147482996;
    margin: 0;
    padding: 10px 10px 6px;
    background: #fff;
    border-top: 1px solid #e8dde3;
    box-shadow: 0 -9px 25px rgba(0,0,0,.08);
  }
  .cce-editor .cce-mobile-editor-tabs button {
    min-height: 47px;
    padding: 9px 5px;
    font: 700 12px/1.2 "Poppins", Arial, sans-serif;
    color: #98134b;
    background: #fff0f7;
    border: 1px solid #ecd4de;
    border-radius: 11px;
    cursor: pointer;
  }
  .cce-editor .cce-mobile-editor-tabs button[aria-expanded="true"] {
    background: #c0226d;
    color: #fff;
  }
  /* Next is THE LAST action on screen. No second button is generated. */
  .cce-editor .cce-editor-footer {
    display: contents;
  }
  .cce-editor .cce-footer-note { display: none; }
  .cce-editor .cce-next-button {
    position: fixed;
    z-index: 2147482997;
    bottom: calc(9px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    max-width: none;
    min-height: 52px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(192, 34, 109, .22);
  }
  html.cce-mobile-editor-is-open .cce-editor .cce-mobile-editor-tabs,
  html.cce-mobile-editor-is-open .cce-editor .cce-next-button {
    display: none !important;
  }
}

@media (max-width: 540px) {
  .cce-editor .cce-editor-workspace { padding: 11px 7px 172px; }
  .cce-editor .cce-card-canvas {
    width: min(calc(100vw - 22px), calc(100dvh - 265px));
  }
  .cce-editor .cce-editor-sidebar.cce-mobile-sheet-open .cce-style-row {
    grid-template-columns: 1fr;
  }
}
