/* ═══════════════════════════════════════════════════════════
   A.S.D. Tresilicese — Design System
   Colori: Rosso #C8102E  Giallo/Oro #FFD700
═══════════════════════════════════════════════════════════ */

:root {
  --red:        #C8102E;
  --red-dark:   #9B0B22;
  --red-light:  #f9e5e8;
  --gold:       #FFD700;
  --gold-dark:  #c9a800;
  --text:       #1a1a1a;
  --text-muted: #6b6b6b;
  --bg:         #f8f8f8;
  --surface:    #ffffff;
  --border:     rgba(0,0,0,0.1);
  --radius:     0.75rem;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.13);
  --font-body:  'Outfit', sans-serif;
  --font-head:  'Oswald', sans-serif;
  --transition: 180ms cubic-bezier(0.16,1,0.3,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--bg); min-height: 100dvh; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }
.accent { color: var(--red); }
.text-muted { color: var(--text-muted); }
.mt-auto { margin-top: auto; }
.container { max-width: 1160px; margin-inline: auto; padding-inline: 1.25rem; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1.4rem; border-radius: 0.5rem; font-weight: 600;
  font-size: 0.95rem; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { border: 2px solid var(--red); color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--red); }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 2px solid var(--red);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-block: 0.85rem;
}
.logo {
  display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.03em; line-height: 1.2;
}
.main-nav {
  display: flex; align-items: center; gap: 0.25rem; margin-inline: auto;
}
.nav-link {
  padding: 0.4rem 0.85rem; border-radius: 0.4rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-link:hover { background: var(--red-light); color: var(--red); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.mobile-nav a { padding: 0.65rem 0; font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav.open { display: flex; }

@media (max-width: 768px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .btn-outline, .btn-ghost { display: none; }
}

/* ── FLASH MESSAGES ───────────────────────────────────────── */
.flash-container { position: fixed; top: 1rem; right: 1rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; max-width: 380px; }
.flash { padding: 0.8rem 1rem; border-radius: var(--radius); font-weight: 500; display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; box-shadow: var(--shadow-md); animation: slideIn 0.25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.flash-success { background: #d4f7d4; color: #1a5c1a; border-left: 4px solid #2e7d32; }
.flash-error   { background: #fde8e8; color: #7b1a1a; border-left: 4px solid var(--red); }
.flash-warning { background: #fff8d4; color: #5c4a00; border-left: 4px solid var(--gold-dark); }
.flash-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 0; line-height: 1; opacity: 0.6; flex-shrink: 0; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 60%, #1a0008 100%);
  color: #fff; padding: clamp(4rem, 10vw, 7rem) 1.25rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 60vh;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero-badge {
  display: inline-block; background: var(--gold); color: #1a1a1a;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 1rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero h1 {
  font-family: var(--font-head); font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.1; margin-bottom: 1rem; letter-spacing: 0.02em;
}
.hero h1 .accent { color: var(--gold); }
.hero p { font-size: clamp(1rem, 2vw, 1.2rem); opacity: 0.9; margin-bottom: 2rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,0.6); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.15); }
.hero-shape {
  position: absolute; bottom: -2px; left: 0; right: 0; height: 80px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* ── SPORTS ───────────────────────────────────────────────── */
.sports-section { padding: clamp(3rem, 6vw, 5rem) 1.25rem; }
.section-title {
  font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.4rem);
  text-align: center; margin-bottom: 2.5rem; letter-spacing: 0.03em;
}
.sports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.sport-card {
  background: var(--surface); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.sport-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.sport-icon { font-size: 2.5rem; }
.sport-card h3 { font-family: var(--font-head); font-size: 1.5rem; color: var(--red); }
.sport-card p { color: var(--text-muted); line-height: 1.6; }
.group-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.group-list li {
  background: var(--red-light); color: var(--red); font-size: 0.82rem;
  font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 999px;
}

/* ── NEWS ─────────────────────────────────────────────────── */
.news-section { background: var(--surface); padding: clamp(3rem, 6vw, 5rem) 1.25rem; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.news-card {
  background: var(--bg); border-radius: var(--radius); padding: 1.5rem;
  border: 1px solid var(--border); transition: box-shadow var(--transition);
}
.news-card:hover { box-shadow: var(--shadow-md); }
.news-tag { display: inline-block; background: var(--red); color: #fff; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.2rem 0.6rem; border-radius: 0.3rem; margin-bottom: 0.75rem; }
.news-card h4 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 0.5rem; }
.news-card p { color: var(--text-muted); font-size: 0.93rem; }

/* ── PARTNERS ─────────────────────────────────────────────── */
.partners-section { padding: clamp(2.5rem, 5vw, 4rem) 1.25rem; }
.partners-grid { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.partner-badge {
  background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 1.25rem 2rem; text-align: center; min-width: 200px;
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--red);
  display: flex; flex-direction: column; gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}
.partner-badge span { font-family: var(--font-body); font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

/* ── AUTH ─────────────────────────────────────────────────── */
.auth-section { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card {
  background: var(--surface); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem);
  width: 100%; max-width: 440px; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--red);
}
.auth-card-wide { max-width: 640px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header svg { margin: 0 auto 1rem; }
.auth-header h1 { font-family: var(--font-head); font-size: 1.8rem; color: var(--red); margin-bottom: 0.4rem; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.label-hint { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; margin-left: 0.4rem; }
.form-group input, .form-group textarea, .form-group select {
  padding: 0.65rem 0.9rem; border: 1.5px solid var(--border); border-radius: 0.5rem;
  font-size: 0.97rem; background: var(--bg); width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}
.form-group small { color: var(--text-muted); font-size: 0.78rem; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 2.8rem; }
.toggle-pwd { position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: 0.5; transition: opacity var(--transition); background: none; border: none; }
.toggle-pwd:hover { opacity: 1; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--red); }
.form-check label { font-size: 0.9rem; color: var(--text-muted); }
.auth-footer { text-align: center; margin-top: 1.25rem; color: var(--text-muted); font-size: 0.92rem; }
.auth-footer a { color: var(--red); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── DASHBOARD ────────────────────────────────────────────── */
.dashboard-section { padding: clamp(2rem, 5vw, 4rem) 1.25rem; }
.dashboard-section h1 { font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.35rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 2rem; }
.dash-card {
  background: var(--surface); border-radius: var(--radius); padding: 1.5rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.4rem; font-size: 1.4rem;
  transition: all var(--transition); cursor: pointer;
}
.dash-card:hover { border-color: var(--red); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card strong { font-size: 1rem; font-weight: 700; display: block; }
.dash-card span { font-size: 0.83rem; color: var(--text-muted); }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer { background: var(--text); color: #ccc; padding: 2.5rem 1.25rem; margin-top: auto; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.footer-brand strong { display: block; color: #fff; font-family: var(--font-head); font-size: 1.1rem; }
.footer-brand span { font-size: 0.8rem; color: #aaa; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: 0.78rem; color: #888; width: 100%; text-align: center; }

.footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.footer-social a:hover {
    background: #c8102e;
    transform: translateY(-2px);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}


/* ── LOGO IMMAGINE ────────────────────────────────────────── */
.logo-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 70%;
}

@media (max-width: 768px) {
  .logo-img {
    width: 38px;
    height: 38px;
  }
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.hero-logo {
  width: clamp(90px, 12vw, 140px);
  height: clamp(90px, 12vw, 140px);
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-danger {
  background: #c62828;
  color: #fff;
}
.btn-danger:hover {
  background: #a61f1f;
}

/* ── ADMIN ────────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--red-light);
  color: var(--red);
  font-weight: 700;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.actions-cell form {
  margin: 0;
}

.empty-state-box {
  padding: 2rem;
  text-align: center;
}

.form-actions-inline {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-stats-row {
  margin-top: 2rem;
}

.stat-box {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.8rem;
  color: var(--red);
  font-family: var(--font-head);
}

.section-head-inline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-link {
    color: var(--color-primary, #c8102e);
    font-weight: 600;
    text-decoration: none;
}

.news-carousel-wrap {
    position: relative;
    overflow: hidden;
}

.news-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}

.news-carousel::-webkit-scrollbar {
    display: none;
}

.news-carousel.is-dragging {
    cursor: grabbing;
}

.news-slide {
    flex: 0 0 min(360px, 85vw);
}

@media (max-width: 768px) {
    .news-slide {
        flex: 0 0 85%;
    }
}

.news-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.news-card-image {
    aspect-ratio: 16 / 10;
    background: #f3f3f3;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c8102e, #8b0c20);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.news-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    flex: 1;
}

.news-card-content h3 {
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
}

.news-card-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.news-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
    color: #777;
}

.news-read-more {
    color: #c8102e;
    font-weight: 700;
}

.news-empty-state {
    padding: 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .news-carousel {
        grid-auto-columns: 85%;
        gap: 16px;
    }

    .section-head-inline {
        align-items: flex-start;
    }
}

.news-carousel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.carousel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: #c8102e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-toggle:hover {
    transform: translateY(-1px);
    background: #a50d25;
}

.carousel-toggle:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

.carousel-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.35);
}

.carousel-dot.is-active {
    background: #c8102e;
    transform: scale(1.15);
}

.carousel-dot:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}
