/**
 * AIF Lens — Frontend styles (activity selection)
 */

.aifl-as-container {
    max-width: 900px;
    margin: 24px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2c3e50;
}

.aifl-as-notice {
    max-width: 700px;
    margin: 24px auto;
    padding: 16px 20px;
    border-radius: 8px;
    text-align: center;
}
.aifl-as-notice-warning { background: #fff7e6; border: 1px solid #ffd8a8; color: #8a5300; }

/* ---- Header ---- */
.aifl-as-header {
    background: linear-gradient(135deg, #1a2a4a 0%, #2d5a8e 100%);
    color: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
}
.aifl-as-header h2 { margin: 0 0 4px; color: #fff; font-size: 1.6em; }
.aifl-as-subtitle { margin: 0 0 12px; color: #ffffff !important; opacity: 1; }
.aifl-as-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}
.aifl-as-badge-completed  { background: rgba(25,135,84,0.9); color: #fff; }
.aifl-as-badge-incomplete { background: rgba(243,156,18,0.9); color: #fff; }

/* ---- Feedback ---- */
.aifl-as-feedback {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 600;
}
.aifl-as-feedback-ok  { background: #f0faf5; border: 1px solid #b7e4c7; color: #155724; }
.aifl-as-feedback-err { background: #fff5f5; border: 1px solid #f5c2c7; color: #b32d2e; }

/* ---- Cards ---- */
.aifl-as-card {
    background: #fff;
    border: 1px solid #e3e9f1;
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 18px;
    box-shadow: none;
}
.aifl-as-card-title {
    margin: 0 0 12px;
    color: #1a2a4a;
    font-size: 1.15em;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f7;
}
.aifl-as-card-collab { border-left: 4px solid #2d5a8e; }
.aifl-as-required { color: #b32d2e; }
.aifl-as-muted { color: #6a7589; font-size: 0.9em; }

/* ---- Search ---- */
.aifl-as-search-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
}
.aifl-as-search-wrap input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 9px 14px;
    border: 1px solid #d6deeb;
    border-radius: 8px;
    font-size: 0.95em;
}

/* ---- Collab list ---- */
.aifl-as-collab-list {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid #eef2f7;
    border-radius: 8px;
}
.aifl-as-collab-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f5;
}
.aifl-as-collab-row:last-child { border-bottom: 0; }
.aifl-as-collab-row-info small { color: #6a7589; }
.aifl-as-collab-row-radios { display: flex; gap: 8px; flex-shrink: 0; }
.aifl-as-collab-radio {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #d6deeb;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #6a7589;
}
.aifl-as-collab-radio input { margin: 0; }
.aifl-as-collab-radio:has(input:checked) { border-color: #2d5a8e; color: #1a2a4a; background: #eef4fc; }
.aifl-as-collab-radio-yes:has(input:checked) { border-color: #198754; color: #0f5132; background: #eafaf1; }
.aifl-as-collab-shortcut { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aifl-as-collab-set-all-no,
.aifl-as-save-btn {
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
}
.aifl-as-collab-set-all-no {
    background: #f0f2f5;
    color: #2d5a8e;
    padding: 8px 14px;
    border: 1px solid #d6deeb;
}

/* ---- Preferred list ---- */
.aifl-as-pref-list {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid #eef2f7;
    border-radius: 8px;
}
.aifl-as-pref-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
}
.aifl-as-pref-row:last-child { border-bottom: 0; }
.aifl-as-pref-row:hover { background: #f7f9fc; }
.aifl-as-pref-city { color: #6a7589; font-size: 0.88em; }
.aifl-as-pref-main { display: flex; align-items: center; gap: 10px; flex: 1; margin: 0; cursor: pointer; }

/* ---- Link "Vedi profilo" negli elenchi ---- */
.aifl-as-profile-link {
    flex-shrink: 0;
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 0.82em;
    font-weight: 600;
    color: #2d5a8e !important;
    background: #eef4fc;
    border: 1px solid #d3e2f3;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.aifl-as-profile-link:hover { background: #dce9fb; }
.aifl-as-collab-row-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Social toggles ---- */
.aifl-as-social-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.aifl-as-social-table th,
.aifl-as-social-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f2f5;
}
.aifl-as-social-table th:first-child,
.aifl-as-social-table td:first-child { text-align: left; }
.aifl-as-toggle { position: relative; display: inline-block; width: 46px; height: 26px; }
.aifl-as-toggle input { opacity: 0; width: 0; height: 0; }
.aifl-as-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccd3dd;
    border-radius: 26px;
    transition: 0.2s;
}
.aifl-as-toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px; width: 20px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.aifl-as-toggle input:checked + .aifl-as-toggle-slider { background: #198754; }
.aifl-as-toggle input:checked + .aifl-as-toggle-slider::before { transform: translateX(20px); }

/* ---- Save bar ---- */
.aifl-as-savebar {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);
    padding: 14px 0;
    text-align: center;
    border-top: 1px solid #eef2f7;
    margin-top: 8px;
}
.aifl-as-save-btn {
    background: linear-gradient(135deg, #2d5a8e 0%, #1a2a4a 100%);
    color: #fff;
    padding: 12px 32px;
    font-size: 1.05em;
}
.aifl-as-save-btn:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 600px) {
    .aifl-as-collab-row { flex-direction: column; align-items: flex-start; }
    .aifl-as-social-table { font-size: 0.85em; }
}

/* ============================================================
   Blocco 9 — Scaletta utente [aifl_user_schedule]
   ============================================================ */
.aifl-sched-wrap { max-width: 820px; margin: 0 auto; font-family: inherit; }
.aifl-sched-notice { padding: 16px; background: #f2f4f8; border-radius: 8px; text-align: center; color: #556; }
.aifl-sched-banner { background: #eef4fc; border: 1px solid #cfe0f5; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: .92em; }
.aifl-sched-header { padding: 8px 0 16px; border-bottom: 2px solid #eef1f6; margin-bottom: 18px; text-align: center; }
.aifl-sched-head-text h1 { margin: 0 0 2px; font-size: 1.6em; }
.aifl-sched-head-text p { margin: 0; color: #667; }
.aifl-sched-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.aifl-sched-pdf-btn { display: inline-block; background: #2d5a8e; color: #fff !important; text-decoration: none; padding: 11px 20px; border-radius: 8px; font-weight: 600; }
.aifl-sched-pdf-btn:hover { background: #24497a; }
.aifl-sched-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; justify-content: center; }
.aifl-sched-tab { background: #f2f4f8; border: 1px solid #dde2ea; border-radius: 8px; padding: 9px 20px; cursor: pointer; font-size: .95em; line-height: 1.3; text-align: center; }
.aifl-sched-tab.active { background: #2d5a8e; color: #fff; border-color: #2d5a8e; }
.aifl-sched-tab strong { display: block; font-size: 1em; font-weight: 700; }
.aifl-sched-tab span { display: block; font-size: .78em; opacity: .75; font-weight: 400; }
.aifl-sched-card { background: #fff; border: 1px solid #eef1f6; border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.aifl-sched-card h2 { margin: 0 0 10px; font-size: 1.1em; }
.aifl-sched-list { list-style: none; margin: 0; padding: 0; }
.aifl-sched-list li { padding: 7px 0; border-bottom: 1px solid #f4f6f9; }
.aifl-sched-list li:last-child { border-bottom: none; }
.aifl-sched-time { display: inline-block; min-width: 104px; font-weight: 700; color: #2d5a8e; }
.aifl-sched-empty { color: #99a; font-style: italic; margin: 0; }

/* ---- Avviso "ricordati di salvare" (selezione attività) ---- */
.aifl-as-savenotice {
    background: #eef4fc;
    border: 1px solid #cfe0f5;
    border-left: 4px solid #2d5a8e;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.aifl-as-savenotice strong { display: block; margin-bottom: 4px; color: #1a2a4a; }
.aifl-as-savenotice p { margin: 0; font-size: 0.94em; line-height: 1.55; }

/* ---- Blocchi per rappresentante (stile Forum) ---- */
.aifl-as-rep-block { padding-top: 6px; }
.aifl-as-rep-title {
    text-align: center;
    font-size: 1.15em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f6;
    color: #1a2a4a;
}
.aifl-as-rep-inner {
    background: #f7f9fc;
    border: 1px solid #e7ecf3;
    border-radius: 10px;
    padding: 14px 16px;
}
.aifl-as-rep-section {
    text-align: center;
    font-weight: 700;
    color: #2d5a8e;
    background: #e8f0fb;
    border: 1px solid #d3e2f3;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 12px;
}
.aifl-as-rep-hint { font-size: .92em; margin: 0 0 10px; }

/* Elenco aziende a "riquadri" con evidenza selezione */
.aifl-as-pref-grid { background: #fff; border: 1px solid #e7ecf3; border-radius: 8px; padding: 8px; }
.aifl-as-pref-box {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    margin-bottom: 6px;
    padding: 9px 12px;
    background: #fff;
    transition: background .12s, border-color .12s;
}
.aifl-as-pref-box:last-child { margin-bottom: 0; }
.aifl-as-pref-box.selected { background: #e9f7ef; border-color: #62b98a; }
