/* Audit platform - stile comune a tutti gli audit.
   I colori del singolo audit arrivano da settings (colore_primario / colore_secondario)
   come variabili CSS --brand-1 / --brand-2, impostate in templates/layout/_head.php. */

:root {
    --brand-1: #e30613;
    --brand-2: #002e58;
    --ink: #1f2933;
    --muted: #5b6770;
    --paper: #ffffff;
    --soft: #f3f6f9;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    font-size: 0.95rem;
}

a { color: var(--brand-2); }
a:hover { color: var(--brand-1); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 60%, white); outline-offset: 2px; }

.btn-primary { background-color: var(--brand-1); border-color: var(--brand-1); }
.btn-primary:hover, .btn-primary:focus { background-color: color-mix(in srgb, var(--brand-1) 85%, white); border-color: color-mix(in srgb, var(--brand-1) 85%, white); }
.btn-primary:disabled { background-color: color-mix(in srgb, var(--brand-1) 30%, white); border-color: transparent; }
.btn-secondary { background-color: var(--brand-2); border-color: var(--brand-2); }
.btn-secondary:hover, .btn-secondary:focus { background-color: color-mix(in srgb, var(--brand-2) 80%, white); border-color: color-mix(in srgb, var(--brand-2) 80%, white); }

/* ---------------------------------------------------------------- pagine pubbliche */
.page-public {
    min-height: 100vh;
    background-color: var(--soft);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    padding: 2rem 1rem;
}
.public-main { max-width: 980px; margin: 0 auto; }
.public-main--wide { max-width: 1100px; }
.public-logo { max-width: min(420px, 90%); margin: 0 0 1.5rem; }
.card-students { border: 8px solid var(--brand-1); }
.card-directors { border: 8px solid var(--brand-2); }
.page-public .card { box-shadow: 0 6px 24px rgba(0, 20, 40, .12); }
.a_recover { color: var(--muted); text-decoration: none; }
.a_recover:hover { color: var(--brand-2); text-decoration: underline; }

/* ---------------------------------------------------------------- area riservata */
.app-topbar { background-color: var(--brand-1); }
.app-topbar .navbar-brand { padding: .25rem 1rem; background: rgba(0, 0, 0, .18); }
.app-topbar .navbar-brand img { max-height: 42px; }
.app-topbar__mob { max-height: 38px; }
.app-topbar__name { letter-spacing: .06em; }

.app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    padding: 56px 0 0;
    background-color: var(--brand-2);
    overflow-y: auto;
}
@media (max-width: 767.98px) { .app-sidebar { position: static; padding-top: 0; } }
.app-sidebar .nav-link { color: #fff; font-weight: 600; padding: .55rem 1rem; }
.app-sidebar .nav-link svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; }
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.app-sidebar .nav-link.active { background: rgba(255, 255, 255, .14); box-shadow: inset 4px 0 0 var(--brand-1); }
.app-sidebar__code { color: #fff; text-align: center; padding: 2rem 1rem; font-size: .9rem; }

.app-main { padding-bottom: 2rem; }
.app-logo { width: min(340px, 30%); margin: 2.5rem auto 2rem; }
.app-logo-mob { width: 92%; margin: 1rem auto; }
.app-content { max-width: 1100px; }
.app-content h2 { color: var(--brand-2); font-weight: 800; }
.app-footer { margin-top: 5rem; padding-top: 2rem; border-top: 2px solid #e3e8ee; text-align: center; font-size: .85rem; color: var(--muted); }
.app-footer img { max-width: 240px; }

.demo-banner { background: #ffc107; color: #222; text-align: center; padding: .4rem; font-weight: 700; position: relative; z-index: 1100; }

/* dashboard */
.box-responsabilita { background: var(--brand-1); color: #fff; border-radius: .5rem; padding: 1.25rem 1.5rem; font-weight: 700; text-align: center; }
.area-ecm { background: #eef5fb; border-radius: .75rem; padding: 1.5rem 1rem; }
.bubble img { max-width: 110px; }
.bubble__pct { font-size: 1.5rem; font-weight: 800; color: var(--brand-2); }
.bubble__label { font-weight: 700; text-transform: uppercase; font-size: .85rem; }
.bubble__label a { color: var(--brand-1); }
.prose { max-width: none; }
.prose h3, .prose h4, .prose h5 { color: var(--brand-2); font-weight: 800; margin-top: 1.5rem; }
.prose .red, .red { color: var(--brand-1); }
.cronoprogramma li { margin-bottom: .6rem; }

/* comitato */
.committee-card { height: 100%; text-align: center; border: 0; box-shadow: 0 2px 12px rgba(0, 20, 40, .08); }
.committee-card img, .committee-card .avatar { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; margin: 1.25rem auto .5rem; }
.committee-card .avatar { display: flex; align-items: center; justify-content: center; background: var(--brand-2); color: #fff; font-size: 2.5rem; font-weight: 800; }
.committee-card .qualifica { color: var(--brand-1); font-weight: 700; font-size: .85rem; }

/* verifica */
.vq-section { color: var(--brand-2); font-weight: 800; margin: 1.5rem 0 .25rem; }
.sv-root-modern .sv-btn { background-color: var(--brand-1); }
.sv-root-modern .sv-container-modern__title h3 { color: var(--brand-1); font-weight: 800; }
.sv-root-modern .sv-title { color: var(--brand-2); }
.sv-root-modern .sv-question__header--location--left { width: 70% !important; }
.sv-root-modern .sv-row { border-bottom: 1px solid #dde3ea; padding: .4rem 0; }
table.table-verifica td:nth-child(3), table.table-verifica td:nth-child(4) { text-align: center; white-space: nowrap; }
.row-section td { background: var(--soft); font-weight: 800; color: var(--brand-2); }

/* admin */
.page-admin { background: var(--soft); }
.admin-main .card { border: 0; box-shadow: 0 2px 10px rgba(0, 20, 40, .06); }
.admin-main table { font-size: .85rem; background: #fff; }
.admin-main th { white-space: nowrap; }
.ok { color: #198754; font-weight: 700; }
.ko { color: #b02a37; }
.content-editor { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; min-height: 420px; }

@media print {
    .app-sidebar, .app-topbar, .navbar, .no-print { display: none !important; }
    .app-main { margin: 0 !important; width: 100% !important; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.text-uppercase::placeholder { text-transform: none; }
.sv-root-modern, .sv-root-modern * { font-family: 'Nunito', system-ui, sans-serif; }
@media (max-width: 575.98px) { .app-topbar__name { font-size: .8rem; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* Campi dei questionari SurveyJS "a casella" (bordati) invece che a sola riga */
.sv-root-modern .sv-text,
.sv-root-modern .sv-comment,
.sv-root-modern .sv-dropdown {
  border: 1px solid #ced4da;
  border-radius: .375rem;
  padding: .45rem .75rem;
  background-color: #fff;
  box-shadow: none;
}
.sv-root-modern .sv-comment { min-height: 6rem; }
.sv-root-modern .sv-text:focus,
.sv-root-modern .sv-comment:focus,
.sv-root-modern .sv-dropdown:focus {
  border-color: var(--audit-primary, #0d6efd);
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}
/* Firma: il riquadro occupa tutta la larghezza disponibile */
.sv-root-modern .sjs_sp_container { width: 100% !important; max-width: 100%; }
.sv-root-modern .sjs_sp_container canvas { width: 100% !important; border: 1px solid #ced4da; border-radius: .375rem; background: #fff; }
