/* ——————————————————————————————————————
   Informacy — Palette
   Blu istituzionale, arancione ACLI, verde servizi
   —————————————————————————————————————— */

:root {
    /* Patronato ACLI — blu istituzionale */
    --blue-900:   #0f2847;
    --blue-700:   #1a3a6b;
    --blue-500:   #2b5597;
    --blue-100:   #e4ecf5;

    /* ACLI — arancione brand */
    --orange-600: #d46a1a;
    --orange-500: #e87722;
    --orange-400: #f08c3d;
    --orange-100: #fdf0e2;

    /* Verde servizi */
    --green-600:  #2d7a3e;
    --green-500:  #3a9150;
    --green-100:  #e6f4ea;

    /* Neutri */
    --ink:        #1e1e1e;
    --ink-light:  #3d4654;
    --ink-muted:  #6b7280;
    --paper:      #f5f6f8;
    --paper-alt:  #eceef2;
    --cream:      #e2e5eb;
    --rule:       #ced2da;
    --white:      #ffffff;
    --danger:     #b91c1c;

    /* Alias semantici */
    --accent:       var(--orange-500);
    --accent-hover: var(--orange-600);
    --primary:      var(--blue-700);
    --primary-dark: var(--blue-900);
    --success:      var(--green-600);

    --radius:     4px;
    --shadow:     0 1px 4px rgba(15,40,71,.08);
    --font-body:  -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-ui:    -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono:  'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
}

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

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.page-wrap--wide { max-width: 960px; }

/* Tipografia */
h1, h2, h3 {
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.25;
    color: var(--primary);
}
h1 { font-size: 1.65rem; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

small, .text-sm { font-size: .85rem; }
.text-muted { color: var(--ink-muted); }

hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 1.5rem 0;
}

code {
    font-family: var(--font-mono);
    font-size: .88em;
    background: var(--paper-alt);
    padding: .1rem .35rem;
    border-radius: 3px;
}

/* Pulsanti */
.btn {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1;
    padding: .7rem 1.4rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover {
    background: var(--paper-alt);
    border-color: var(--ink-muted);
    text-decoration: none;
}
.btn:active { background: var(--cream); }
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Pulsanti della scelta privacy: STESSA enfasi, stessa dimensione */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}
.choice-grid .btn {
    text-align: center;
    padding: 1rem 1.25rem;
    font-size: .92rem;
    border-color: var(--blue-500);
    color: var(--primary);
}
.choice-grid .btn:hover {
    background: var(--blue-100);
    border-color: var(--primary);
}

/* Card / box */
.card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

/* Notice box — accento arancione ACLI */
.notice {
    border-left: 3px solid var(--accent);
    padding: .75rem 1rem;
    background: var(--orange-100);
    margin: 1rem 0;
    font-size: .9rem;
}

/* Badge */
.badge {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .5rem;
    border-radius: 3px;
    vertical-align: middle;
}
.badge--tracked  { background: var(--orange-100); color: var(--orange-600); }
.badge--anon     { background: var(--green-100);  color: var(--green-600); }
.badge--neutral  { background: var(--cream);      color: var(--ink-light); }

/* Tabelle */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: .84rem;
    margin: 1rem 0;
}
th, td {
    text-align: left;
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--rule);
}
th {
    font-weight: 600;
    color: var(--primary);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--blue-100);
}
tr:hover td { background: var(--paper-alt); }

/* Form */
.form-group { margin: 1rem 0; }
label {
    display: block;
    font-family: var(--font-ui);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .3rem;
    color: var(--ink-light);
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    font-family: var(--font-ui);
    font-size: .88rem;
    padding: .55rem .7rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 2px rgba(43,85,151,.15);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    border-top: 3px solid var(--primary);
}
.stat-card__value {
    font-size: 1.7rem;
    font-weight: 700;
    font-family: var(--font-ui);
    color: var(--primary);
    line-height: 1.1;
}
.stat-card__label {
    font-family: var(--font-ui);
    font-size: .73rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: .3rem;
}

/* Alert */
.alert {
    font-family: var(--font-ui);
    font-size: .88rem;
    padding: .65rem 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}
.alert--success { background: var(--green-100); color: var(--green-600); border: 1px solid #b1d8bc; }
.alert--error   { background: #fde8e8; color: var(--danger); border: 1px solid #e8b8b8; }

/* Admin nav — sfondo blu ACLI */
.admin-nav {
    font-family: var(--font-ui);
    font-size: .84rem;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    background: var(--primary);
}
.admin-nav a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    padding: .35rem .65rem;
    border-radius: 3px;
    transition: background .12s, color .12s;
}
.admin-nav a:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.admin-nav a.active {
    background: rgba(255,255,255,.2);
    color: #fff;
    font-weight: 600;
}

/* Privacy bar fisso in basso */
.privacy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    border-top: 2px solid var(--accent);
    padding: .6rem 1rem;
    font-family: var(--font-ui);
    font-size: .8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    color: rgba(255,255,255,.85);
}
.privacy-bar a { color: var(--orange-400); }

/* Filtri inline */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: flex-end;
    margin: 1rem 0;
    font-family: var(--font-ui);
}
.filters .form-group { margin: 0; flex: 1; min-width: 120px; }
.filters .btn { align-self: flex-end; }

/* Demo content */
.demo-content { padding-bottom: 3rem; }
.coupon-box {
    background: var(--blue-100);
    border: 2px dashed var(--blue-500);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}
.coupon-box__code {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .15em;
    color: var(--primary);
    margin: .5rem 0;
}

/* Landing — sfondo sfocato (anteprima destinazione) */

/* Quando la landing ha lo sfondo, il body deve essere trasparente */
body.body--landing-bg {
    background: #111;
}

.landing-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}
.landing-bg__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(.55) saturate(.8);
    transform: scale(1.1); /* copre i bordi generati dal blur */
}

/* Il contenuto va sopra lo sfondo */
.landing--has-bg {
    position: relative;
    z-index: 1;
    color: var(--white);
}
.landing--has-bg h1,
.landing--has-bg h2 {
    color: var(--white);
    text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.landing--has-bg a {
    color: var(--orange-400);
}
.landing--has-bg .text-muted {
    color: rgba(255,255,255,.7);
}

/* Card con effetto vetro */
.card--glass {
    background: rgba(15, 40, 71, .68);
    border-color: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255,255,255,.92);
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.card--glass h2 {
    color: var(--white);
}
.card--glass .notice {
    background: rgba(255,255,255,.08);
    border-left-color: var(--orange-400);
    color: rgba(255,255,255,.85);
}
.card--glass .notice strong {
    color: var(--white);
}
.card--glass .text-muted {
    color: rgba(255,255,255,.65);
}
.card--glass a {
    color: var(--orange-400);
}
.card--glass .choice-grid .btn {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.35);
    color: var(--white);
}
.card--glass .choice-grid .btn:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.55);
}

/* Responsive */
@media (max-width: 600px) {
    html { font-size: 15px; }
    .page-wrap { padding: 1.5rem 1rem 4rem; }
    .choice-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filters { flex-direction: column; }
    .admin-nav { font-size: .78rem; gap: .2rem; padding: .4rem; }
}
