/* =============================================================================
   app.css - CertifyWebContent App - MVP v3.1
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:    #8b1a1a;
    --color-primary-dk: #6b1414;
    --color-bg:         #f4f4f4;
    --color-surface:    #ffffff;
    --color-border:     #ddd;
    --color-text:       #222;
    --color-muted:      #666;
    --color-error:      #c0392b;
    --color-success:    #27ae60;
    --radius:           6px;
    --shadow:           0 2px 8px rgba(0,0,0,.08);
    --font:             'Segoe UI', Arial, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* =============================================================================
   HEADER
   ============================================================================= */

.site-header {
    background: var(--color-surface);
    border-bottom: 3px solid var(--color-primary);
    padding: 12px 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand-main { font-size: 16px; font-weight: 700; color: var(--color-primary); }
.brand-sub  { font-size: 11px; color: var(--color-muted); letter-spacing: .5px; }

.site-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-nav a:not(.btn) {
    font-size: 14px;
    color: var(--color-text);
}
.site-nav a:not(.btn):hover { color: var(--color-primary); text-decoration: none; }
.nav-admin { color: var(--color-primary) !important; font-weight: 600; }
.nav-user { font-size: 13px; color: var(--color-muted); }

/* =============================================================================
   MAIN & FOOTER
   ============================================================================= */

.site-main { flex: 1; padding: 32px 0; }

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
}
.footer-legal { margin-top: 6px; font-size: 11px; }

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dk); text-decoration: none; color: #fff; }
.btn-outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn-sm  { padding: 5px 12px; font-size: 13px; }
.btn-lg  { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; text-align: center; display: block; }

/* =============================================================================
   ALERTS
   ============================================================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error   { background: #fdf0ef; border-color: var(--color-error); color: var(--color-error); }
.alert-success { background: #edfaf3; border-color: var(--color-success); color: var(--color-success); }

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139,26,26,.1);
}
.form-hint { font-size: 12px; color: var(--color-muted); margin-top: 4px; display: block; }

/* OTP input centrato e grande */
.form-group-otp input {
    font-size: 28px;
    text-align: center;
    letter-spacing: 10px;
    font-family: monospace;
    font-weight: 700;
}

/* =============================================================================
   AUTH PAGES
   ============================================================================= */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}
.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    border-top: 4px solid var(--color-primary);
}
.auth-logo { margin-bottom: 24px; }
.auth-logo .brand-main { font-size: 14px; font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: 1px; }
.auth-logo .brand-sub  { font-size: 12px; color: var(--color-muted); }
.auth-title    { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--color-muted); margin-bottom: 24px; }
.auth-form     { margin-top: 24px; }
.auth-notice   { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-muted); }

/* =============================================================================
   HOME HERO
   ============================================================================= */

.home-hero { background: var(--color-primary); color: #fff; padding: 60px 0; }
.home-hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero-tagline { font-size: 16px; font-style: italic; opacity: .85; margin-bottom: 12px; }
.hero-sub { font-size: 15px; opacity: .8; margin-bottom: 28px; max-width: 600px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.15); }
.home-notice { margin-top: 24px; background: #fff3cd; border: 1px solid #ffc107; border-radius: var(--radius); padding: 14px 18px; font-size: 13px; }

/* =============================================================================
   DASHBOARD / CARDS
   ============================================================================= */

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--color-primary); }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .home-hero { padding: 40px 0; }
    .home-hero h1 { font-size: 24px; }
}



/* =============================================================================
   AGGIUNTA A app.css - Stili S3
   Aggiungere in fondo al file app.css esistente
   ============================================================================= */

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
    border-top: 3px solid var(--color-border);
}
.stat-card--green  { border-top-color: var(--color-success); }
.stat-card--yellow { border-top-color: #f39c12; }
.stat-card--orange { border-top-color: #e67e22; }
.stat-number { display: block; font-size: 32px; font-weight: 700; color: var(--color-text); }
.stat-label  { display: block; font-size: 12px; color: var(--color-muted); margin-top: 4px; }

/* CARD HEADER */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header .card-title { margin-bottom: 0; }

/* TABLE */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--color-border); font-size: 12px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .5px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.uuid-cell code { font-size: 12px; color: var(--color-muted); }

/* BADGES */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-type    { background: #e8f0fe; color: #1a73e8; }
.badge-green   { background: #e6f4ea; color: var(--color-success); }
.badge-yellow  { background: #fef9e7; color: #f39c12; }
.badge-red     { background: #fdecea; color: var(--color-error); }
.badge-gray    { background: #f1f3f4; color: var(--color-muted); }
.badge-blue    { background: #e3f2fd; color: #1565c0; }
.badge-orange  { background: #fff3e0; color: #e65100; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px 20px; color: var(--color-muted); }
.empty-state p { margin-bottom: 16px; }

/* TEXT UTILITIES */
.text-muted { color: var(--color-muted); }
.text-sm    { font-size: 13px; }

/* NOTICE BOX */
.notice-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 13px;
    margin-bottom: 20px;
}

/* CONTAINER NARROW */
.container--narrow { max-width: 720px; }

/* TYPE GRID (nuova richiesta) */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.type-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.type-card input[type="radio"] { display: none; }
.type-card:hover { border-color: var(--color-primary); }
.type-card--selected { border-color: var(--color-primary); background: #fdf5f5; }
.type-card-label { font-weight: 700; font-size: 14px; color: var(--color-text); }
.type-card-hint  { font-size: 11px; color: var(--color-muted); }

/* INTAKE NOTICE */
.intake-notice {
    background: #f0f4ff;
    border: 1px solid #c5cae9;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 15px !important;
    margin-bottom: 20px;
    font-style: italic;
    color: #3949ab;
}

/* FORM ACTIONS */
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); }

/* CHECKBOX */
.form-group-check .checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; }
.form-group-check .checkbox-label input { margin-top: 3px; }

/* REQUEST GRID */
.request-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.request-main, .request-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* DETAIL LIST */
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 14px; }
.detail-list dt { color: var(--color-muted); font-weight: 600; }
.detail-list dd { margin: 0; }

/* HASH */
.uuid-full { font-size: 12px; color: var(--color-muted); display: block; margin-top: 4px; }
.hash-value { font-size: 11px; word-break: break-all; color: #333; }
.card--intake { border-top: 3px solid #3949ab; }
.intake-statement { font-style: italic; font-size: 13px; color: #3949ab; margin-bottom: 16px; }

/* FILE LIST */
.file-list { display: flex; flex-direction: column; gap: 12px; }
.file-item { padding: 10px; background: #f8f8f8; border-radius: var(--radius); }
.file-name { display: block; font-weight: 600; font-size: 14px; }
.file-meta { display: block; font-size: 12px; color: var(--color-muted); margin: 2px 0; }
.file-hash { font-size: 10px; word-break: break-all; color: #666; }

/* FEDIS */
.fedis-status { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.fedis-status--issued  { background: #e6f4ea; color: var(--color-success); }
.fedis-status--pending { background: #fef9e7; color: #856404; }
.fedis-disclaimer { color: var(--color-muted); font-style: italic; margin-top: 8px; }
.fedis-quote { padding: 12px; background: #f8f8f8; border-radius: var(--radius); font-size: 14px; }

/* TIMELINE */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-status { display: block; margin-bottom: 4px; }
.timeline-date { display: block; margin-bottom: 4px; }
.timeline-note { color: var(--color-muted); margin: 4px 0 0; }

/* RESPONSIVE S3 */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .type-grid  { grid-template-columns: repeat(2, 1fr); }
    .request-grid { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list dt { margin-bottom: -6px; }
}

/* =============================================================================
   PATCH S3 - aggiungere in fondo ad app.css
   Fix: font size globale, FEDIS checkbox, testi pagina dettaglio
   ============================================================================= */

/* 1+4. FONT SIZE - tutto più leggibile */
body                { font-size: 16px; }
.data-table         { font-size: 15px; }
.data-table th      { font-size: 13px; }
.form-hint          { font-size: 14px; }
.detail-list        { font-size: 15px; }
.hash-value         { font-size: 12px; }
.timeline           { font-size: 15px; }
.badge              { font-size: 12px; }
.intake-statement   { font-size: 14px; }
.card-title         { font-size: 18px; }
.auth-subtitle      { font-size: 15px; }
.notice-box         { font-size: 15px; }
.intake-notice      { font-size: 14px; }
.fedis-disclaimer   { font-size: 14px; }
.site-footer        { font-size: 13px; }
.footer-legal       { font-size: 12px; }
.text-sm            { font-size: 14px; }
.type-card-label    { font-size: 15px; }
.type-card-hint     { font-size: 13px; }
.nav-user           { font-size: 14px; }
.site-nav a         { font-size: 15px; }
.stat-label         { font-size: 13px; }
.uuid-cell code     { font-size: 13px; }
.uuid-full          { font-size: 13px; }

/* Intake hash - font monospace leggibile */
.hash-value {
    font-size: 12px;
    word-break: break-all;
    background: #f4f4f4;
    padding: 6px 10px;
    border-radius: 4px;
    display: block;
    line-height: 1.6;
    border: 1px solid #ddd;
}

/* Timestamp intake evidenziato */
.card--intake .detail-list dd code {
    font-size: 14px;
    font-weight: 700;
    color: #3949ab;
}

/* 2. FEDIS CHECKBOX - giallo chiaro, bordino rosso */
.form-group-check {
    background: #fffde7;
    border: 2px solid #8b1a1a;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
}
.form-group-check .checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 0;
}
.form-group-check .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #8b1a1a;
    flex-shrink: 0;
    margin: 0;
}
.form-group-check .form-hint {
    margin-top: 10px;
    padding-left: 32px;
    font-size: 13px;
    color: #555;
    font-style: italic;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity .15s, transform .15s;
    border-radius: 2px;
    overflow: hidden;
    text-decoration: none;
    padding: 0 2px;
}

.lang-flag:hover {
    opacity: 1;
    transform: scale(1.1);
    text-decoration: none;
}

.lang-flag.lang-active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--color-primary);
    border-radius: 3px;
}

.lang-flag img {
    display: block;
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.btn-support {
    background: #fff3cd;
    color: #8b1a1a;
    border: 2px solid #8b1a1a;
    border-radius: var(--radius);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
    letter-spacing: .3px;
}
.btn-support:hover {
    background: #8b1a1a;
    color: #fff;
}


.retention-notice {
    background-color: lightyellow;
	 border: 1px solid #ffcc02;
    border-left: 4px solid #f39c12;
    border-radius: var(--radius);
    padding: 14px 16px !important;
    margin-top: 12px;
    font-size: 15px;
    color: #555;
	margin-bottom: 15px;
}

.retention-notice strong {
    display: block;
    color: #333;
    margin-bottom: 6px;
    font-size: 13px;
}

.retention-notice p {
    margin: 0;
    line-height: 1.5;
}

.dapi-info-box {
    background: #fffde7 !important;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}
.dapi-info-box strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 6px;
}
.dapi-info-box p {
    margin: 0;
    line-height: 1.5;
}
.dapi-info-box a {
    color: var(--color-primary);
    font-weight: 600;
}