/* Fantacalcio 2026/27 · design system (vedi DESIGN.md) */
:root {
	--bg:          oklch(0.125 0.018 251.8);
	--surface:     oklch(0.165 0.022 251.8);
	--surface-2:   oklch(0.20 0.024 251.8);
	--line:        oklch(0.27 0.025 251.8);
	--ink:         oklch(0.96 0.008 251.8);
	--muted:       oklch(0.74 0.03 251.8);
	--brand:       oklch(0.478 0.136 251.8);
	--brand-bright: oklch(0.56 0.15 251.8);
	--brand-deep:  oklch(0.38 0.14 251.8);
	--accent:      oklch(0.80 0.13 62);
	--accent-ink:  oklch(0.25 0.05 62);
	--good-bg:     oklch(0.55 0.13 145);
	--good-ink:    oklch(0.96 0.02 145);
	--warn-bg:     oklch(0.80 0.13 70);
	--warn-ink:    oklch(0.25 0.05 70);
	--danger-bg:   oklch(0.55 0.15 25);
	--danger-ink:  oklch(0.96 0.02 25);
	--display: "Archivo Black", "Arial Black", sans-serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.55 var(--sans);
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.container { max-width: 1120px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

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

button { font: inherit; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- NAV ---------- */
.nav {
	position: sticky; top: 0; z-index: 100;
	background: color-mix(in oklch, var(--bg) 82%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}
.nav-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; padding-block: 0.9rem;
}
.logo {
	display: flex; align-items: center; gap: 0.65rem;
	font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.02em;
	color: var(--ink); text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
	display: grid; place-items: center;
	width: 2.1rem; height: 2.1rem; border-radius: 8px;
	background: var(--brand); color: white;
	font-size: 1rem;
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--ink); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	border: none; cursor: pointer;
	padding: 0.7rem 1.3rem; border-radius: 10px;
	font-weight: 600; font-size: 0.95rem;
	transition: background 0.18s var(--ease), transform 0.18s var(--ease);
	text-decoration: none;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-bright); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: oklch(0.85 0.13 62); text-decoration: none; }
.btn-success { background: var(--good-bg); color: var(--good-ink); }
.btn-success:hover { background: oklch(0.62 0.13 145); text-decoration: none; }
.btn-danger { background: var(--danger-bg); color: white; }
.btn-danger:hover { background: oklch(0.62 0.15 25); text-decoration: none; }

/* ---------- HERO ---------- */
.hero {
	padding: clamp(4rem, 10vw, 7rem) 0 0;
	text-align: center;
}
.hero .container > * { max-width: 820px; margin-inline: auto; }
.hero-kicker {
	display: inline-flex; align-items: center; gap: 0.5rem;
	color: var(--accent); font-weight: 700; font-size: 0.85rem;
	letter-spacing: 0.12em; text-transform: uppercase;
	margin-bottom: 1.2rem;
}
.hero-kicker::before,
.hero-kicker::after {
	content: ""; display: block; width: 2.4rem; height: 1px; background: var(--line);
}
.hero h1 {
	font-family: var(--display); font-weight: 400;
	font-size: clamp(2.4rem, 6.5vw, 4.2rem);
	line-height: 1.04; letter-spacing: -0.01em;
	text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
	margin-top: 1.2rem; color: var(--muted);
	font-size: clamp(1.05rem, 2.2vw, 1.25rem);
	text-wrap: pretty;
}
.hero-cta { display: flex; justify-content: center; gap: 0.9rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-badge {
	display: inline-flex; align-items: center; gap: 0.45rem;
	margin-top: 2rem; padding: 0.45rem 0.9rem; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--line); color: var(--muted);
	font-size: 0.9rem;
}
.hero-badge .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.hero-content {
	margin-top: 2.5rem; text-align: left;
}
.hero-content h2 {
	font-family: var(--display); font-weight: 400;
	font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.15;
	margin-top: 2rem; margin-bottom: 0.6rem;
}
.hero-content p { margin-bottom: 1rem; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.hero-content ul, .hero-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.hero-content li { margin-bottom: 0.4rem; color: var(--muted); line-height: 1.6; }
.hero-content strong { color: var(--ink); }
.hero-content hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

.payment-cards {
	display: grid; gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.payment-card {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 0.8rem 1.2rem;
	text-align: left;
}
.payment-card summary {
	cursor: pointer; list-style: none;
	display: flex; align-items: center; justify-content: space-between;
}
.payment-card summary::-webkit-details-marker { display: none; }
.payment-card summary::after {
	content: "+"; font-size: 1.2rem; color: var(--muted); line-height: 1;
}
.payment-card[open] summary::after {
	content: "-";
}
.payment-card h4 { font-family: var(--display); font-weight: 400; font-size: 1rem; margin: 0; }
.payment-detail { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.payment-detail strong { color: var(--ink); }

/* ---------- STAT STRIP ---------- */
.stat-strip {
	display: grid; grid-template-columns: repeat(3, 1fr);
	max-width: 820px; margin: 3.2rem auto 0;
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--surface); overflow: hidden;
}
.stat { padding: 1.4rem 1rem; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-value {
	font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.2rem);
	line-height: 1;
}
.stat-label { margin-top: 0.45rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- MANAGEMENT ---------- */
.manage { padding: clamp(4rem, 8vw, 6rem) 0; }
.manage-head {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.manage h2 {
	font-family: var(--display); font-weight: 400;
	font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; text-wrap: balance;
}
.manage-head p { color: var(--muted); margin-top: 0.6rem; max-width: 56ch; text-wrap: pretty; }
.manage-layout {
	display: grid; gap: 1.6rem;
	grid-template-columns: 360px 1fr;
	align-items: start;
}

/* form */
.form-card {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 1.6rem;
	position: sticky; top: 5.5rem;
}
.form-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.1rem; margin-bottom: 0.4rem; }
.form-card > p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.3rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.field-error {
	display: flex; align-items: center; gap: 0.4rem;
	margin-top: 0.35rem;
	color: var(--danger-ink); font-size: 0.8rem; font-weight: 600;
}
.field-error::before {
	content: "\26A0"; flex: 0 0 auto;
	color: var(--danger-bg); font-size: 0.9rem; line-height: 1;
}
.field .req { color: var(--accent); }
.field input, .field select {
	width: 100%; padding: 0.65rem 0.8rem;
	background: var(--surface-2); color: var(--ink);
	border: 1px solid var(--line); border-radius: 8px;
	font: inherit; font-size: 0.95rem;
	transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.field input:focus, .field select:focus {
	outline: none; border-color: var(--accent); background: color-mix(in oklch, var(--surface-2) 90%, var(--accent) 10%);
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input[type="checkbox"] {
	width: auto; padding: 0; border: none; border-radius: 0;
	background: none; accent-color: var(--accent);
}
.field input[type="checkbox"]:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-msg { display: none; margin-top: 0.9rem; font-size: 0.9rem; }
.form-msg.error { display: block; color: var(--accent); }

/* roster */
.roster-tools { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search {
	flex: 1; min-width: 180px;
	padding: 0.6rem 0.9rem;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 999px;
	font: inherit; font-size: 0.92rem;
}
.search:focus { outline: none; border-color: var(--accent); }
.filters { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
	padding: 0.5rem 0.95rem; border-radius: 999px;
	border: 1px solid var(--line); background: var(--surface);
	color: var(--muted); cursor: pointer; font-size: 0.85rem; font-weight: 600;
	transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--brand); border-color: var(--brand); color: white; }
.chip[data-count]::after { content: " " attr(data-count); opacity: 0.6; font-weight: 400; }

.roster {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); overflow: hidden;
}
.roster-list { list-style: none; }
.roster-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.roster-empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 0.3rem; }

.player {
	display: grid; align-items: center; gap: 0.8rem 1.2rem;
	grid-template-columns: 1fr auto auto;
	padding: 1rem 1.2rem;
	transition: background 0.15s var(--ease);
	opacity: 0;
	transform: translateY(6px);
	animation: row-in 0.35s var(--ease) forwards;
}
@keyframes row-in { to { opacity: 1; transform: none; } }
.player + .player { border-top: 1px solid var(--line); }
.player:hover { background: var(--surface-2); }
.player.out { opacity: 0.55; }
.player-main { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.avatar {
	flex: none; display: grid; place-items: center;
	width: 2.7rem; height: 2.7rem; border-radius: 50%;
	background: color-mix(in oklch, var(--brand) 35%, var(--surface-2));
	color: var(--ink); font-weight: 700; font-size: 0.85rem;
}
.player-name { font-weight: 700; font-size: 0.98rem; line-height: 1.2; }
.player-sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.player-meta { text-align: right; }
.player-meta .quota { font-family: var(--display); font-weight: 400; font-size: 1rem; }
.player-actions { display: flex; gap: 0.45rem; }

.icon-btn {
	display: grid; place-items: center;
	width: 2.3rem; height: 2.3rem; border-radius: 8px;
	border: 1px solid var(--line); background: var(--surface);
	color: var(--muted); cursor: pointer; font-size: 0.95rem;
	transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: white; border-color: transparent; }

.badge {
	display: inline-flex; align-items: center; gap: 0.4rem;
	padding: 0.28rem 0.7rem; border-radius: 999px;
	font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.badge.pagato   { background: var(--good-bg);  color: var(--good-ink); }
.badge.attesa   { background: var(--warn-bg);  color: var(--warn-ink); }
.badge.ritirato { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.badge.ritirato::before { background: var(--muted); }

/* ---------- AUTH ---------- */
.auth-section { padding: clamp(3rem, 8vw, 5rem) 0; }
.auth-card { max-width: 560px; margin-inline: auto; text-align: center; }
.auth-card h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; }
.auth-sub { color: var(--muted); margin: 0.6rem 0 2rem; text-wrap: pretty; }
.auth-alert { margin-bottom: 1.2rem; padding: 0.75rem 1rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: 0.9rem; }
.auth-card form { text-align: left; }
.auth-card .btn-block { width: 100%; }
.remember { display: flex; align-items: center; gap: 0.4rem; font-weight: 400 !important; color: var(--muted); font-size: 0.9rem; }
.remember input { width: auto; }
.auth-switch { margin-top: 1.1rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- FOOTER ---------- */
footer { margin-top: auto; border-top: 1px solid var(--line); padding: 2.2rem 0; }
.footer-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem;
}
.footer-inner .logo { font-size: 0.95rem; }

/* ---------- TOAST ---------- */
.toast-wrap {
	position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
	z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
	pointer-events: none;
}
.toast {
	pointer-events: auto;
	background: var(--ink); color: var(--bg);
	padding: 0.65rem 1.1rem; border-radius: 10px;
	font-size: 0.9rem; font-weight: 600;
	box-shadow: 0 10px 30px oklch(0 0 0 / 0.4);
	animation: toast-in 0.25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 900px) {
	.manage-layout { grid-template-columns: 1fr; }
	.form-card { position: static; }
	.nav-links a:not(.btn) { display: none; }
}

@media (max-width: 560px) {
	.stat-strip { grid-template-columns: 1fr; }
	.stat + .stat { border-left: none; border-top: 1px solid var(--line); }
	.player { grid-template-columns: 1fr auto; }
	.player-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
