/* =========================================================
   PUB'ÉMY - CAMPAGNES
   ========================================================= */


/* IA */

.ai-generator {
    padding: 22px;

    background:
        linear-gradient(
            135deg,
            #f2f7ff 0%,
            #faf7ff 100%
        );

    border:
        1px solid #cbdcf4;

    border-radius: 16px;

    box-shadow:
        0 5px 18px
        rgba(23, 59, 119, 0.06);
}


.ai-generator-title {
    display: flex;

    align-items: center;

    gap: 13px;

    margin-bottom: 16px;
}


.ai-icon {
    width: 44px;
    height: 44px;

    display: grid;

    place-items: center;

    flex: 0 0 44px;

    background: #1769da;

    color: white;

    border-radius: 13px;

    font-size: 21px;
}


.ai-generator-title strong {
    display: block;

    color: #173b77;

    font-size: 17px;
}


.ai-generator-title p {
    margin-top: 4px;

    color: #687386;

    font-size: 13px;
}


.ai-request {
    width: 100%;

    min-height: 120px;

    padding: 16px 17px;

    color: #263247;

    background: white;

    border:
        1px solid #cad7e7;

    border-radius: 12px;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 14px;

    line-height: 1.6;

    resize: vertical;

    outline: none;
}


.ai-request:focus {
    border-color: #1769da;

    box-shadow:
        0 0 0 3px
        rgba(23, 105, 218, 0.10);
}


.ai-examples {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 12px;
}


.ai-examples > span {
    color: #7b8798;

    font-size: 11px;
}


.ai-examples button {
    padding: 5px 9px;

    background: white;

    color: #1769da;

    border:
        1px solid #cbd9ec;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;

    cursor: pointer;
}


.ai-examples button:hover {
    border-color: #1769da;
}


.ai-actions {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    gap: 15px;

    margin-top: 16px;
}


.ai-generate-button {
    padding: 12px 18px;

    background:
        linear-gradient(
            135deg,
            #1769da,
            #7254d8
        );

    color: white;

    border: 0;

    border-radius: 11px;

    font-size: 13px;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 5px 15px
        rgba(23, 105, 218, 0.20);
}


.ai-generate-button:hover {
    transform:
        translateY(-1px);
}


.ai-generate-button:disabled {
    cursor: wait;

    opacity: 0.65;
}


.ai-status {
    min-height: 18px;

    font-size: 12px;

    font-weight: 600;
}


.ai-status.loading {
    color: #475467;
}


.ai-status.success {
    color: #067647;
}


.ai-status.error {
    color: #b42318;
}


/* Messages */

.campaign-error {
    padding: 14px 16px;

    margin-bottom: 20px;

    background: #fff1f0;

    border:
        1px solid #f5b7b1;

    border-radius: 10px;

    color: #b42318;

    font-weight: 600;
}


.campaign-warning {
    padding: 18px;

    background: #fffaeb;

    border:
        1px solid #fedf89;

    border-radius: 12px;

    color: #93370d;
}


.campaign-warning p {
    margin: 7px 0 14px;
}


/* IMAGE */

.image-upload-box {
    padding: 20px;

    background: #f8fbff;

    border:
        1px dashed #bfd0e4;

    border-radius: 14px;
}


.image-upload-header strong {
    display: block;

    color: #263247;

    font-size: 15px;
}


.image-upload-header p {
    margin-top: 6px;

    color: #748094;

    font-size: 13px;

    line-height: 1.5;
}


.image-upload-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    margin-top: 16px;

    padding: 11px 16px;

    background: white;

    color: #1769da;

    border:
        1px solid #b9cff0;

    border-radius: 10px;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;
}


.image-preview-box {
    margin-top: 18px;

    padding: 14px;

    background: white;

    border:
        1px solid #e0e7f0;

    border-radius: 12px;
}


.image-preview-box[hidden] {
    display: none;
}


.image-preview-box img {
    display: block;

    width: 100%;

    max-width: 620px;
    max-height: 420px;

    margin: 0 auto;

    object-fit: contain;

    border-radius: 10px;
}


.image-file-name {
    margin-top: 10px;

    color: #667085;

    font-size: 12px;

    text-align: center;

    word-break: break-word;
}


/* APERÇU EMAIL */

.email-preview {
    overflow: hidden;

    max-width: 820px;

    margin: 0 auto;

    background: white;

    border:
        1px solid #dce5f0;

    border-radius: 16px;

    box-shadow:
        0 8px 30px
        rgba(23, 59, 119, 0.08);
}


.email-preview-subject {
    padding: 20px 26px;

    background: #f7faff;

    border-bottom:
        1px solid #dce5f0;
}


.email-preview-label {
    margin-bottom: 7px;

    color: #667085;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.08em;
}


.email-preview-subject strong {
    color: #172033;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 20px;

    line-height: 1.35;
}


.email-preview-image {
    padding: 26px 28px 0;

    text-align: center;
}


.email-preview-image img {
    display: block;

    width: 100%;

    max-width: 760px;
    max-height: 560px;

    margin: 0 auto;

    object-fit: contain;

    border-radius: 14px;
}


.email-preview-message {
    padding: 36px 42px 40px;

    color: #263247;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 17px;

    line-height: 1.9;

    letter-spacing: 0.01em;

    white-space: pre-wrap;

    text-rendering:
        optimizeLegibility;
}


.email-preview-message::first-line {
    color: #173b77;

    font-size: 19px;

    font-weight: 700;
}


.email-preview-footer {
    padding: 22px 28px;

    background: #f8fafc;

    border-top:
        1px solid #e5eaf1;

    color: #667085;

    font-size: 12px;

    line-height: 1.6;

    text-align: center;
}


.email-preview-footer strong {
    display: block;

    margin-bottom: 6px;

    color: #173b77;

    font-size: 14px;
}


.email-preview-footer span {
    display: block;

    margin-top: 6px;

    color: #98a2b3;
}


/* CHAMP TEXTE */

.campaign-form textarea[name="message"] {
    min-height: 280px;

    padding: 18px 20px;

    color: #263247;

    background: white;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 16px;

    line-height: 1.75;

    border:
        1px solid #d5deea;

    border-radius: 12px;

    resize: vertical;
}


/* MOBILE */

@media (max-width: 650px) {

    .ai-actions {
        align-items: stretch;

        flex-direction: column;
    }


    .ai-generate-button {
        width: 100%;
    }


    .image-upload-button {
        width: 100%;
    }


    .email-preview-message {
        padding: 26px 20px 30px;

        font-size: 16px;
    }
}
