/* PDF Bon Generator – Frontend styles */

.pbg-fe-notice {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}
.pbg-fe-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.pbg-fe-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ── Wrap inline ── */
.pbg-fe-wrap {
    max-width: 100%;
    margin: 20px 0;
}

/* ── Formulaire ── */
.pbg-fe-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pbg-fe-title {
    margin: 0 0 16px;
    font-size: 17px;
    color: #1e293b;
    font-weight: 700;
}

.pbg-fe-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.pbg-fe-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pbg-fe-field label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.pbg-fe-field input[type="text"] {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.pbg-fe-field input[type="text"]:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Tableau ── */
.pbg-fe-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
}

.pbg-fe-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
    font-size: 13px;
}
.pbg-fe-table thead th {
    background: #1e293b;
    color: #fff;
    padding: 7px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.pbg-fe-table td {
    padding: 3px 4px;
    border-bottom: 1px solid #f1f5f9;
}
.pbg-fe-table tr:nth-child(even) td { background: #f8fafc; }
.pbg-fe-table input[type="text"] {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 7px;
    font-size: 13px;
    box-sizing: border-box;
}
.pbg-fe-table input[type="text"]:focus {
    border-color: #3b82f6;
    outline: none;
}

.pbg-fe-del-row {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}
.pbg-fe-del-row:hover { background: #fee2e2; }

/* ── Boutons ── */
.pbg-fe-add-row {
    background: none;
    border: 1px dashed #94a3b8;
    color: #475569;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 16px;
    transition: background .15s;
}
.pbg-fe-add-row:hover { background: #f1f5f9; }

.pbg-fe-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pbg-fe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    transition: filter .15s, transform .1s;
    color: #fff;
    background: #2563eb;
    text-decoration: none;
}
.pbg-fe-btn:hover { filter: brightness(1.1); }
.pbg-fe-btn:active { transform: scale(.97); }
.pbg-fe-btn--primary  { background: #2563eb; }
.pbg-fe-btn--small    { padding: 7px 14px; font-size: 13px; }
.pbg-fe-btn--large    { padding: 13px 28px; font-size: 16px; }

.pbg-fe-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    background: #f8fafc;
    color: #374151;
    transition: background .15s;
}
.pbg-fe-btn-save:hover { background: #f1f5f9; }

/* ── Modale ── */
.pbg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pbg-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.pbg-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}
.pbg-modal-close:hover { background: #f1f5f9; color: #1e293b; }

/* ── Bouton déclencheur (shortcode [pbg_button]) ── */
#pbg-open-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    color: #fff;
    transition: filter .15s, transform .1s;
}
#pbg-open-modal:hover  { filter: brightness(1.1); }
#pbg-open-modal:active { transform: scale(.97); }

/* ── Notice inline ── */
.pbg-fe-form .pbg-fe-notice {
    margin-top: 12px;
    display: none;
}

@media (max-width: 600px) {
    .pbg-fe-row2 { grid-template-columns: 1fr; }
    .pbg-fe-actions { flex-direction: column; align-items: stretch; }
    .pbg-fe-btn, .pbg-fe-btn-save { width: 100%; justify-content: center; }
}
