/* ADI ASL Salerno – CV form */

* { box-sizing: border-box; }

:root {
    --primary: #0b5ed7;
    --primary-dark: #084298;
    --bg: #f5f6f8;
    --card: #ffffff;
    --border: #d8dde2;
    --text: #20232a;
    --muted: #6c757d;
    --success: #d1e7dd;
    --success-text: #0f5132;
    --error: #f8d7da;
    --error-text: #842029;
    --warn: #fff3cd;
    --warn-text: #664d03;
}

html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 15px;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

.topbar {
    background: var(--primary-dark);
    color: white;
    padding: 14px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand strong { font-size: 18px; }
.brand .muted { color: rgba(255,255,255,0.75); margin-left: 12px; font-size: 13px; }

.topnav a {
    color: white;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}
.topnav a:hover { border-bottom-color: white; }

main.container { padding-top: 28px; padding-bottom: 60px; }

.hero { background: white; border-radius: 10px; padding: 28px 32px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.hero h1 { margin-top: 0; font-size: 28px; color: var(--primary-dark); }
.hero .lead { font-size: 17px; color: #444; }

.info-box {
    background: #eef4ff;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: 14px 18px;
    margin: 16px 0;
}
.info-box.success { background: var(--success); border-color: var(--success-text); color: var(--success-text); }
.info-box.error { background: var(--error); border-color: var(--error-text); color: var(--error-text); }
.info-box p { margin: 4px 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Form */
.form-grid {
    display: flex; flex-direction: column; gap: 22px;
}
fieldset {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
fieldset.inner {
    background: #fbfbfd;
    margin-top: 14px;
    padding: 16px 18px;
}
legend {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 17px;
    padding: 0 8px;
}
fieldset.inner legend { font-size: 14px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.col { flex: 1 1 200px; }
.col-2 { flex: 2 1 320px; }

label.full, label.col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
label > span:first-child { font-weight: 600; font-size: 14px; color: #2a2f3a; }
.hint { font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11,94,215,0.12);
}
input[type="file"] {
    padding: 6px;
    font-size: 14px;
}

textarea { resize: vertical; min-height: 70px; }

label.checkbox {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0;
    cursor: pointer;
}
label.checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
}
label.checkbox span { font-weight: normal; font-size: 14px; color: #333; }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 4px 14px;
}

.actions { text-align: center; margin: 12px 0 24px; }

.btn-primary {
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    display: inline-block;
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 9px 18px;
    text-decoration: none;
    font-weight: 600;
}

.btn-link { color: var(--primary); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.privacy-section {
    margin-top: 24px;
    padding: 18px 22px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--muted);
}
.privacy-section h3 { margin-top: 0; font-size: 15px; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-size: 14px;
}
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table thead th { background: #eef2f7; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.data-table tbody tr:hover { background: #fafbfd; }
.data-table code { font-size: 12px; background: #f0f2f5; padding: 1px 6px; border-radius: 3px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ricevuto { background: #e2e3e5; color: #41464b; }
.badge-in_valutazione { background: var(--warn); color: var(--warn-text); }
.badge-accettato { background: var(--success); color: var(--success-text); }
.badge-rifiutato { background: var(--error); color: var(--error-text); }

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card.card-wide { grid-column: 1 / -1; }
.card h3 { margin-top: 0; color: var(--primary-dark); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.card dl { display: grid; grid-template-columns: 40% 60%; gap: 4px 12px; font-size: 14px; }
.card dt { font-weight: 600; color: #555; }
.card dd { margin: 0; }
.card ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }

.kpi-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kpi-list li {
    display: flex; justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted var(--border);
}
.kpi-value { font-weight: 700; color: var(--primary-dark); }

.doc-list { list-style: none; padding: 0; }
.doc-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.doc-list li:last-child { border-bottom: 0; }

/* Declaration cards (thank-you page) */
.declaration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 16px 0 20px;
}
.decl-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.decl-card h3 {
    font-size: 14px;
    margin: 0 0 6px 0;
    color: #2a2f3a;
    line-height: 1.3;
}
.decl-card p { margin: 0 0 12px 0; }
.decl-card .btn-secondary {
    text-align: center;
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
}
.decl-card.done {
    background: #f1f9f4;
    border-color: #b6dec1;
}
.decl-card.done h3 { color: var(--success-text); }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    margin-top: 30px;
    padding: 16px 0;
    background: white;
}

@media (max-width: 720px) {
    .row { flex-direction: column; gap: 10px; }
    .col, .col-2 { flex: 1 1 auto; }
    .hero { padding: 20px; }
    .hero h1 { font-size: 22px; }
}
