:root{
  --bg: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
  --card:#ffffff;
  --accent:#667eea;
  --accent-dark:#5568d3;
  --secondary:#764ba2;
  --muted:#6b7280;
  --radius:12px;
  --container-width:1240px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(102, 126, 234, 0.12);
  --shadow-lg: 0 16px 48px rgba(102, 126, 234, 0.15);
}
*{box-sizing:border-box}
body{
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; 
  margin:0; 
  background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
  background-attachment: fixed;
  color:#1f2937;
  line-height: 1.6;
  min-height: 100vh;
}

/* Glass effect - Fedele al progetto AI */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.container{max-width:var(--container-width); margin:0 auto; padding:0 20px}

/* Realtime toast notification */
.realtime-toast{
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 11000;
  background: rgba(31, 41, 55, 0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  padding: 12px 14px;
  max-width: 320px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.realtime-toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* Header improvements */
.site-header{
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom:2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner{display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 0}
.logo{
  font-weight:900; 
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.main-nav{display:flex; align-items:center; flex-wrap:nowrap; min-width:0}
.main-nav a{
  margin-left:16px; 
  color:#4b5563; 
  text-decoration:none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  white-space: nowrap;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.main-nav a:hover{
  color: var(--accent);
  transform: translateY(-2px);
}
.main-nav a:hover::after {
  transform: scaleX(1);
}
.site-header .container{padding-left:14px; padding-right:14px}

/* Mobile hamburger menu */
.mobile-menu-toggle{
  display:none; 
  background:none; 
  border:none; 
  font-size:24px; 
  cursor:pointer; 
  padding:8px; 
  color:var(--accent); 
  transition:transform 0.2s ease, background 0.2s ease;
}
.mobile-menu-toggle:hover{transform:scale(1.1); background:#f3f4f6; border-radius:8px}
.mobile-menu-toggle:active{transform:scale(0.95)}

/* Hero Section - Modern gradient with blob effects */
.hero{
  padding:100px 0 80px; 
  text-align:center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 700px;
  height: 700px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(100px);
  transform: translate(50%, -50%);
  animation: blobFloat1 20s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 500px;
  height: 500px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  filter: blur(90px);
  transform: translate(-50%, 50%);
  animation: blobFloat2 18s ease-in-out infinite alternate;
}
@keyframes blobFloat1 {
  0%, 100% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(45%, -45%) scale(1.1); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(-50%, 50%) scale(1); }
  50% { transform: translate(-45%, 55%) scale(1.15); }
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero h1{
  margin:0 0 20px; 
  font-size:52px; 
  font-weight:900;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}
.hero p {
  font-size: 20px;
  opacity: 0.98;
  margin: 0 0 40px;
  font-weight: 400;
}

/* Search form - modern glassmorphism */
.search-form{
  display:flex; 
  gap:12px; 
  justify-content:center; 
  max-width:800px; 
  margin:0 auto;
  background: rgba(255, 255, 255, 0.98);
  padding: 10px;
  border-radius: 9999px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.search-form input{
  flex:1; 
  padding:16px 20px; 
  border-radius:14px; 
  border:2px solid transparent;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  font-weight: 500;
}
.search-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  transform: scale(1.02);
}
.search-form button{
  padding:16px 32px; 
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color:#fff; 
  border:none; 
  border-radius:9999px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.search-form button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}
.search-form button:active {
  transform: translateY(0) scale(0.95);
}

.filters{
  display:flex; 
  gap:10px; 
  justify-content:center; 
  margin:20px 0; 
  flex-wrap:wrap;
}
.filters select{
  padding:10px 14px; 
  border:2px solid #e5e7eb; 
  border-radius:10px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.filters select:focus {
  outline: none;
  border-color: var(--accent);
}
.filters button{
  padding:10px 16px; 
  border-radius:10px; 
  border:none; 
  background: white;
  color:var(--accent);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.filters button:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.filters button:active {
  transform: scale(0.95);
}
.filters .toggle-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  user-select: none;
}
.filters .toggle-filter:hover {
  border-color: var(--accent);
}
.filters .toggle-filter input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}
.filters .toggle-filter span {
  color: #4b5563;
  font-weight: 500;
  transition: color 0.3s ease, font-weight 0.3s ease;
}
.filters .toggle-filter input[type="checkbox"]:checked + span {
  font-weight: 600;
  color: var(--accent);
}
.results{padding:40px 0}
.results h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px;
  color: #1f2937;
}
.results p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* Job cards - Premium modern design */
.jobs-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:28px}
.job-card{
  background: white;
  border-radius: 20px;
  padding:28px; 
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(102, 126, 234, 0.1);
}
.job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--secondary) 100%);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.job-card:hover::before {
  transform: scaleX(1);
}
.job-card:hover{
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 24px 64px rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.3);
}
.job-card h3{
  margin:0 0 12px; 
  font-size:20px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.4;
}
.job-card .meta{
  color:#6b7280; 
  font-size:14px;
  line-height: 1.6;
  font-weight: 500;
}
.job-card .description {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.job-card .actions{margin-top:20px; display: flex; gap: 10px; flex-wrap: wrap;}
.job-card button{
  padding:12px 20px; 
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  border:none; 
  color:white; 
  border-radius:12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.job-card button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}
.job-card button:active {
  transform: scale(0.95);
}

/* Job card internal components */
.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.job-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.job-card-tag {
  background: rgba(102, 126, 234, 0.1);
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}
.job-card h3 small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.job-card .meta.with-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.job-card .meta.with-icon svg {
  flex-shrink: 0;
}
.job-card .meta.location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.job-card .meta.location svg {
  flex-shrink: 0;
}
.job-card .meta.location .poster-type {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.job-card .meta.no-location {
  margin-bottom: 4px;
}
.job-card .meta.no-location .poster-type {
  float: right;
  color: var(--muted);
  font-size: 12px;
}
.job-card .meta.tags-row {
  margin-bottom: 8px;
}
.job-card details.job-id {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.job-card details.job-id summary {
  cursor: pointer;
  user-select: none;
}
.job-card details.job-id .id-container {
  margin-top: 8px;
  padding: 8px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 4px;
  font-family: monospace;
}
.job-card details.job-id .id-container code {
  user-select: all;
}
.job-card details.job-id .id-container small {
  font-family: system-ui;
}
.job-card details.job-id .id-container a {
  color: var(--accent);
  text-decoration: underline;
}
.job-card .btn.edit {
  color: #334155;
  font-weight: 600;
  background: white;
  border: 2px solid #334155;
}
.job-card .btn.delete {
  color: #7f1d1d;
  font-weight: 600;
  background: white;
  border: 2px solid #7f1d1d;
}
.job-card .btn.report {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  background: white;
  border: 2px solid #374151;
}

/* Footer - Modern design */
.site-footer{
  padding:32px 0; 
  color:var(--muted); 
  text-align:center;
  background: white;
  border-top: 1px solid rgba(102, 126, 234, 0.1);
  margin-top: 60px;
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Ads sidebars */
.ads-side{position:fixed; top:120px; bottom:60px; width:140px; display:flex; flex-direction:column; gap:12px; z-index:20}
.ads-left{left:12px}
.ads-right{right:12px}
.ad-slot{background:#fff; border:1px solid #e6e9ef; border-radius:8px; padding:8px; text-align:center; box-shadow:0 6px 16px rgba(18,23,39,0.04)}
.ad-slot a{display:block; width:100%; height:100%; color:var(--muted); text-decoration:none}

/* Bottom ads area (non-overlapping) - vertical stack */
.ads-bottom{max-width:728px; margin:18px auto; padding:8px 16px; display:flex; flex-direction:column; gap:16px; align-items:center}
.ads-bottom .ad-slot{width:100%; max-width:728px; min-width:280px; min-height:90px; display:flex; align-items:center; justify-content:center; overflow:hidden; box-sizing:border-box}
.ads-bottom .ad-slot img{width:100%; height:auto; display:block}
.ads-bottom .ad-slot ins.adsbygoogle{width:100% !important; min-width:280px}

@media(max-width:1100px){ .ads-side{display:none} }
@media(max-width:768px){ 
  .ads-bottom{padding:8px 12px; max-width:100%}
  .ads-bottom .ad-slot{min-width:280px}
}

.header-actions{display:flex; align-items:center}
.header-actions button{
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color:#fff; 
  border:none; 
  padding:10px 20px; 
  border-radius:10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}
.header-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}
.header-actions button:active {
  transform: scale(0.95);
}

/* Hide import button for non-admin users */
#run-import {
  display: none;
}

/* Desktop top-header (candidature-ricevute.html, miei-annunci.html, admin.html) */
.top-header {
  background: white;
  border-bottom: 1px solid #e6e9ef;
  padding: 0;
}
.top-header > .container,
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
}
.top-header .mobile-menu-toggle {
  display: none;
}
.top-header .main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.top-header .main-nav a {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.top-header .main-nav a:hover {
  background: rgba(102, 126, 234, 0.08);
  color: var(--accent);
}
.top-header .main-nav a.active {
  background: rgba(102, 126, 234, 0.1);
  color: var(--accent);
  font-weight: 600;
}
.top-header .auth-ui {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-header .auth-ui a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.top-header .auth-ui a:hover {
  background: rgba(102, 126, 234, 0.08);
}

/* modal - Modern glassmorphism */
.modal{
  position:fixed; 
  inset:0; 
  display:none; 
  align-items:flex-start; 
  justify-content:center; 
  background:rgba(10,11,15,0.5);
  backdrop-filter: blur(8px);
  z-index:10000;
  overflow-y: auto;
  padding: 40px 20px;
}
.modal[aria-hidden="false"]{
  display:flex;
  pointer-events:auto;
}

/* Email confirmation modal - higher z-index to appear above other modals */
#modal-email-confirm {
  z-index: 10100;
  background: rgba(10,11,15,0.7);
}

body.modal-open {
  overflow: hidden;
}
.modal-content{
  background:white; 
  padding:32px; 
  border-radius:20px; 
  width:min(720px,94%); 
  position:relative; 
  max-height:none;
  overflow-y:auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease;
  margin-top: 20px;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-close{
  position:absolute; 
  right:16px; 
  top:16px; 
  border:none; 
  background:rgba(102, 126, 234, 0.1); 
  font-size:20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
}
.modal-close:hover {
  background: var(--accent);
  color: white;
  transform: rotate(90deg);
}
.modal-content h3 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

/* Google Sign-In Button */
.google-btn {
  width: 100%;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.google-btn:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.google-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Auth Divider - "oppure" separator */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}
.auth-divider span {
  padding: 0 16px;
  text-transform: lowercase;
}

.modal-content form label{
  display:block; 
  margin:0 0 16px;
  font-weight: 500;
  color: #374151;
}
.modal-content form input, 
.modal-content form textarea, 
.modal-content form select{
  width:100%; 
  padding:12px 16px; 
  border:2px solid #e5e7eb; 
  border-radius:10px;
  font-size: 15px;
  margin-top: 6px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.modal-content form input:focus,
.modal-content form textarea:focus,
.modal-content form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stile per campi obbligatori vuoti */
.modal-content form input.invalid,
.modal-content form textarea.invalid {
  border-color: #fbbf24;
  background-color: rgba(251, 191, 36, 0.05);
}

/* Tooltip "nuvoletta" per campi obbligatori */
.modal-content form label:has(.invalid)::after {
  content: attr(data-error);
  display: block;
  background: #fbbf24;
  color: #78350f;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-content form button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.modal-content form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Large job view modal */
.modal-large{width:min(900px,96%)}
.job-view-header{border-bottom:2px solid #f3f4f6; padding-bottom:16px; margin-bottom:16px}
.job-view-header h2{margin:0 0 8px; font-size: 26px; font-weight: 700; color: #1f2937;}
.job-view-body{max-height:60vh; overflow:auto; padding-right:8px}
.job-view-body .description{white-space:pre-wrap; line-height:1.7; color: #4b5563;}
.badge{
  display:inline-block; 
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
  color:var(--accent); 
  padding:4px 12px; 
  border-radius:20px; 
  font-size:12px; 
  margin-left:8px;
  font-weight: 700;
  border: 1px solid rgba(102, 126, 234, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-card .meta small{margin-left:8px; color:var(--muted)}
.job-card .actions .btn{margin-right:8px}

@media (max-width:900px){
  .jobs-grid{grid-template-columns:repeat(2,1fr)} 
  .hero h1{font-size:32px}
}
@media (max-width:600px){
  .jobs-grid{grid-template-columns:1fr}
  .search-form{flex-direction:column; padding: 12px; border-radius: 20px;}
  .search-form button{border-radius: 14px;}
  .hero {padding: 60px 0 40px;}
  .hero h1{font-size:28px}
  
  /* Mobile header layout optimization */
  .site-header{position:relative}
  .header-inner{display:flex; align-items:center; gap:8px; padding:12px 0}
  
  /* Logo centered or left */
  .logo{font-size:18px; flex:1}
  
  /* Mobile menu: show hamburger button - ALWAYS visible and clickable */
  .mobile-menu-toggle{display:block !important; position:relative; z-index:150; order:-1; flex-shrink:0; min-width:40px; min-height:40px; font-size:22px; margin:0; transition:transform 0.2s ease}
  
  /* Hide desktop navigation, show mobile dropdown */
  .main-nav{display:none; position:absolute; top:100%; left:0; right:0; background:#fff; border-bottom:1px solid #e6e9ef; box-shadow:0 8px 24px rgba(18,23,39,0.12); flex-direction:column; padding:12px 0; z-index:140; margin-top:1px; opacity:0; transform:translateY(-10px); transition:opacity 0.3s ease, transform 0.3s ease; pointer-events:none; border-radius: 0 0 12px 12px;}
  .main-nav.active{display:flex !important; opacity:1; transform:translateY(0); pointer-events:auto}
  .main-nav a{margin:0; padding:16px 20px; border-bottom:1px solid #f3f4f6; font-size:15px; transition:background-color 0.2s ease}
  .main-nav a:hover{background-color:#f3f4f6}
  .main-nav a:last-child{border-bottom:none}
  
  /* Make header actions smaller on mobile */
  .header-actions{flex-shrink:0}
  .header-actions button{font-size:13px; padding:8px 14px; white-space:nowrap}
  
  /* Styles for .top-header variant (candidature-ricevute.html, miei-annunci.html) */
  .top-header{position:relative; padding:12px 0}
  .top-header .mobile-menu-toggle{display:block !important; position:relative; z-index:150; flex-shrink:0; min-width:40px; min-height:40px; transition:transform 0.2s ease}
  .top-header .main-nav{display:none; position:absolute; top:100%; left:0; right:0; background:#fff; border-bottom:1px solid #e6e9ef; box-shadow:0 8px 24px rgba(18,23,39,0.12); flex-direction:column; padding:12px 0; z-index:140; opacity:0; transform:translateY(-10px); transition:opacity 0.3s ease, transform 0.3s ease; pointer-events:none; border-radius: 0 0 12px 12px;}
  .top-header .main-nav.active{display:flex !important; opacity:1; transform:translateY(0); pointer-events:auto}
  .top-header .main-nav a{margin:0; padding:16px 20px; border-bottom:1px solid #f3f4f6; transition:background-color 0.2s ease}
  .top-header .main-nav a:hover{background-color:#f3f4f6}
  .top-header .auth-ui{display:flex; flex-direction:column; gap:8px}
  
  /* Fix user menu dropdown in top-header */
  .top-header .auth-ui .user-menu{align-self:flex-end}
  .top-header .auth-ui .user-menu-dropdown{right:0; left:auto}
}

/* Consent banner/modal styles - Modern design */
.consent-banner{
  position:fixed; 
  left:0; 
  right:0; 
  bottom:20px; 
  z-index:200; 
  justify-content:center; 
  padding:0 20px;
}
.consent-banner[aria-hidden="true"]{display:none}
.consent-banner[aria-hidden="false"]{display:flex}
.consent-banner .consent-inner{
  background: white;
  border:1px solid rgba(102, 126, 234, 0.15);
  padding:20px 24px; 
  border-radius:16px; 
  display:flex; 
  gap:16px; 
  align-items:center; 
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  max-width:900px;
  backdrop-filter: blur(10px);
}
.consent-banner .consent-text{
  color:#4b5563; 
  font-size:15px;
  line-height: 1.6;
}
.consent-banner .consent-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.consent-banner .consent-text a:hover {
  text-decoration: underline;
}
.consent-actions{display: flex; gap: 10px;}
.consent-actions .btn{
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}
.consent-actions .btn:first-child {
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: white;
}
.consent-actions .btn:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

@media(max-width:600px){
  .consent-banner{bottom:12px; padding:0 12px}
  .consent-banner .consent-inner{flex-direction:column; padding:16px; gap:12px; font-size:14px}
  .consent-actions{display:flex; gap:8px; width:100%; flex-wrap: wrap;}
  .consent-actions .btn{flex:1; min-width: 100px; padding: 10px 16px;}
}
.modal-content form label{display:block; margin:8px 0}

/* User dropdown menu */
.user-menu{position:relative; display:inline-block}
.user-menu-toggle{
  cursor:pointer; 
  display:inline-flex; 
  align-items:center; 
  gap:6px; 
  padding:10px 16px; 
  border-radius:12px; 
  transition: all 0.3s ease;
  font-weight: 600;
  color: var(--accent);
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
  font-size: 15px;
}
.user-menu-toggle:hover{
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}
.user-menu-dropdown{
  display:none; 
  position:absolute; 
  right:0; 
  top:100%; 
  margin-top:8px; 
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius:14px; 
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  min-width:240px; 
  z-index:100;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.user-menu-dropdown.active{display:block}
.user-menu-email{
  padding:12px 18px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  background: rgba(102, 126, 234, 0.04);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-item{
  display:block; 
  padding:12px 18px; 
  color:#1f2937; 
  text-decoration:none; 
  font-size:14px; 
  transition: all 0.2s ease;
  font-weight: 500;
}
.user-menu-item:hover{
  background: rgba(102, 126, 234, 0.08);
  color: var(--accent);
  padding-left: 22px;
}
.user-menu-logout {
  border-top: 1px solid rgba(102, 126, 234, 0.1);
  margin-top: 4px;
  padding-top: 12px;
}
.user-menu-logout:hover {
  background: rgba(255, 67, 67, 0.08);
  color: #ff4343;
}

/* Admin notification badge */
.admin-pending-badge {
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 20px;
  animation: bounceIn 0.5s ease, pulse 2s infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 10;
  cursor: pointer;
}
@keyframes bounceIn {
  from {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Help button and dropdown */
.field-with-help{position:relative; display:flex; align-items:center; gap:8px}
.field-with-help label{flex:1; margin:0}
.help-toggle{
  background:none; 
  border:2px solid #e5e7eb;
  border-radius:50%; 
  width:28px; 
  height:28px; 
  padding:0; 
  cursor:pointer; 
  font-size:15px; 
  display:inline-flex; 
  align-items:center; 
  justify-content:center; 
  color:var(--accent); 
  transition:all 0.2s ease; 
  flex-shrink:0;
  font-weight: 700;
}
.help-toggle:hover{
  background: rgba(102, 126, 234, 0.1);
  border-color:var(--accent); 
  transform:scale(1.1);
}
.help-toggle:active{transform:scale(0.95)}
.help-dropdown{
  visibility:hidden; 
  opacity:0; 
  position:absolute; 
  left:0; 
  top:calc(100% + 8px); 
  background:#fff; 
  border:1px solid rgba(102, 126, 234, 0.15);
  border-radius:12px; 
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding:16px; 
  min-width:300px; 
  max-width:360px; 
  z-index:200; 
  transform:translateY(-10px); 
  transition:opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; 
  pointer-events:none;
}
.help-dropdown.active{
  visibility:visible; 
  opacity:1; 
  transform:translateY(0); 
  pointer-events:auto;
}
.help-content{
  font-size:14px; 
  color:#1f2937; 
  line-height:1.6;
}
.help-content strong{
  color:var(--accent); 
  display:block; 
  margin-bottom:10px; 
  font-size:15px; 
  font-weight:700;
}
.help-content ul{list-style:none; padding:0; margin:0}
.help-content li{
  padding:8px 0; 
  border-bottom:1px solid #f3f4f6;
}
.help-content li:last-child{border-bottom:none}
.help-content li strong{
  display:inline; 
  margin:0; 
  font-size:14px; 
  color:#1f2937;
  font-weight: 600;
}
