/* ═══════════════════════════════════════════════════════
   DiSPaC — Convenzioni Tirocini
   Colori istituzionali: #bd1824 (rosso), #000000, #FFFFFF
   ═══════════════════════════════════════════════════════ */

:root {
  --dispac-red: #bd1824;
  --dispac-red-dark: #9a1420;
  --dispac-red-light: #d42030;
  --dispac-black: #000000;
  --dispac-white: #ffffff;
  --dispac-gray-light: #f5f5f5;
  --dispac-gray: #6c757d;
  --dispac-border: #e0e0e0;
  --dispac-card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --dispac-card-shadow-hover: 0 6px 24px rgba(189,24,36,0.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: #1a1a1a;
  background: #fafafa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.main-content { flex: 1; }

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
}

/* ── HEADER ── */
.dispac-header {
  background: var(--dispac-white);
  border-bottom: 1px solid var(--dispac-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-red-bar {
  height: 4px;
  background: var(--dispac-red);
}

.header-inner {
  display: flex;
  align-items: center;
  padding: 14px 0;
  gap: 0;
}

.header-divider {
  width: 3px;
  height: 60px;
  background: var(--dispac-red);
  margin: 0 20px;
  flex-shrink: 0;
  border-radius: 2px;
}

.header-title {
  flex: 1;
}

.header-titolo {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--dispac-black);
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.header-sottotitolo {
  font-size: 0.85rem;
  color: var(--dispac-gray);
  margin: 0;
  font-weight: 400;
}

.header-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 20px;
}

/* ── LOGO ── */
.logo-link {
  text-decoration: none;
  color: inherit;
}

.dispac-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-main {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--dispac-black);
  letter-spacing: -1px;
  line-height: 1;
}

.logo-main em {
  font-style: italic;
  color: var(--dispac-red);
}

.logo-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--dispac-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  line-height: 1.3;
}

.dispac-logo--white .logo-main { color: var(--dispac-white); }
.dispac-logo--white .logo-main em { color: rgba(255,255,255,0.7); }
.dispac-logo--white .logo-sub { color: rgba(255,255,255,0.8); }

/* ── HEADER NAV ── */
.header-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nav-link-header {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dispac-black);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  margin-left: 4px;
}

.nav-link-header:hover,
.nav-link-header.active {
  background: var(--dispac-gray-light);
  color: var(--dispac-red);
}

.btn-header-action {
  background: var(--dispac-red) !important;
  color: var(--dispac-white) !important;
  padding: 4px 14px;
}

.btn-header-action:hover {
  background: var(--dispac-red-dark) !important;
  color: white !important;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.user-badge {
  color: var(--dispac-gray);
  font-weight: 600;
}

.btn-login, .btn-logout {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 4px;
  text-decoration: none;
  border: 1.5px solid var(--dispac-red);
  color: var(--dispac-red);
  transition: all 0.2s;
}

.btn-login:hover, .btn-logout:hover {
  background: var(--dispac-red);
  color: white;
}

/* ── LINGUA ── */
.lang-form { display: inline-flex; align-items: center; gap: 2px; }
.lang-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dispac-gray);
  cursor: pointer;
  padding: 2px 4px;
  letter-spacing: 0.05em;
}
.lang-btn.active { color: var(--dispac-red); }
.lang-btn:hover { color: var(--dispac-red); }
.lang-sep { color: var(--dispac-border); font-size: 0.75rem; }

/* ── PULSANTI ── */
.btn-dispac {
  background: var(--dispac-red);
  color: white;
  border: none;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}

.btn-dispac:hover {
  background: var(--dispac-red-dark);
  color: white;
  transform: translateY(-1px);
}

.btn-dispac-outline {
  background: transparent;
  color: var(--dispac-red);
  border: 1.5px solid var(--dispac-red);
  font-weight: 600;
  transition: all 0.2s;
}

.btn-dispac-outline:hover {
  background: var(--dispac-red);
  color: white;
}

/* ── PAGE HEADER ── */
.page-header {
  background: var(--dispac-black);
  color: white;
  padding: 40px 0 32px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: 'DiSPaC';
  position: absolute;
  right: -20px;
  top: -10px;
  font-family: 'Playfair Display', serif;
  font-size: 9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.04);
  pointer-events: none;
  letter-spacing: -4px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header .subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  font-weight: 300;
}

.page-header .red-accent {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--dispac-red);
  margin-bottom: 12px;
}

/* ── FILTRI ── */
.filtri-card {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--dispac-card-shadow);
}

.filtri-card .form-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dispac-gray);
  margin-bottom: 4px;
}

.filtri-card .form-control,
.filtri-card .form-select {
  border-color: var(--dispac-border);
  font-size: 0.9rem;
}

.filtri-card .form-control:focus,
.filtri-card .form-select:focus {
  border-color: var(--dispac-red);
  box-shadow: 0 0 0 0.2rem rgba(189,24,36,0.15);
}

/* ── CARD CONVENZIONE ── */
.conv-card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--dispac-border);
  box-shadow: var(--dispac-card-shadow);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.conv-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--dispac-gray-light);
  position: relative;
  flex-shrink: 0;
}

.conv-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.conv-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
  color: #bbb;
}

.conv-card-img-placeholder .placeholder-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #d0d0d0;
  letter-spacing: -1px;
  line-height: 1;
}

.conv-card-img-placeholder .placeholder-logo em {
  font-style: italic;
  color: rgba(189,24,36,0.3);
}

.conv-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.conv-card-tipo {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dispac-red);
  margin-bottom: 6px;
}

.conv-card-nome {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dispac-black);
  margin-bottom: 6px;
  line-height: 1.3;
}

.conv-card-citta {
  font-size: 0.82rem;
  color: var(--dispac-gray);
  margin-bottom: 10px;
}

.conv-card-citta i { margin-right: 3px; }

.conv-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--dispac-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── BADGE STATO ── */
.badge-stato {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.badge-disponibile { background: #e8f5e9; color: #2e7d32; }
.badge-non-disponibile { background: #fff3e0; color: #e65100; }
.badge-disattivata { background: #f5f5f5; color: #9e9e9e; }

/* ── CONTATORE ── */
.risultati-count {
  font-size: 0.85rem;
  color: var(--dispac-gray);
  margin-bottom: 16px;
}

.risultati-count strong { color: var(--dispac-red); }

/* ── DETTAGLIO ── */
.dettaglio-header {
  background: white;
  border-bottom: 1px solid var(--dispac-border);
  padding: 32px 0;
  margin-bottom: 36px;
}

.dettaglio-img-wrap {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--dispac-border);
  flex-shrink: 0;
}

.dettaglio-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dettaglio-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}

.info-section {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--dispac-card-shadow);
}

.info-section h5 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dispac-red);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dispac-red);
}

.info-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.info-label {
  font-weight: 600;
  color: var(--dispac-gray);
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.info-value { color: #1a1a1a; }

.sede-item {
  padding: 8px 12px;
  background: var(--dispac-gray-light);
  border-left: 3px solid var(--dispac-red);
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.note-box {
  background: #fff8f8;
  border: 1px solid rgba(189,24,36,0.2);
  border-left: 4px solid var(--dispac-red);
  border-radius: 0 6px 6px 0;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* ── FORM ── */
.form-section {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--dispac-card-shadow);
}

fieldset legend {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dispac-black);
  border-bottom: 2px solid var(--dispac-red);
  padding-bottom: 6px;
  margin-bottom: 20px;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--dispac-red);
  box-shadow: 0 0 0 0.2rem rgba(189,24,36,0.15);
}

/* ── TABELLA GESTIONE ── */
.table-dispac thead {
  background: var(--dispac-black);
  color: white;
}

.table-dispac thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  border: none;
}

.table-dispac tbody tr:hover { background: #fff5f5; }

.table-dispac tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-color: var(--dispac-border);
  font-size: 0.88rem;
}

/* ── LOGIN ── */
.login-card {
  max-width: 420px;
  margin: 80px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  overflow: hidden;
}

.login-header {
  background: var(--dispac-red);
  padding: 32px;
  text-align: center;
}

.login-body { padding: 32px; }

/* ── FOOTER ── */
.dispac-footer {
  background: var(--dispac-black);
  color: white;
  margin-top: auto;
}

.footer-red-bar {
  height: 4px;
  background: var(--dispac-red);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 0 24px;
  flex-wrap: wrap;
}

.footer-info {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.footer-info strong { color: white; }
.text-muted-footer { color: rgba(255,255,255,0.45) !important; }

.footer-link {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--dispac-red); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

.footer-bottom p { margin: 0; }

.footer-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
}

.footer-credits strong {
  color: rgba(255,255,255,0.65);
}

/* ── ALERT ── */
.alert-success { border-left: 4px solid #2e7d32; }
.alert-danger { border-left: 4px solid var(--dispac-red); }
.alert-info { border-left: 4px solid #1565c0; }
.alert-warning { border-left: 4px solid #e65100; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--dispac-gray);
}

.empty-state i {
  font-size: 4rem;
  color: var(--dispac-border);
  display: block;
  margin-bottom: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .header-divider {
    display: none;
  }

  .header-title {
    text-align: center;
  }

  .header-nav {
    align-items: center;
  }

  /* Nascondi il divisore grigio del logo UniSa */
  .unisa-divider {
    display: none;
}
}


