/* ========= Mailer Propet — thème ========= */

/* Police de marque HelvNeueOrange.
   Déposez les fichiers dans public/fonts/ (voir public/fonts/README.txt).
   Tant qu'ils sont absents, l'interface utilise Inter : rien ne change. */
@font-face {
    font-family: "HelvNeueOrange";
    src: url("../fonts/HelvNeueOrange-Regular.woff2") format("woff2"),
         url("../fonts/HelvNeueOrange-Regular.woff") format("woff"),
         url("../fonts/HelvNeueOrange-Regular.ttf") format("truetype"),
         url("../fonts/HelvNeueOrange-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "HelvNeueOrange";
    src: url("../fonts/HelvNeueOrange-Medium.woff2") format("woff2"),
         url("../fonts/HelvNeueOrange-Medium.woff") format("woff"),
         url("../fonts/HelvNeueOrange-Medium.ttf") format("truetype"),
         url("../fonts/HelvNeueOrange-Medium.otf") format("opentype");
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "HelvNeueOrange";
    src: url("../fonts/HelvNeueOrange-Bold.woff2") format("woff2"),
         url("../fonts/HelvNeueOrange-Bold.woff") format("woff"),
         url("../fonts/HelvNeueOrange-Bold.ttf") format("truetype"),
         url("../fonts/HelvNeueOrange-Bold.otf") format("opentype");
    font-weight: 700 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-brand: "HelvNeueOrange", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bg: #f4f5fa;
    --surface: #ffffff;
    --border: #e6e8f0;
    --text: #1f2333;
    --muted: #6b7185;
    --primary: #4f46e5;
    --primary-soft: #eef0ff;
    --sidebar: #161a2e;
    --sidebar-text: #a9aec6;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-brand);
    font-size: .925rem;
}

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 252px; flex-shrink: 0;
    background: var(--sidebar); color: var(--sidebar-text);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 20px 14px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; font-size: 1.05rem;
    padding: 4px 10px 22px; text-decoration: none;
}
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
}
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; color: #6c7192; }
.side-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 10px; margin-bottom: 2px;
    color: var(--sidebar-text); text-decoration: none; font-weight: 500;
}
.side-link i { font-size: 1.05rem; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: var(--primary); color: #fff; }
.side-link .count { margin-left: auto; background: #f59e0b; color: #1f2333; font-size: .7rem; font-weight: 700; border-radius: 20px; padding: 1px 8px; }

.sidebar-user {
    margin-top: auto; border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px 8px 0; display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: var(--primary-soft); color: var(--primary); flex-shrink: 0;
}
.sidebar-user .name { color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.2; }
.sidebar-user .role { font-size: .75rem; }
.btn-logout { background: none; border: 0; color: var(--sidebar-text); margin-left: auto; padding: 6px; border-radius: 8px; }
.btn-logout:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 22px 32px 6px;
}
.topbar h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.topbar .subtitle { color: var(--muted); margin: 2px 0 0; }
.content { padding: 18px 32px 48px; }
.mobile-bar { display: none; }

/* ---------- Cartes ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 20px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-body { padding: 20px; }

.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.15; }

.tone-indigo { background: #eef0ff; color: #4f46e5; }
.tone-green  { background: #e7f8f0; color: #047857; }
.tone-amber  { background: #fff6e5; color: #b45309; }
.tone-red    { background: #fdecec; color: #b91c1c; }
.tone-gray   { background: #f0f1f5; color: #4b5163; }
.tone-blue   { background: #e8f0ff; color: #1d4ed8; }

/* ---------- Tableaux ---------- */
.table { margin: 0; --bs-table-bg: transparent; }
.table > thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 600; background: #fafbfd;
    border-bottom: 1px solid var(--border); padding: 11px 20px; white-space: nowrap;
}
.table > tbody td { padding: 13px 20px; vertical-align: middle; border-color: var(--border); }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f8f9ff; }
.email-cell { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px !important; }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------- Badges ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 30px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Formulaires & boutons ---------- */
.form-label { font-weight: 600; font-size: .85rem; }
.form-control, .form-select { border-radius: 10px; border-color: var(--border); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.btn-light { background: #fff; border: 1px solid var(--border); }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

textarea.emails { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; line-height: 1.6; }
.counter-box { background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: .85rem; }

.message-preview { background: #fafbfd; border: 1px dashed var(--border); border-radius: 12px; padding: 16px; white-space: pre-line; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .form-control, .filters .form-select { width: auto; min-width: 170px; }
.filters .search { position: relative; }
.filters .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters .search input { padding-left: 34px; min-width: 240px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 6px 12px; border-radius: 30px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .82rem; border: 1px solid var(--border); background: #fff; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }
.tab .n { opacity: .65; margin-left: 4px; }

.progress { height: 8px; border-radius: 10px; background: #eceef5; }
.progress-bar { background: linear-gradient(90deg, #6366f1, #8b5cf6); }

.alert { border-radius: 12px; border: 0; }
.pagination { margin: 0; }
.page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--border); color: var(--text); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ---------- Pages invité ---------- */
.guest { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.guest-side {
    background: radial-gradient(circle at 20% 20%, #6366f1 0, transparent 55%), radial-gradient(circle at 90% 80%, #8b5cf6 0, transparent 50%), var(--sidebar);
    color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.guest-side h2 { font-weight: 800; font-size: 2.1rem; line-height: 1.2; max-width: 420px; }
.guest-side li { margin-bottom: 10px; color: #d6d9ee; }
.guest-form { display: grid; place-items: center; padding: 32px 20px; }
.guest-form .box { width: 100%; max-width: 380px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s; }
    .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
    .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--sidebar); color: #fff; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .guest { grid-template-columns: 1fr; }
    .guest-side { display: none; }
    .filters .form-control, .filters .form-select, .filters .search input { min-width: 0; width: 100%; }
    .filters > * { flex: 1 1 100%; }
}

/* ---------- Choix du message (propet) ---------- */
.choice { display: block; cursor: pointer; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: #c7cbe0; }
.choice input { display: none; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); background: #fbfbff; }
.choice .title { font-weight: 600; }
.choice .sub { color: var(--muted); font-size: .8rem; }
.choice-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; background: #f4f5fa; flex-shrink: 0; }

/* ---------- Aperçu email ---------- */
.mail-frame { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.mail-frame.sm { height: 420px; }
.logo-box { width: 100%; min-height: 96px; border: 1.5px dashed var(--border); border-radius: 12px; display: grid; place-items: center; background: #fafbfd; padding: 12px; }
.logo-box img { max-height: 80px; max-width: 100%; }
.form-control-color { width: 48px; height: 40px; padding: 4px; }

/* ---------- Vérification ---------- */
.verify-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.verify-summary .tab { cursor: pointer; }
.verify-table td { padding-top: 9px !important; padding-bottom: 9px !important; }
.suggest { border: 0; background: var(--primary-soft); color: var(--primary); border-radius: 6px; font-size: .75rem; font-weight: 600; padding: 2px 8px; }

/* ---------- Modal de confirmation ---------- */
.confirm-modal { border: 0; border-radius: 18px; box-shadow: 0 24px 64px rgba(16,24,40,.22); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; }
.modal-backdrop.show { opacity: .4; }

/* ---------- Constructeur de formulaire ---------- */
.field-row { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fafbfd; }
.field-row .handle { cursor: grab; }

/* ========================================================================
   Thème public « carte centrée » — formulaire de réponse, vues et connexion
   (carte blanche, gros titre, bouton foncé)
   ======================================================================== */
:root {
    --pub-accent: #ff7900;        /* couleur des champs actifs, du badge et des choix */
    --pub-btn: #000000;          /* bouton principal noir, comme « Continuer » */
    --pub-btn-hover: #333333;
    --pub-field: #f4f4f4;        /* fond des champs */
    --pub-border: #dddddd;
    --pub-ink: #0a0a0a;
    --pub-muted: #6b7280;
}

body.pub {
    background: #fafafa;
    color: var(--pub-ink);
    font-family: var(--font-brand);
    min-height: 100vh; display: flex; flex-direction: column;
}
.pub-wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 44px 16px 64px; flex: 1; }
.pub-card { background: #fff; border: 1px solid #e3e3e3; border-radius: 4px; box-shadow: 0 1px 3px rgba(16,24,40,.06); overflow: hidden; }
.pub-bar { display: none !important; } /* bandeau orange supprimé */
.pub-logo { text-align: center; padding: 34px 32px 0; }
.pub-logo img { max-width: 160px; max-height: 70px; }
.pub-logo.left { text-align: left; } .pub-logo.right { text-align: right; }
.pub-body { padding: 8px 44px 52px; }
.pub-title { font-weight: 800; font-size: 2.3rem; line-height: 1.1; letter-spacing: -.02em; color: var(--pub-ink); text-align: center; margin: 18px 0 8px; }
.pub-intro { color: var(--pub-muted); text-align: center; white-space: pre-line; margin-bottom: 28px; }
.pub-who { display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--pub-accent) 10%, #fff); color: var(--pub-accent); border-radius: 30px; padding: 6px 14px; font-size: .85rem; font-weight: 600; }

.pub-field { margin-bottom: 22px; }
.pub-field > label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.pub-field .req { color: #dc2626; margin-left: 2px; }
.pub-card .form-control, .pub-card .form-select {
    background: var(--pub-field); border: 1px solid var(--pub-border); border-radius: 3px;
    padding: .9rem 1rem; font-size: 1rem; color: var(--pub-ink);
}
.pub-card .form-control::placeholder { color: #8a8f99; }
.pub-card .form-control:focus, .pub-card .form-select:focus {
    background: #fff; border-color: var(--pub-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pub-accent) 20%, transparent);
}
.pub-card .form-check-input:checked { background-color: var(--pub-accent); border-color: var(--pub-accent); }

/* Bouton « Continuer » : noir, centré, largeur au contenu (comme la maquette Orange) */
.pub-submit {
    display: block; margin: 28px auto 0; width: auto; min-width: 190px;
    background: var(--pub-btn); color: #fff; border: 0; border-radius: 3px;
    padding: .9rem 2.6rem; font-size: 1.05rem; font-weight: 700;
}
.pub-submit:hover { background: var(--pub-btn-hover); }
.pub-foot { text-align: center; color: var(--pub-muted); font-size: .82rem; margin-top: 18px; }

/* Étoiles */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { display: none; }
.stars label { font-size: 2rem; color: #d4d7e1; cursor: pointer; line-height: 1; transition: transform .1s; }
.stars label:hover { transform: scale(1.1); }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--pub-accent); }

/* Oui / Non et choix uniques */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { display: none; }
.seg label { border: 1.5px solid var(--pub-border); border-radius: 10px; padding: 10px 20px; cursor: pointer; font-weight: 600; background: #fff; }
.seg input:checked + label { border-color: var(--pub-accent); background: color-mix(in srgb, var(--pub-accent) 10%, #fff); color: var(--pub-accent); }

/* États confirmation / fermé */
.pub-done { text-align: center; padding: 50px 44px; }
.pub-done .ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: #e7f8f0; color: #047857; font-size: 2.1rem; }
.pub-done.closed .ic { background: #f0f1f5; color: #4b5163; }

@media (max-width: 575px) {
    .pub-body { padding: 8px 24px 32px; }
    .pub-done { padding: 40px 24px; }
    .pub-title { font-size: 1.6rem; }
}
