/* Area partecipanti — stile coerente col brand della landing Giusti Wine. */
:root {
    --bg: #fbfbfb;
    --surface: #ffffff;
    --tone: #f2f2f2;
    --ink: #101010;
    --muted: #696969;
    --line: rgba(16, 16, 16, 0.12);
    --wine: #5c1417;
    --gold: #b89764;
    --ok: #1f7a44;
    --err: #9b2226;
    --radius-sm: 6px;
    --radius-md: 10px;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(92, 20, 23, 0.10), transparent 60%),
        var(--bg);
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

.wrap {
    width: min(calc(100% - 40px), 560px);
    margin: 0 auto;
    padding: clamp(48px, 9vh, 96px) 0 64px;
}
.wrap-wide { max-width: 1040px; }

.brandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.brandbar a { color: var(--muted); font-size: .8rem; font-weight: 600; }
.eyebrow {
    margin: 0 0 6px;
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .72rem;
    color: var(--gold);
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.07);
    padding: clamp(28px, 5vw, 44px);
}

h1 {
    font-family: "Outfit", sans-serif;
    font-weight: 800;
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
    line-height: 1.05;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
h2 {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0 0 14px;
}
.sub { color: var(--muted); margin: 0 0 26px; }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 7px;
}
.field input[type=email],
.field input[type=password],
.field input[type=text],
.field textarea,
.field select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 1rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(92, 20, 23, 0.12);
}
.field textarea { resize: vertical; min-height: 96px; }
.hint { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--wine);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .15s var(--ease), opacity .2s var(--ease), background .2s var(--ease);
}
.btn:hover { background: #4a1013; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--tone); }
.btn-auto { width: auto; }

.linkrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-size: .88rem;
}
.linkrow button.linklike {
    background: none; border: none; padding: 0;
    color: var(--wine); font: inherit; cursor: pointer; text-decoration: underline;
}

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: .92rem;
    border: 1px solid transparent;
}
.alert-ok  { background: rgba(31, 122, 68, 0.10); border-color: rgba(31, 122, 68, 0.30); color: #155c33; }
.alert-err { background: rgba(155, 34, 38, 0.08); border-color: rgba(155, 34, 38, 0.30); color: var(--err); }
.alert-info{ background: rgba(184, 151, 100, 0.12); border-color: rgba(184, 151, 100, 0.35); color: #6b5326; }

/* Dashboard */
.tile {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    background: var(--surface);
    margin-bottom: 18px;
}
.tile h2 { margin-bottom: 6px; }
.tile p.muted { color: var(--muted); margin: 0 0 16px; }
.videolist { list-style: none; padding: 0; margin: 0; }
.videolist li { border-top: 1px solid var(--line); }
.videolist li:first-child { border-top: none; }
.videolist a {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 14px 2px; color: var(--ink); font-weight: 600;
}
.videolist a:hover { color: var(--wine); text-decoration: none; }
.videolist .arrow { color: var(--gold); }

.q { margin-bottom: 24px; }
.q .qlabel { font-weight: 600; margin-bottom: 10px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.opt input { width: auto; }
.rating { display: flex; gap: 8px; flex-wrap: wrap; }
.rating label {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 9px 15px; cursor: pointer; user-select: none;
}
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating input:checked + span,
.rating label:hover { }
.rating label:has(input:checked) { background: var(--wine); color: #fff; border-color: var(--wine); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 26px; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge-yes { background: rgba(31,122,68,.12); color: #155c33; }
.badge-no  { background: var(--tone); color: var(--muted); }
.bar { background: var(--tone); border-radius: 999px; height: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--wine); }
.stat-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin: 8px 0; }
.stat-row .lab { font-size: .88rem; }
.answers { margin: 0; padding: 0; list-style: none; }
.answers li { padding: 10px 12px; background: var(--tone); border-radius: var(--radius-sm); margin-bottom: 8px; }
.admin-grid { display: grid; gap: 24px; }
@media (min-width: 860px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
