﻿/* =====================================================================
   wa.css - stile base del gateway WhatsApp AF Digital (tutte le pagine)
   Marchio AF Digital (sito nuovo af-digital.new, confermato 27/10/2026):
   antracite #24251f, carta #f6f5f0, giallo #fecb37, Manrope + DM Sans.
   Struttura: rail antracite a sinistra (desktop) / barra in basso (telefono),
   area di lavoro carta. Mossa firma: l'evidenziatore giallo (.wa-marker),
   lo stesso segno del titolo del sito AF Digital.
   Gli stili di pagina stanno in App_<Pagina>.css.
   ===================================================================== */

/* ---------- Caratteri ospitati nel progetto (niente servizi esterni) ---------- */
@font-face {
    font-family: "DM Sans AF";
    font-style: normal;
    font-display: swap;
    font-weight: 100 1000;
    src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "DM Sans AF";
    font-style: normal;
    font-display: swap;
    font-weight: 100 1000;
    src: url("fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Manrope AF";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Manrope AF";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* marchio */
    --wa-ink: #24251f;
    --wa-ink-2: #34352d;          /* rail: passaggio del mouse */
    --wa-ink-3: #4b4c42;          /* rail: separatori */
    --wa-on-ink: #f6f5f0;
    --wa-on-ink-2: #c1c2b6;       /* testo secondario su antracite (7.9:1) */
    --wa-paper: #f6f5f0;
    --wa-paper-2: #efede4;        /* fondo della chat, seconda superficie */
    --wa-surface: #ffffff;
    --wa-line: #d9d9ce;
    --wa-line-2: #e6e5dc;
    --wa-muted: #5f6056;          /* testo secondario su carta (5.9:1) */
    --wa-yellow: #fecb37;
    --wa-yellow-hover: #ffdb70;
    --wa-yellow-soft: #fff1c2;    /* bolle in uscita, avvisi */
    --wa-yellow-deep: #6b5000;    /* testo piccolo su giallo chiaro */
    /* stati */
    --wa-ok: #2e7d45;
    --wa-ok-soft: #e4f2e7;
    --wa-danger: #b3261e;
    --wa-danger-soft: #fbe9e7;
    --wa-focus: #24251f;
    /* forma */
    --wa-radius: 6px;
    --wa-radius-sm: 4px;
    --wa-shadow: 0 1px 2px rgba(36, 37, 31, .06), 0 4px 14px rgba(36, 37, 31, .06);
    --wa-shadow-pop: 0 12px 40px rgba(36, 37, 31, .22);
    --wa-rail-w: 76px;
    --wa-bar-h: 62px;
    --wa-font: "DM Sans AF", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --wa-font-head: "Manrope AF", "DM Sans AF", "Segoe UI", system-ui, sans-serif;
    --wa-ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; } /* anche nelle pagine senza Bootstrap (accesso) */
html, body { height: 100%; }
body.wa-body {
    margin: 0;
    background: var(--wa-paper);
    color: var(--wa-ink);
    font-family: var(--wa-font);
    font-size: 15px;
    line-height: 1.45;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
body.wa-body h1, body.wa-body h2, body.wa-body h3, body.wa-body h4, body.wa-body h5,
body.wa-body .modal-title { font-family: var(--wa-font-head); letter-spacing: -.02em; color: var(--wa-ink); }

/* Superfici del browser nel colore del marchio */
::selection { background: var(--wa-yellow); color: var(--wa-ink); }
:focus-visible { outline: 2px solid var(--wa-focus); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #c9c8bc transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c9c8bc; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
input, textarea { caret-color: var(--wa-ink); }

/* ---------- L'evidenziatore (mossa firma) ---------- */
.wa-marker {
    background: linear-gradient(transparent 58%, var(--wa-yellow) 58%, var(--wa-yellow) 92%, transparent 92%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0 .08em;
}

/* =====================================================================
   SHELL: rail a sinistra (desktop) + area di lavoro
   ===================================================================== */
.wa-shell { display: grid; grid-template-columns: var(--wa-rail-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.wa-main { min-width: 0; }

.wa-rail {
    position: sticky; top: 0;
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; align-items: stretch;
    background: var(--wa-ink); color: var(--wa-on-ink);
    padding: 14px 8px 12px;
    z-index: 40;
}
.wa-rail__brand { display: flex; justify-content: center; padding: 4px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--wa-ink-3); }
.wa-rail__brand img { width: 42px; height: auto; display: block; }
.wa-rail__nav, .wa-rail__slot { display: flex; flex-direction: column; gap: 4px; }
.wa-rail__slot:empty { display: none; }
.wa-rail__slot { padding: 8px 0; margin: 4px 0; border-top: 1px solid var(--wa-ink-3); border-bottom: 1px solid var(--wa-ink-3); }
.wa-rail__end { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 10px; }

.wa-rail__item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 2px 8px; border-radius: var(--wa-radius);
    color: var(--wa-on-ink-2); text-decoration: none; border: 0; background: transparent;
    font-family: var(--wa-font); font-size: 12px; font-weight: 500; line-height: 1.1; text-align: center;
    cursor: pointer;
    transition: background-color .18s var(--wa-ease), color .18s var(--wa-ease);
}
.wa-rail__item i { font-size: 20px; line-height: 1; }
.wa-rail__item:hover { background: var(--wa-ink-2); color: var(--wa-on-ink); }
.wa-rail__item.is-active { color: var(--wa-ink); background: var(--wa-yellow); }
.wa-rail__item .wa-count { position: absolute; top: 4px; right: 8px; }

/* Chip di un numero (progetto) nella rail della pagina Inbox */
.wa-rail__chip {
    width: 44px; height: 44px; margin: 0 auto; border-radius: 12px;
    display: grid; place-items: center;
    font-family: var(--wa-font-head); font-weight: 700; font-size: 14px; letter-spacing: -.02em;
    background: var(--wa-ink-2); color: var(--wa-on-ink); border: 1px solid var(--wa-ink-3);
    cursor: pointer; position: relative;
    transition: background-color .18s var(--wa-ease), border-color .18s var(--wa-ease), border-radius .25s var(--wa-ease);
}
.wa-rail__chip--cifre { font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.wa-rail__chip:hover { border-color: var(--wa-on-ink-2); }
.wa-rail__chip.is-active { background: var(--wa-yellow); color: var(--wa-ink); border-color: var(--wa-yellow); border-radius: 22px; }
.wa-rail__chip i { font-size: 18px; }
.wa-rail__chip .wa-count { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--wa-ink); }

.wa-rail__me {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--wa-ink-2); color: var(--wa-on-ink); border: 1px solid var(--wa-ink-3);
    font-family: var(--wa-font-head); font-weight: 700; font-size: 14px;
}

/* Contatore non letti */
.wa-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--wa-yellow); color: var(--wa-ink);
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.wa-count:empty { display: none; }
.wa-rail__item.is-active .wa-count { background: var(--wa-ink); color: var(--wa-yellow); }

/* Barra in basso (telefono) */
.wa-bar { display: none; }

@media (max-width: 860px) {
    .wa-shell { grid-template-columns: minmax(0, 1fr); }
    .wa-rail { display: none; }
    .wa-main { padding-bottom: calc(var(--wa-bar-h) + env(safe-area-inset-bottom)); }
    .wa-bar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        height: calc(var(--wa-bar-h) + env(safe-area-inset-bottom));
        padding: 0 6px env(safe-area-inset-bottom);
        background: var(--wa-ink);
    }
    .wa-bar .wa-rail__item { flex: 1; justify-content: center; border-radius: 0; padding: 8px 2px; }
    .wa-bar .wa-rail__item.is-active { background: transparent; color: var(--wa-yellow); }
    .wa-bar .wa-rail__item.is-active .wa-count { background: var(--wa-yellow); color: var(--wa-ink); }
}

/* =====================================================================
   PAGINE DI GESTIONE (Progetti, Utenti)
   ===================================================================== */
.wa-page { max-width: 1120px; margin: 0 auto; padding: 36px 32px 64px; }
.wa-page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.wa-page__head h1 { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.035em; }
.wa-page__head p { margin: 8px 0 0; color: var(--wa-muted); font-size: 15px; max-width: 64ch; }
@media (max-width: 640px) {
    .wa-page { padding: 24px 16px 40px; }
    .wa-page__head h1 { font-size: 25px; }
}

.wa-card { background: var(--wa-surface); border: 1px solid var(--wa-line); border-radius: var(--wa-radius); }
.wa-card__body { padding: 22px 24px; }
.wa-card + .wa-card { margin-top: 16px; }
@media (max-width: 640px) { .wa-card__body { padding: 18px 16px; } }

/* ---------- Bottoni (come i bottoni del sito AF Digital) ---------- */
.wa-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px;
    border: 1px solid var(--wa-ink); border-radius: var(--wa-radius-sm);
    background: var(--wa-yellow); color: var(--wa-ink);
    font-family: var(--wa-font); font-size: 14px; font-weight: 600; line-height: 1;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .18s var(--wa-ease), transform .18s var(--wa-ease), box-shadow .18s var(--wa-ease);
}
.wa-btn:hover { background: var(--wa-yellow-hover); }
.wa-btn:active { transform: translateY(1px); }
.wa-btn:disabled, .wa-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.wa-btn i { font-size: 16px; }
.wa-btn--dark { background: var(--wa-ink); color: var(--wa-on-ink); }
.wa-btn--dark:hover { background: #3a3b33; }
.wa-btn--ghost { background: transparent; border-color: var(--wa-line); color: var(--wa-ink); }
.wa-btn--ghost:hover { background: var(--wa-paper-2); border-color: #c9c8bc; }
.wa-btn--danger { background: var(--wa-danger); border-color: var(--wa-danger); color: #fff; }
.wa-btn--danger:hover { background: #8f1d17; }
.wa-btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }

.wa-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--wa-muted); font-size: 19px; cursor: pointer;
    transition: background-color .18s var(--wa-ease), color .18s var(--wa-ease);
}
.wa-icon-btn:hover { background: var(--wa-paper-2); color: var(--wa-ink); }
.wa-icon-btn.is-on { background: var(--wa-yellow-soft); color: var(--wa-ink); }
.wa-icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Campi ---------- */
.wa-field { display: block; margin-bottom: 16px; border: 0; padding: 0; }
.wa-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--wa-ink); margin-bottom: 6px; }
.wa-input, .wa-select, .wa-textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--wa-line); border-radius: var(--wa-radius-sm);
    background: var(--wa-surface); color: var(--wa-ink);
    font-family: var(--wa-font); font-size: 15px;
    transition: border-color .18s var(--wa-ease), box-shadow .18s var(--wa-ease);
}
.wa-input::placeholder, .wa-textarea::placeholder { color: var(--wa-muted); }
.wa-input:hover, .wa-select:hover, .wa-textarea:hover { border-color: #c4c3b6; }
.wa-input:focus, .wa-select:focus, .wa-textarea:focus { outline: none; border-color: var(--wa-ink); box-shadow: 0 0 0 3px rgba(254, 203, 55, .55); }
.wa-select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2324251f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
}
.wa-hint { display: block; font-size: 13px; color: var(--wa-muted); margin-top: 6px; }
/* Suggerimento dentro un campo: non eredita il grassetto dell'etichetta */
.wa-field > .wa-hint { font-weight: 400; color: var(--wa-muted); margin: 6px 0 0; }
.wa-mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 13px; word-break: break-all; color: inherit; }

/* Interruttori (checkbox nel colore del marchio) */
input[type="checkbox"], input[type="radio"] { accent-color: var(--wa-ink); width: 18px; height: 18px; }

/* ---------- Tabelle ---------- */
.wa-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.wa-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--wa-muted); padding: 10px 12px; border-bottom: 1px solid var(--wa-line); }
.wa-table td { padding: 14px 12px; border-bottom: 1px solid var(--wa-line-2); vertical-align: middle; }
.wa-table tr:last-child td { border-bottom: 0; }
.wa-table small { color: var(--wa-muted); font-size: 13px; }
.wa-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--wa-paper-2); color: var(--wa-ink); white-space: nowrap; }
.wa-pill--ok { background: var(--wa-ok-soft); color: #1f5a31; }
.wa-pill--off { background: var(--wa-danger-soft); color: #8f1d17; }
.wa-pill--brand { background: var(--wa-yellow-soft); color: var(--wa-ink); }
@media (max-width: 720px) {
    .wa-table thead { display: none; }
    .wa-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--wa-line-2); }
    .wa-table tr:last-child { border-bottom: 0; }
    /* Telefono: ogni riga diventa una scheda; etichetta a sinistra, valore (anche su più righe) a destra */
    .wa-table, .wa-table tbody { display: block; width: 100%; }
    .wa-table td { display: block; position: relative; min-height: 26px; border: 0; padding: 5px 0 5px 112px; overflow-wrap: anywhere; }
    .wa-table td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: 100px; font-size: 12px; color: var(--wa-muted); }
    .wa-table td[data-label=""] { padding-left: 0; padding-top: 10px; }
    .wa-table td[colspan] { padding-left: 0; }
}

/* ---------- Finestre (Bootstrap modal) nel marchio ---------- */
.modal-backdrop.show { opacity: .45; background: var(--wa-ink); }
.modal-content { border: 0; border-radius: 8px; box-shadow: var(--wa-shadow-pop); background: var(--wa-surface); }
.modal-header { border-bottom: 1px solid var(--wa-line-2); padding: 18px 22px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-footer { border-top: 1px solid var(--wa-line-2); padding: 14px 22px; gap: 8px; }
.modal-footer > * { margin: 0; }
.btn-close:focus { box-shadow: 0 0 0 3px rgba(254, 203, 55, .7); }
.dropdown-menu { border: 1px solid var(--wa-line); border-radius: var(--wa-radius); box-shadow: var(--wa-shadow-pop); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: var(--wa-radius-sm); padding: 9px 12px; color: var(--wa-ink); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--wa-paper-2); color: var(--wa-ink); }
.dropdown-item:active { background: var(--wa-yellow); color: var(--wa-ink); }

/* ---------- Loader globale ---------- */
.wa-loader {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    background: rgba(36, 37, 31, .32);
}
.wa-loader.is-open { display: flex; animation: waFade .18s var(--wa-ease); }
.wa-loader__box { background: var(--wa-surface); border-radius: var(--wa-radius); padding: 16px 20px; display: flex; align-items: center; gap: 12px; box-shadow: var(--wa-shadow-pop); font-size: 14px; font-weight: 500; }
.wa-spinner { width: 20px; height: 20px; border: 3px solid var(--wa-yellow-soft); border-top-color: var(--wa-ink); border-radius: 50%; animation: waSpin .75s linear infinite; }
@keyframes waSpin { to { transform: rotate(360deg); } }
@keyframes waFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.wa-toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 2100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.wa-toast {
    display: flex; align-items: flex-start; gap: 10px;
    min-width: 260px; max-width: 420px; padding: 13px 16px;
    border-radius: var(--wa-radius); background: var(--wa-ink); color: var(--wa-on-ink); font-size: 14px;
    box-shadow: var(--wa-shadow-pop);
    animation: waToastIn .26s var(--wa-ease);
}
.wa-toast i { font-size: 18px; line-height: 1.15; color: var(--wa-on-ink-2); }
.wa-toast--ok i { color: var(--wa-yellow); }
.wa-toast--err { background: #7d1a14; }
.wa-toast--err i { color: #ffd2cc; }
.wa-toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes waToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .wa-toast-wrap { left: 16px; right: 16px; bottom: calc(var(--wa-bar-h) + 12px + env(safe-area-inset-bottom)); } .wa-toast { min-width: 0; max-width: none; } }

/* ---------- Zona di caricamento (solo trascinando, toccando o incollando: mai pulsanti "sfoglia") ---------- */
.wa-drop {
    border: 1.5px dashed #bdbcae; border-radius: var(--wa-radius);
    padding: 18px; text-align: center; color: var(--wa-muted); font-size: 14px;
    background: var(--wa-surface); cursor: pointer;
    transition: border-color .18s var(--wa-ease), background-color .18s var(--wa-ease), color .18s var(--wa-ease);
}
.wa-drop:hover, .wa-drop.is-over { border-color: var(--wa-ink); background: var(--wa-yellow-soft); color: var(--wa-ink); }
.wa-drop i { font-size: 24px; display: block; margin-bottom: 4px; color: var(--wa-ink); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
