/* =============================================
   Coop2050 Coop2050 Platform – Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --red-900:    #7b0d1e;
  --red-800:    #a11029;
  --red-700:    #c81d3d;
  --red-600:    #e63946;
  --red-500:    #f05d6a;
  --red-100:    #fde2e4;
  --red-50:     #fff5f5;

  --gray-900:   #111827;
  --gray-700:   #374151;
  --gray-500:   #6b7280;
  --gray-300:   #d1d5db;
  --gray-100:   #f3f4f6;
  --white:      #ffffff;

  --shadow-sm:  0 2px 8px rgba(0,0,0,.06);
  --shadow-md:  0 8px 30px rgba(0,0,0,.10);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.14);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  24px;
  --radius-xl:  40px;

  --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', sans-serif;
  color: var(--gray-900);
  line-height: 1.25;
}

a { color: var(--red-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-600); }

img { max-width: 100%; display: block; }

/* ---------- Utility ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.text-center { text-align: center; }
.text-red { color: var(--red-700); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 36px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 34, 63, 0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
  height: 70px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--red-700), var(--red-800));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.navbar-logo svg { width: 22px; height: 22px; }

.navbar-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--gray-900);
  letter-spacing: -.3px;
}

.navbar-title span { color: var(--red-700); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.navbar-nav a {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  transition: all var(--transition);
  position: relative;
}

.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--red-600);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.navbar-nav a:hover { color: var(--red-700); }
.navbar-nav a:hover::after { transform: scaleX(1); }
.navbar-nav a.active { color: var(--red-700); font-weight: 700; }

.nav-cta {
  background: var(--red-600) !important;
  color: var(--white) !important;
  padding: 12px 28px !important;
  border-radius: var(--radius-xl) !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(226, 34, 63, 0.2);
  margin-left: 10px;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26,122,60,.4) !important;
  background: var(--red-600) !important;
}

.navbar-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  width: 44px;
  height: 44px;
  z-index: 1100;
}

.navbar-burger span {
  display: block;
  position: absolute;
  left: 10px;
  width: 24px;
  height: 2px;
  background: var(--gray-900);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.navbar-burger span:nth-child(1) { top: 16px; }
.navbar-burger span:nth-child(2) { top: 22px; width: 18px; right: 10px; left: auto; }
.navbar-burger span:nth-child(3) { top: 28px; }

.navbar-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); width: 24px; }
.navbar-burger.open span:nth-child(2) { opacity: 0; transform: translateX(10px); }
.navbar-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); width: 24px; }

/* Mobile Overlay Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--white);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  padding: 160px 40px 40px;
  gap: 20px;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
}

.mobile-menu .nav-cta {
  margin-top: 20px;
  font-size: 18px;
  text-align: center;
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 100px;
  background: linear-gradient(150deg, var(--red-900) 0%, var(--red-800) 40%, var(--red-700) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-xl);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-label::before { content: '●'; color: #5ce87d; font-size: 8px; }

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #5ce87d, #a8f0ba);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,.78);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-scad {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

.hero-scad strong { color: rgba(255,255,255,.85); }

.hero-visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.hero-card-float {
  background: white;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
}

.hero-card-float h3 {
  color: var(--gray-900);
  font-size: 16px;
  margin-bottom: 20px;
}

.hero-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-stat {
  flex: 1;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.hero-stat-num {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #5ce87d;
}

.hero-stat-lbl { font-size: 11px; color: rgba(255,255,255,.65); margin-top: 4px; }

.hero-phases {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 10px 14px;
}

.hero-phase-num {
  width: 24px;
  height: 24px;
  background: var(--red-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.hero-phase-txt { font-size: 12px; color: rgba(255,255,255,.75); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: .2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(26,122,60,.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,122,60,.45);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.6);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--red-700);
  box-shadow: var(--shadow-md);
}

.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--red-700); }

.btn-red {
  background: linear-gradient(135deg, var(--red-700), var(--red-800));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(26,122,60,.3);
}

.btn-red:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,122,60,.4); color: var(--white); }

.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }

.btn-full { width: 100%; justify-content: center; }

.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: #f8f9fa; }
.section-dark { background: var(--red-900); }

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red-700);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
  letter-spacing: -.5px;
}

.section-title.white { color: var(--white); }

.section-subtitle {
  font-size: 17px;
  color: var(--gray-500);
  max-width: 600px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.card-icon {
  width: 52px;
  height: 52px;
  background: var(--red-50);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 24px;
}

/* ---------- Grid ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.grid-stack-mobile {
  display: grid;
  grid-template-columns: var(--cols, 1fr 1fr);
  gap: var(--gap, 24px);
}

@media (max-width: 991px) {
  .grid-stack-mobile {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ---------- Steps (registration) ---------- */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.step-circle.active {
  border-color: var(--red-700);
  background: var(--red-700);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(26,122,60,.35);
}

.step-circle.done {
  border-color: var(--red-600);
  background: var(--red-600);
  color: var(--white);
}

.step-label { font-size: 11px; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.step-label.active { color: var(--red-700); font-weight: 600; }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-300);
  margin: 0 8px;
  margin-bottom: 22px;
  min-width: 40px;
  transition: background var(--transition);
}

.step-line.done { background: var(--red-600); }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  max-width: 640px;
  margin: 0 auto;
}

.form-group { margin-bottom: 22px; }

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-label .req { color: var(--red-700); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--red-700);
  box-shadow: 0 0 0 3px rgba(26,122,60,.12);
}

.form-control:invalid:not(:placeholder-shown) { border-color: #e53935; }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-500);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--red-800);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--red-100);
  padding-bottom: 10px;
  margin: 28px 0 20px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--red-700);
  flex-shrink: 0;
  cursor: pointer;
}

.form-check-label { font-size: 14px; color: var(--gray-700); }

/* ---------- Alerts / Flash ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #b8dfc6;
  color: #0d5a2a;
}

.alert-danger {
  background: #fde8e8;
  border: 1px solid #f5c6cb;
  color: #a91b1b;
}

.alert-info {
  background: #e8f4fd;
  border: 1px solid #bee3f8;
  color: #1a5276;
}

.alert-warning {
  background: #fef9e7;
  border: 1px solid #f8e7a0;
  color: #7d6608;
}

.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ---------- Progress Bar ---------- */
.progress-wrapper {
  position: relative;
  margin: 20px 0;
}

.progress-track {
  height: 12px;
  background: var(--red-100);
  border-radius: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-600), #5ce87d);
  border-radius: 20px;
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255,255,255,.5);
  border-radius: 2px;
}

.progress-pct {
  position: absolute;
  right: 0;
  top: -22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--red-700);
}

/* ---------- Big Progress Circle ---------- */
.progress-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.progress-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-circle svg {
  transform: rotate(-90deg);
}

.progress-circle-bg { fill: none; stroke: var(--red-100); stroke-width: 8; }
.progress-circle-fg { fill: none; stroke: var(--red-600); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); }

.progress-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--red-700);
}

/* ---------- Section Checklist (dashboard) ---------- */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.section-card {
  background: var(--white);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-card:hover { border-color: var(--red-600); box-shadow: var(--shadow-md); }
.section-card.done { border-color: #16a34a; background: #f0fdf4; }

.section-card-header { display: flex; align-items: flex-start; justify-content: space-between; }
.section-card-icon { font-size: 26px; }
.section-card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-500);
}

.section-card-badge.done { background: #dcfce7; color: #15803d; }

.section-card h3 { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.section-card p { font-size: 12px; color: var(--gray-500); line-height: 1.5; }

/* ---------- Char counter ---------- */
.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
}

.char-counter.over { color: #e53935; font-weight: 600; }

/* ---------- File upload ---------- */
.file-drop {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-100);
}

.file-drop:hover, .file-drop.drag-over {
  border-color: var(--red-600);
  background: var(--red-50);
}

.file-drop-icon { font-size: 36px; margin-bottom: 10px; }
.file-drop p { font-size: 14px; color: var(--gray-500); }
.file-drop strong { color: var(--red-700); }
.file-drop input { display: none; }

/* ---------- Team members repeater ---------- */
.team-list { display: flex; flex-direction: column; gap: 10px; }

.team-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.team-row:hover { box-shadow: var(--shadow-md); }

.team-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red-700);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-info { flex: 1; min-width: 0; }
.team-name  { font-weight: 700; font-size: 14px; color: var(--gray-900); }
.team-role  { font-size: 12px; color: var(--gray-500); margin-top: 2px; display: flex; align-items: center; gap: 5px; }

.team-index {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 20px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.btn-remove {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-remove:hover { border-color: #e53935; color: #e53935; background: #fff1f1; }

/* ---------- Admin Table ---------- */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table th {
  background: var(--gray-900);
  color: var(--white);
  padding: 14px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.admin-table td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--red-50); }

/* Mobile: trasforma le righe in card verticali */
@media (max-width: 700px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    border-bottom: 2px solid var(--gray-100);
    padding: 12px 0;
    margin-bottom: 0;
  }
  .admin-table tr:last-child { border-bottom: none; }
  .admin-table td {
    border-bottom: none;
    padding: 5px 16px;
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-400);
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  /* Celle senza data-label (es. azioni) non mostrano prefix */
  .admin-table td[data-label=""]::before { display: none; min-width: 0; }
  .admin-table td[data-label="azioni"] { justify-content: flex-end; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background: var(--red-100); color: var(--red-800); }
.badge-warning { background: #fef9e7; color: #7d6608; }
.badge-danger  { background: #fde8e8; color: #a91b1b; }
.badge-info    { background: #e8f4fd; color: #1a5276; }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }

/* ---------- Stats Cards ---------- */
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.stat-card-num {
  font-family: 'Sora', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--red-700);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  background: var(--red-900);
  color: rgba(255,255,255,.75);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand p { font-size: 14px; line-height: 1.7; max-width: 300px; }

.footer h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 16px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,.7); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--red-900), var(--red-800));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: 90px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--red-700), var(--red-800));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.auth-logo h2 { font-size: 20px; color: var(--gray-900); margin-bottom: 6px; }
.auth-logo p { font-size: 13px; color: var(--gray-500); }

/* ---------- Register multi-step ---------- */
.register-page {
  min-height: 100vh;
  background: var(--red-50);
  padding: 100px 24px 60px;
}

.register-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  max-width: 740px;
  margin: 0 auto;
}

/* ---------- Dashboard layout ---------- */
.dashboard-layout {
  min-height: 100vh;
  background: var(--gray-100);
}

.dashboard-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.dashboard-main { padding: 36px 32px; max-width: 1200px; margin: 0 auto; }

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 26px; margin-bottom: 4px; }
.page-header p { color: var(--gray-500); font-size: 15px; }

/* ---------- Char limit input highlight ---------- */
.char-ok   { border-color: var(--red-600) !important; }
.char-warn { border-color: #f59e0b !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner, .footer-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sections-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
  .navbar-nav { display: none; }
  .navbar-burger { display: flex; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sections-grid { grid-template-columns: 1fr; }
  .register-card, .auth-card { padding: 28px 22px; }
  .form-card { padding: 28px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Scroll animations ───────────────────────────────── */

/* Gate animations on js-ready to avoid invisible content if JS fails */
.js-ready .fade-section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.4,0,.2,1), transform .65s cubic-bezier(.4,0,.2,1);
}

.js-ready .fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.js-ready [data-stagger] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s cubic-bezier(.4,0,.2,1), transform .55s cubic-bezier(.4,0,.2,1);
}

.js-ready [data-stagger] > *.visible {
  opacity: 1;
  transform: translateY(0);
}

[data-stagger] > *:nth-child(1) { transition-delay: .00s; }
[data-stagger] > *:nth-child(2) { transition-delay: .10s; }
[data-stagger] > *:nth-child(3) { transition-delay: .20s; }
[data-stagger] > *:nth-child(4) { transition-delay: .30s; }
[data-stagger] > *:nth-child(5) { transition-delay: .40s; }
[data-stagger] > *:nth-child(6) { transition-delay: .50s; }

/* ---------- Floating Bando Label ---------- */
.bando-label {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 300;
  transform: translateY(-50%) translateX(-100%);
  transition: transform 0.45s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  border-radius: 0 12px 12px 0;
  padding: 20px 10px;
  box-shadow: 4px 2px 18px rgba(0,0,0,.20);
}

.bando-label.visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.bando-label.gpi   { background: var(--red-700); }
.bando-label.coop2050 { background: #16a34a; }

#bando-label-text {
  display: block;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: white;
}

@media (max-width: 900px) {
  .bando-label { display: none; }
}

/* ── Admin – Responsive ─────────────────────────────── */

/* Contenitore principale admin: riduci padding su mobile */
@media (max-width: 900px) {
  .admin-main  { padding: 16px; }
  .admin-content { padding: 16px; }
  .view-card, .view-section { padding: 16px; }
  .page-title { font-size: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .admin-main  { padding: 12px; }
  .admin-content { padding: 12px; }
  .view-card, .view-section { padding: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-actions { width: 100%; }
}

/* Scroll orizzontale per tabelle che NON possono diventare card */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabella admin "a card" su schermi piccoli — già definita in blocco .admin-table sopra */
/* Assicura che le celle dei badge non spezzino il testo */
@media (max-width: 700px) {
  .badge { white-space: nowrap; }
  .admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-actions a, .admin-actions button { font-size: 12px; padding: 5px 10px; }
}

/* ── Backend Dashboard – Responsive ─────────────────── */

/* Griglia progress card (cerchio | info | pulsante invia) */
.progress-card-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}

@media (max-width: 768px) {
  /* Topbar: permetti wrapping e riduci padding */
  .dashboard-topbar {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .dashboard-main { padding: 20px 16px; }
  .page-header h1 { font-size: 20px; }
  .page-header p  { font-size: 13px; }
  /* Progress card: collassa a colonna singola */
  .progress-card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .progress-circle-wrap { flex-direction: row !important; align-items: center; gap: 16px; }
}

@media (max-width: 480px) {
  .dashboard-topbar { padding: 8px 10px; gap: 6px; }
  .dashboard-main   { padding: 14px 10px; }
  /* Nascondi il testo coop/utente nella user-pill (tieni solo avatar) */
  .user-pill > div:not(.user-avatar) { display: none; }
  /* Nascondi bottoni topbar non essenziali su schermi piccoli */
  .btn-topbar-hide { display: none !important; }
}
