/* ============================================================
   Aperibusiness — Design System
   ============================================================ */

:root {
  /* Colors */
  --color-navy:       #0A1628;
  --color-navy-mid:   #1E3A5F;
  --color-navy-soft:  #2D5282;
  --color-orange:     #E8622A;
  --color-orange-light: #FFF0E8;
  --color-orange-mid: #F4845F;
  --color-text:       #1A202C;
  --color-text-muted: #718096;
  --color-text-faint: #A0AEC0;
  --color-border:     #E2E8F0;
  --color-border-soft:#EDF2F7;
  --color-bg:         #F7F8FA;
  --color-white:      #FFFFFF;
  --color-success:    #38A169;
  --color-error:      #E53E3E;
  --color-warning:    #D69E2E;
  --color-info:       #3182CE;

  /* Typography */
  --font-base:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs:  0.75rem;
  --font-size-sm:  0.875rem;
  --font-size-md:  1rem;
  --font-size-lg:  1.125rem;
  --font-size-xl:  1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.08), 0 10px 10px rgba(0,0,0,.04);
  --shadow-card: 0 2px 8px rgba(10,22,40,.08);
  --shadow-card-hover: 0 8px 24px rgba(10,22,40,.12);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --container-max: 1200px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-md);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content { flex: 1; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--color-orange); outline-offset: 2px; border-radius: 2px; }

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.25; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow { max-width: 720px; }
.container--wide   { max-width: 1400px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-navy);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 1px 0 rgba(255,255,255,.04);
  transition: box-shadow var(--transition-fast);
}

.site-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,.25); }
.site-header .btn-ghost { color: rgba(255,255,255,.88); }
.site-header .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Logo allineato sopra la sidebar nelle pagine dashboard */
.has-sidebar .container.header-inner {
  max-width: none;
  width: 100%;
  padding: 0;
}
.has-sidebar .header-inner .logo {
  width: 260px;
  flex-shrink: 0;
  padding: 0 var(--space-5);
  height: 100%;
  border-right: 1px solid rgba(255,255,255,.08);
}
.has-sidebar .header-inner .main-nav {
  padding-left: var(--space-4);
}
.has-sidebar .header-inner .header-actions {
  padding-right: var(--space-6);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-6);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.logo-icon { width: 32px; height: 32px; border-radius: var(--radius-md); object-fit: contain; }

.logo-text {
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: rgba(255,255,255,.9);
  letter-spacing: -0.3px;
}
.logo-text strong { font-weight: 700; color: var(--color-orange); }

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255,255,255,.82);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

/* User menu */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.1);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: #fff;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}
.user-menu-trigger:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.18); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-avatar-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-orange);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.user-name-mobile { display: none; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 200;
}
.user-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--color-border-soft); }
.dropdown-item--danger { color: var(--color-error); }
.dropdown-item--danger:hover { background: #FFF5F5; }

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) 0;
}

/* Mobile toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  position: relative;
  z-index: 110;
  touch-action: manipulation;
  cursor: pointer;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,.88);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Mobile-only nav links (hidden on desktop) */
.nav-link--mobile-only { display: none; }
.nav-link--cta {
  margin-top: var(--space-2);
  background: var(--color-orange);
  color: #fff !important;
  border-radius: var(--radius-md);
  text-align: center;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-orange);
  color: white;
  border-color: var(--color-orange);
}
.btn-primary:hover { background: #D4571F; border-color: #D4571F; box-shadow: 0 4px 12px rgba(232,98,42,.35); transform: translateY(-1px); }
.btn-primary:active { transform: none; box-shadow: none; }

.btn-navy {
  background: var(--color-navy);
  color: white;
  border-color: var(--color-navy);
}
.btn-navy:hover { background: var(--color-navy-mid); border-color: var(--color-navy-mid); }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-navy-soft); background: var(--color-border-soft); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--color-border-soft); }

.btn-danger {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}
.btn-danger:hover { background: #C53030; }

.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--font-size-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-md); }
.btn-xl { padding: var(--space-5) var(--space-10); font-size: var(--font-size-lg); }
.btn-full { width: 100%; }

.btn:disabled { opacity: .5; pointer-events: none; }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: var(--space-6); }
.form-group--row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-label span { color: var(--color-text-muted); font-weight: 400; }

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(232,98,42,.12);
}
.form-control::placeholder { color: var(--color-text-faint); }
.form-control-sm { padding: 5px 10px; font-size: var(--font-size-sm); }
.form-control.error { border-color: var(--color-error); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(229,62,62,.12); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Tags input */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  min-height: 44px;
  cursor: text;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tags-input-container:focus-within {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(232,98,42,.12);
}
.tags-input-container input {
  border: none;
  outline: none;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: none;
  flex: 1;
  min-width: 120px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  background: var(--color-orange-light);
  color: var(--color-orange);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.tag-chip button { color: inherit; opacity: .7; line-height: 1; padding: 0; font-size: 14px; }
.tag-chip button:hover { opacity: 1; }

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.form-check input { width: 18px; height: 18px; accent-color: var(--color-orange); cursor: pointer; }
.form-check label { font-size: var(--font-size-sm); cursor: pointer; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-card-hover); }
.card--link:hover { transform: translateY(-2px); }
.card-body { padding: var(--space-6); }
.card-header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-border); }
.card-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-border); background: var(--color-bg); }

/* Company card */
.company-card {
  height: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}
.company-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }

.company-card__cover {
  height: 120px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  position: relative;
  overflow: visible;
}
.company-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.company-card__cover-pattern {
  position: absolute;
  inset: 0;
  opacity: .15;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 20px 20px;
}

.company-card__logo {
  position: absolute;
  bottom: -24px;
  left: var(--space-5);
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  border: 3px solid white;
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.company-card__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.company-card__logo-placeholder {
  width: 100%; height: 100%;
  background: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: white;
}

.company-card__body {
  padding: var(--space-10) var(--space-5) var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.company-card__name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-1);
  line-height: 1.3;
}

.company-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.company-card__meta span { display: flex; align-items: center; gap: 4px; }
.company-card__meta svg { width: 12px; height: 12px; flex-shrink: 0; }

.company-card__tagline {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.company-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.company-card__footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Tag badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.4;
}
.badge-orange    { background: var(--color-orange-light); color: var(--color-orange); }
.badge-navy      { background: #EBF2FB; color: var(--color-navy-mid); }
.badge-gray      { background: var(--color-border-soft); color: var(--color-text-muted); }
.badge-green     { background: #F0FFF4; color: var(--color-success); }
.badge-sector    { background: #EBF8FF; color: #2C5282; }

/* ============================================================
   Hero section
   ============================================================ */
.hero {
  background: var(--color-navy);
  color: white;
  padding: var(--space-24) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(232,98,42,.2) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(45,82,130,.5) 0%, transparent 50%);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  opacity: .04;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 30px 30px;
}

.hero__content { position: relative; z-index: 1; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(232,98,42,.2);
  border: 1px solid rgba(232,98,42,.3);
  border-radius: var(--radius-full);
  color: var(--color-orange-mid);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
}
.hero__eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--color-orange);
  border-radius: 50%;
}

.hero__title {
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: var(--space-6);
}
.hero__title em {
  font-style: normal;
  color: var(--color-orange);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: rgba(255,255,255,.75);
  line-height: 1.6;
  margin-bottom: var(--space-10);
  max-width: 560px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,.1);
}
.hero__stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: white;
}
.hero__stat-label {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.6);
  margin-top: var(--space-1);
}

/* Hero grid + visual
   ============================================================ */
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.hero__visual {
  position: relative;
  z-index: 1;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Central match hub */
.hero-match-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-match-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(232,98,42,.35);
  animation: hero-pulse 3s ease-in-out infinite;
}
.hero-match-ring--outer {
  inset: -30px;
  border-color: rgba(232,98,42,.15);
  animation-delay: .5s;
}
.hero-match-ring--inner {
  inset: -12px;
  border-color: rgba(232,98,42,.28);
}

@keyframes hero-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.06); opacity: .6; }
}

.hero-match-core {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--color-orange), #c0441a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(232,98,42,.5), 0 8px 24px rgba(0,0,0,.3);
  z-index: 2;
}

/* Floating company cards */
.hero-card {
  position: absolute;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  white-space: nowrap;
  animation: hero-float 6s ease-in-out infinite;
}

.hero-card--a {
  top: 10%;
  left: -5%;
  animation-delay: 0s;
}
.hero-card--b {
  bottom: 18%;
  left: -8%;
  animation-delay: 2s;
}
.hero-card--c {
  top: 32%;
  right: -8%;
  animation-delay: 1s;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.hero-card__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-md);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.hero-card__body {
  flex: 1;
  min-width: 0;
}

.hero-card__name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.hero-card__tag {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}

.hero-card__check {
  width: 20px;
  height: 20px;
  background: var(--color-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Notification bubble */
.hero-match-toast {
  position: absolute;
  bottom: 8%;
  right: 0%;
  background: var(--color-navy);
  border: 1px solid rgba(232,98,42,.4);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  animation: hero-float 5s ease-in-out infinite;
  animation-delay: 1.5s;
}

.hero-match-toast span {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: white;
}

/* Compatibility badge */
.hero-score-badge {
  position: absolute;
  top: 8%;
  right: 2%;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  animation: hero-float 7s ease-in-out infinite;
  animation-delay: .8s;
}

/* Responsive: collapse to single column on mobile */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    display: none;
  }
}

/* ============================================================
   Section layouts
   ============================================================ */
.section { padding: var(--space-20) 0; }
.section--sm { padding: var(--space-12) 0; }

/* ============================================================
   Filters bar (aziende.php)
   ============================================================ */
.filters-bar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  padding: var(--space-4) 0;
}
.filters-mobile-header { display: none; }
.filters-search-desktop { display: flex; }
.filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.filters-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.filters-toggle-btn:hover { border-color: var(--color-navy-soft); background: var(--color-bg); }

@media (max-width: 768px) {
  .filters-bar {
    position: static;
    padding: var(--space-3) 0;
  }
  .filters-mobile-header {
    display: flex;
    gap: var(--space-2);
    align-items: center;
  }
  .filters-search-desktop { display: none; }
  .filters-panel {
    display: none;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-3);
  }
  .filters-panel.open { display: block; }
  .filters-panel form {
    flex-direction: column;
    align-items: stretch !important;
  }
  .filters-panel .form-control { width: 100% !important; min-width: unset !important; }
}
.section--lg { padding: var(--space-24) 0; }
.section--bg { background: var(--color-white); }
.section--dark { background: var(--color-navy); color: white; }
.section--orange { background: var(--color-orange); color: white; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-12);
}
.section-eyebrow {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-orange);
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-4xl));
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-navy);
  margin-bottom: var(--space-4);
}
.section--dark .section-title { color: white; }
.section-desc {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
}
.section--dark .section-desc { color: rgba(255,255,255,.7); }

/* Grid layouts */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }

/* ============================================================
   Swipe / Discover UI
   ============================================================ */
.discover-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swipe-card {
  position: absolute;
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  overflow: hidden;
  cursor: grab;
  transition: transform var(--transition-base), opacity var(--transition-base);
  user-select: none;
  will-change: transform;
}
.swipe-card:active { cursor: grabbing; }

.swipe-card--behind-1 { transform: scale(.97) translateY(8px); z-index: 1; }
.swipe-card--behind-2 { transform: scale(.94) translateY(16px); z-index: 0; }
.swipe-card--active   { z-index: 10; }

.swipe-card__cover {
  height: 180px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}
.swipe-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; }

.swipe-card__logo {
  position: absolute;
  bottom: -28px;
  left: var(--space-6);
  width: 64px; height: 64px;
  border-radius: var(--radius-xl);
  border: 3px solid white;
  background: white;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.swipe-card__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.swipe-card__logo-placeholder {
  width: 100%; height: 100%;
  background: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: white;
}

.swipe-card__body { padding: var(--space-12) var(--space-6) var(--space-6); }

.swipe-card__name {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: var(--space-1);
}

.swipe-card__meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.swipe-card__desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-card__section {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.swipe-card__section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.swipe-card__section-content {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
}

.swipe-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Swipe overlay indicators */
.swipe-indicator {
  position: absolute;
  top: 20px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 3px solid;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.swipe-indicator--yes {
  left: 20px;
  color: var(--color-success);
  border-color: var(--color-success);
  background: rgba(56,161,105,.1);
}
.swipe-indicator--no {
  right: 20px;
  color: var(--color-error);
  border-color: var(--color-error);
  background: rgba(229,62,62,.1);
}

/* Swipe buttons */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.swipe-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
}
.swipe-btn--pass {
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.swipe-btn--pass:hover { border-color: var(--color-error); color: var(--color-error); transform: scale(1.1); }

.swipe-btn--interest {
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.swipe-btn--interest:hover { border-color: var(--color-success); color: var(--color-success); transform: scale(1.1); }

.swipe-btn--super {
  width: 48px; height: 48px;
  border-color: var(--color-orange);
  color: var(--color-orange);
}
.swipe-btn--super:hover { background: var(--color-orange); color: white; transform: scale(1.1); }

/* Discover-row: scheda affiancata dai bottoni azione */
.discover-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
}
.discover-row .discover-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* Bottoni laterali "Mi interessa / Non mi interessa" */
.swipe-side-btn {
  width: 110px;
  max-height: 160px;
  align-self: center;
  flex-shrink: 0;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  padding: var(--space-5) var(--space-3);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-md);
}
.swipe-side-btn--pass   { background: #DC2626; color: #fff; }
.swipe-side-btn--pass:hover   { background: #b91c1c; transform: scale(1.04); box-shadow: var(--shadow-lg); }
.swipe-side-btn--interest { background: #16A34A; color: #fff; }
.swipe-side-btn--interest:hover { background: #15803d; transform: scale(1.04); box-shadow: var(--shadow-lg); }

/* Nascondi i bottoni laterali quando le carte finiscono */
.discover-row--empty .swipe-side-btn { display: none; }

/* Mobile: bottoni sotto la scheda, affiancati */
@media (max-width: 640px) {
  .discover-row { flex-wrap: wrap; }
  .discover-row .discover-stage { width: 100%; order: 1; flex: none; }
  .swipe-side-btn {
    flex: 1;
    flex-direction: row;
    height: 56px;
    width: auto;
    border-radius: 40px;
    padding: 0 var(--space-4);
    order: 2;
    gap: var(--space-2);
    font-size: 14px;
  }
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--header-height));
  background: var(--color-bg);
}

.sidebar {
  background: var(--color-navy);
  border-right: none;
  padding: var(--space-6) 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-section { padding: 0 var(--space-4); margin-bottom: var(--space-6); }
.sidebar-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.5);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255,255,255,.78);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.sidebar-link.active { color: #fff; background: var(--color-orange); font-weight: 600; }
.sidebar-link--highlight {
  color: #fff !important;
  background: rgba(232,98,42,.18);
  border: 1px solid rgba(232,98,42,.3);
}
.sidebar-link--highlight:hover { background: rgba(232,98,42,.28) !important; }
.sidebar-link--highlight.active { background: var(--color-orange); border-color: transparent; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--color-orange);
  color: white;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* Sidebar shown on non-dashboard pages (injected via footer for mobile nav) */
body:not(.has-sidebar) .sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  z-index: 80;
  width: 260px;
  height: calc(100vh - var(--header-height));
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-xl);
}
body:not(.has-sidebar) .sidebar.open { transform: translateX(0); }

.dashboard-content { padding: var(--space-8); }

/* Page header row: title + action button */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

/* Responsive 2-column grid used inside dashboard pages */
.dash-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

/* Offer/seek dynamic form rows */
.offer-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  align-items: start;
}

/* Profile completeness */
.completeness-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.completeness-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-orange), var(--color-orange-mid));
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

/* Stats cards */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon--orange { background: var(--color-orange-light); color: var(--color-orange); }
.stat-icon--navy   { background: #EBF2FB; color: var(--color-navy-mid); }
.stat-icon--green  { background: #F0FFF4; color: var(--color-success); }
.stat-icon--gray   { background: var(--color-border-soft); color: var(--color-text-muted); }

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1;
}
.stat-label { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ============================================================
   Contact unlock
   ============================================================ */
.contact-lock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-border-soft);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  filter: blur(0);
}
.contact-lock:hover {
  background: var(--color-orange-light);
  border-color: var(--color-orange);
  color: var(--color-orange);
}
.contact-value {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
}

/* ============================================================
   Alert / Flash messages
   ============================================================ */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #F0FFF4; border-color: #C6F6D5; color: #276749; }
.alert-error   { background: #FFF5F5; border-color: #FEB2B2; color: #9B2C2C; }
.alert-warning { background: #FFFBF0; border-color: #FAF089; color: #744210; }
.alert-info    { background: #EBF8FF; border-color: #BEE3F8; color: #2A4365; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding: var(--space-4) 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--color-text-muted); transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--color-orange); }
.breadcrumb svg { width: 12px; height: 12px; }
.breadcrumb span:last-child { color: var(--color-text); font-weight: 500; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}
.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  transition: all var(--transition-fast);
}
.page-link:hover { border-color: var(--color-orange); color: var(--color-orange); }
.page-link.active { background: var(--color-orange); border-color: var(--color-orange); color: white; }

/* ============================================================
   Profile page
   ============================================================ */
.profile-cover {
  height: 160px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  z-index: 0;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover-pattern {
  position: absolute;
  inset: 0;
  opacity: .1;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 24px 24px;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  margin-top: calc(-48px);
  padding: 0 var(--space-6);
  margin-bottom: var(--space-6);
}

.profile-logo {
  width: 96px; height: 96px;
  border-radius: var(--radius-xl);
  border: 4px solid white;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.profile-logo img { width: 100%; height: 100%; object-fit: cover; }
.profile-logo-placeholder {
  width: 100%; height: 100%;
  background: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: white;
}

.profile-info { padding-bottom: var(--space-2); }
.profile-name {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-2);
}
.profile-tagline {
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,.85);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand .logo { margin-bottom: var(--space-4); }
.footer-brand .logo-text { color: white; }

.footer-tagline {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.72);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}
.footer-social a {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: all var(--transition-fast);
}
.footer-social a:hover { background: var(--color-orange); color: white; }

.footer-heading {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-col nav a {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.75);
  transition: color var(--transition-fast);
}
.footer-col nav a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,.55);
}

/* ============================================================
   Utilities
   ============================================================ */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-orange { color: var(--color-orange); }
.text-navy   { color: var(--color-navy); }
.text-sm     { font-size: var(--font-size-sm); }
.text-xs     { font-size: var(--font-size-xs); }
.text-lg     { font-size: var(--font-size-lg); }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.w-full { width: 100%; }
.divider { height: 1px; background: var(--color-border); margin: var(--space-6) 0; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.animate-fade-in { animation: fadeIn .4s ease forwards; }
.animate-slide-up { animation: slideUp .5s ease forwards; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-border-soft) 25%, var(--color-border) 50%, var(--color-border-soft) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .dashboard-layout { grid-template-columns: 220px 1fr; }
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }

  .main-nav { display: none !important; }
  .mobile-menu-toggle { display: none; }
  .user-name { display: none; }
  .user-name-mobile { display: inline; font-size: var(--font-size-sm); font-weight: 600; }
  .nav-link--mobile-only { display: flex; }
  /* Su mobile mostra solo "Accedi", nascondi "Registrati gratis" */
  .site-header .btn-primary.btn-sm { display: none; }
  /* Riduci gap header per evitare overflow */
  .header-inner { gap: var(--space-3); }

  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-brand img {
    margin: 0 auto;
  }
  .footer-col nav {
    align-items: center;
  }
  .form-group--row { grid-template-columns: 1fr; }
  .hero { padding: var(--space-16) 0; }
  .hero__stats { flex-wrap: wrap; gap: var(--space-6); }
  .section { padding: var(--space-12) 0; }
  .profile-header { flex-direction: column; align-items: flex-start; }

  /* Reset has-sidebar header overrides on mobile */
  .has-sidebar .container.header-inner {
    max-width: 100%;
    padding: 0 var(--space-4);
  }
  .has-sidebar .header-inner .logo {
    width: auto;
    border-right: none;
    padding: 0;
  }
  .has-sidebar .header-inner .main-nav { padding-left: 0; }
  .has-sidebar .header-inner .header-actions { padding-right: 0; }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    z-index: 80;
    width: 260px;
    height: calc(100vh - var(--header-height));
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .dashboard-content { padding: var(--space-5); }
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .dash-2col { grid-template-columns: 1fr; }
  .offer-row { grid-template-columns: 1fr auto; }
  .offer-row > *:nth-child(2) { grid-column: 1; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .swipe-actions { gap: var(--space-4); }
  .swipe-btn { width: 56px; height: 56px; }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
}

/* ============================================================
   Modal Conferma Interesse
   ============================================================ */
#modal-conferma-interesse {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
#modal-conferma-interesse.is-open {
  display: flex;
}
#modal-conferma-interesse .modal-ci-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#modal-conferma-interesse .modal-ci-box {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: modal-ci-in .22s cubic-bezier(.34,1.46,.64,1);
}
@keyframes modal-ci-in {
  from { opacity: 0; transform: scale(.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.modal-ci-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: var(--color-orange-light);
  color: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}
.modal-ci-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-navy);
  margin: 0 0 var(--space-3);
}
.modal-ci-body {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin: 0 0 var(--space-2);
  line-height: 1.6;
}
.modal-ci-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--space-6);
}
.modal-ci-actions {
  display: flex;
  gap: var(--space-3);
}
.modal-ci-actions .btn {
  flex: 1;
}

/* ============================================================
   Event cards (eventi.php + homepage)
   ============================================================ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}
.events-grid--past .event-card { opacity: .75; }
.events-grid--past .event-card:hover { opacity: 1; }
.event-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card__stretched-link { color: inherit; text-decoration: none; }
.event-card__stretched-link::after { content: ''; position: absolute; inset: 0; }
.event-card__stretched-link:hover { color: var(--color-orange); }
.event-card__inner-link { position: relative; z-index: 1; }
.event-card__image {
  height: 180px;
  background: var(--color-bg-secondary);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.event-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
}
.event-card--past .event-card__image--placeholder { background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%); }
.event-card__past-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.event-card__body { padding: var(--space-4); display: flex; flex-direction: column; flex: 1; }
.event-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-3); }
.event-card__date,
.event-card__location { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-text-muted); font-weight: 500; }
.event-card__date { color: var(--color-orange); font-weight: 600; }
.event-card__title { font-size: var(--font-size-base); font-weight: 700; color: var(--color-navy); margin-bottom: var(--space-2); line-height: 1.35; }
.event-card__desc { font-size: var(--font-size-sm); color: var(--color-text-muted); line-height: 1.5; margin-bottom: var(--space-3); flex: 1; }
.event-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.event-card__company { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.event-card__company-logo { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--color-border); }
.event-card__company-initials {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--color-navy);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.event-card__company-name { font-size: 12px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.event-card__company-name:hover { color: var(--color-orange); }
.event-card__price { font-size: 13px; font-weight: 700; color: var(--color-text); white-space: nowrap; flex-shrink: 0; }
.event-card__price--free { color: #38A169; }
@media (max-width: 640px) {
  .events-grid { grid-template-columns: 1fr; }
}
