/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: #f4f6f8;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 28px 0 22px;
    text-align: center;
}

header img {
    /* max-height: 99px; */
    margin: 0 auto 18px;
    display: block;
}

img.img-logo {
    width: 100%;
    height: auto;
}

/* ── Title ──────────────────────────────────────────────────────────────────── */
h1 {
    font-size: 38px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.35;
    text-align: center;
    margin-bottom: 10px;
    width: 100%;
}

/* ── Search ─────────────────────────────────────────────────────────────────── */
.search-section { padding: 22px 0; }

.search-box {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 20px 24px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.search-form .field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.search-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-form input[type="text"] {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.search-form input[type="text"]:focus { border-color: #005fa3; }

.search-form .actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    padding: 9px 22px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn .material-symbols-outlined { font-size: 1.1rem; }

.btn-primary          { background: rgb(0, 0, 0);       color: #fff; }
.btn-primary:hover    { background: #333;                             }
.btn-secondary        { background: rgb(249, 197, 35);  color: #000; }
.btn-secondary:hover  { background: #e8b820;                          }

/* ── Main ───────────────────────────────────────────────────────────────────── */
main { flex: 1; padding: 32px 0; }

.results-count {
    font-size: 0.84rem;
    color: #777;
    margin-bottom: 12px;
    min-height: 1.2em;
}

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table-wrapper {
    border-radius: 6px;
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; min-width: 520px; }

thead tr { background: #000; }

th {
    text-align: left;
    padding: 13px 16px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    border-bottom: none;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0, 0, 0, 0.05); }

.col-name  { width: 28%; }
.col-desc  { width: 50%; }
.col-dl    { width: 22%; text-align: center; }

td.col-name { font-size: 18px; font-weight: 500; }
td.col-desc { font-size: 18px; font-weight: 400; }

.view-link, .dl-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
    text-decoration: none;
    transition: color 0.15s;
}

.view-link .material-symbols-outlined { font-size: 1.8rem; }
.view-link:hover { color: #005fa3; }
.dl-link .material-symbols-outlined { font-size: 1.8rem; }
.dl-link:hover { color: #005fa3; }

.no-results {
    text-align: center;
    padding: 48px 16px;
    color: #999;
    font-size: 0.95rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
footer {
    background: #000;
    padding: 18px 0;
    text-align: center;
    font-size: 0.82rem;
    color: #fff;
}

.footer-links { margin-top: 8px; }
.footer-sep   { margin: 0 8px; opacity: 0.5; }

.footer-link {
    background: none;
    border: none;
    color: #f9c523;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.footer-link:hover { color: #fff; }

/* ── Modali ──────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.is-open { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.modal-box--scrollable { max-width: 640px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    text-align: left;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0 2px;
}
.modal-close:hover { color: #222; }

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #333;
}

/* form login nel modale */
.modal-login-form .mform-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}
.modal-login-form label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.modal-login-form input[type="text"],
.modal-login-form input[type="password"] {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.94rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.modal-login-form input:focus { border-color: #005fa3; }
.btn-login-submit { width: 100%; margin-top: 6px; padding: 11px; justify-content: center; }
