:root {
  --bg-main: #050816;
  --bg-card: #0b1220;
  --bg-card-soft: #111827;
  --accent-green: #34d399;
  --accent-orange: #f59e0b;
  --accent-red: #f97373;
  --border-glow: rgba(52, 211, 153, 0.35);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.18s ease-out;
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #1f2937 0, #050816 45%, #000 100%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 0, #bbf7d0 0, #22c55e 40%, #166534 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #022c22;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.75);
}

.logo-text .brand {
  font-weight: 600;
  font-size: 17px;
}

.logo-text .subtitle {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-btn:hover {
  background: rgba(31, 41, 55, 0.9);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #022c22;
}

/* Layout base */

.page {
  flex: 1;
  padding: 28px 20px 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.page-title {
  font-size: 26px;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Cards ruolo */

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.role-card {
  position: relative;
  border-radius: 26px;
  padding: 24px 24px 26px;
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.08), transparent 60%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.09), transparent 55%),
    linear-gradient(145deg, #020617, #020617 40%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-soft);
}

/* Titolo spostato in basso per non sovrapporsi al badge 1/2 */
.role-card h2 {
  margin-top: 72px;
  margin-bottom: 8px;
}

.role-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.role-badge {
  position: absolute;
  top: 16px;
  left: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 0, #bbf7d0 0, #22c55e 40%, #166534 100%);
  color: #022c22;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.8);
}

.role-badge.badge-orange {
  background: radial-gradient(circle at 30% 0, #fed7aa 0, #f97316 40%, #c2410c 100%);
  color: #451a03;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.8);
}

/* Pulsanti */

.primary-btn,
.secondary-btn,
.nav-pill {
  border-radius: var(--radius-pill);
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast);
}


.nav-pill.contacted {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  cursor: default;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
}

.nav-pill.contacted:hover {
  transform: none;
}

.nav-pill:disabled {
  opacity: 0.8;
  cursor: default;
}

/* =========================
   Reinvia email verifica – cooldown 60s + spinner + progress
   ========================= */
#btn-resend-verify{
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#btn-resend-verify .btn-label{
  display: inline-block;
}

#btn-resend-verify .btn-spinner{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(229, 231, 235, 0.35);
  border-top-color: var(--accent-green);
  display: none;
  animation: tl-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

#btn-resend-verify .btn-progress{
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: calc(var(--cooldown-progress, 0) * 1%);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.95));
  transition: width 0.12s linear;
  pointer-events: none;
}

#btn-resend-verify.is-loading .btn-spinner{
  display: inline-block;
}

#btn-resend-verify.is-cooldown{
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

@keyframes tl-spin{
  to{ transform: rotate(360deg); }
}


.primary-btn {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #022c22;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.5);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(34, 197, 94, 0.7);
}

.secondary-btn {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #451a03;
  box-shadow: 0 10px 25px rgba(248, 181, 0, 0.5);
}

.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(248, 181, 0, 0.7);
}

.nav-pill {
  background: rgba(31, 41, 55, 0.9);
  color: var(--text-main);
}

.nav-pill.danger {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.nav-pill:hover {
  transform: translateY(-1px);
}

/* Sezione jobs */

.section-header h2 {
  margin-bottom: 2px;
}

.section-header p {
  margin-top: 0;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.search-bar input {
  flex: 1;
  min-width: 220px;
}

.text-link-btn {
  margin-top: 4px;
  margin-bottom: 4px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent-green);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.text-link-btn:hover {
  text-decoration: underline;
}

/* Pannello filtri tipo di lavoro */
/* Pannello filtri tipo di lavoro */

.filter-panel-wrapper {
  margin-top: 8px;
  margin-bottom: 18px;
  position: relative;
}

.filter-panel {
  padding: 8px 40px; /* spazio per le frecce */
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.4);
  height: 46px;                    /* altezza fissa come in screenshot */
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

/* nascondo la scrollbar orizzontale */
.filter-panel::-webkit-scrollbar {
  display: none;
}
.filter-panel {
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none;    /* Firefox */
}

.filter-pill {
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(15, 118, 110, 0.35);
  color: #a5f3fc;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover {
  background: rgba(52, 211, 153, 0.5);
  color: #022c22;
}

.filter-empty {
  font-size: 12px;
  color: var(--text-muted);
}

/* Frecce sinistra/destra */

.filter-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  color: #a5f3fc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

.filter-arrow-left {
  left: 8px;
}

.filter-arrow-right {
  right: 8px;
}

.filter-arrow:hover {
  background: rgba(15, 23, 42, 1);
}

/* Form di base */

.form {
  display: none;
  margin-top: 16px;
}

.form.active,
.form-static {
  display: block;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  margin-top: 4px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  outline: none;
  font-family: var(--font-main);
  font-size: 14px;
}

input:focus,
textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2);
}

textarea {
  resize: vertical;
}

.full-width {
  width: 100%;
  margin-top: 8px;
}

/* CAPTCHA (Turnstile) */
.captcha-wrapper {
  margin-top: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
}

/* Account */

.account-box {
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.08), transparent 60%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 22px 20px 24px;
  box-shadow: var(--shadow-soft);
  max-width: 740px;
  margin: 0 auto;
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  margin-top: 14px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(15, 118, 110, 0.25);
  color: var(--text-main);
}

/* Dashboard account */

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.welcome-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.role-label {
  font-size: 13px;
  color: var(--accent-green);
}

.verify-label {
  font-size: 13px;
  margin-top: 2px;
}

.dashboard {
  margin-top: 8px;
}

.dashboard-box {
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.08), transparent 60%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 22px 20px 26px;
  box-shadow: var(--shadow-soft);
  max-width: 900px;
  margin-top: 18px;
}

.dashboard-title {
  margin-top: 0;
  margin-bottom: 8px;
}

/* Cards richieste / curriculum */

.cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.job-card {
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 14px 14px 16px;
  box-shadow: var(--shadow-soft);
}

.job-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.job-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.job-meta span + span::before {
  content: " · ";
}

.job-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 8px;
}

.skill-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.35);
  color: #a5f3fc;
}

.job-footer {
  display: flex;
  justify-content: flex-end;
}

/* Messaggi stato */

.error-text {
  font-size: 12px;
  color: var(--accent-red);
  min-height: 16px;
  margin-top: 6px;
}

.success-text {
  font-size: 12px;
  color: var(--accent-green);
  min-height: 16px;
  margin-top: 6px;
}

/* Curriculum – esperienze */

.exp-wrapper {
  margin-bottom: 16px;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 4px;
}

.exp-add-btn {
  padding-inline: 14px;
  font-size: 12px;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.exp-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.exp-input {
  width: 100%;
}

.exp-remove {
  border: none;
  background: rgba(15, 23, 42, 0.9);
  color: #fecaca;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* Ruolo registrazione */

.role-select {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.role-select label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
}

/* Footer */

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 18px 0 20px;
  border-top: 1px solid rgba(31, 41, 55, 0.8);
}

/* Responsive */

/* Modale modifica richiesta */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  z-index: 41;
  width: 100%;
  max-width: 520px;
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.08), transparent 60%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.98));
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow-soft);
  padding: 20px 20px 18px;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions-right {
  display: flex;
  gap: 8px;
}


@media (max-width: 880px) {
  .role-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding-inline: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    align-self: stretch;
    justify-content: flex-start;
  }

  .exp-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exp-remove {
    justify-self: flex-end;
  }
}

.footer {
  margin-top: auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), #020617 70%);
}

.footer-legal-btn {
  font-size: 12px;
  padding: 6px 14px;
}

/* Modale legale: corpo scrollabile */
.legal-modal-content {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.legal-modal-body {
  margin-top: 10px;
  padding-right: 6px;
  overflow-y: auto;
  max-height: 65vh;
  font-size: 13px;
  line-height: 1.45;
}

.legal-modal-body h2 {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 16px;
}

.legal-modal-body h3 {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 14px;
}

.legal-modal-body h4 {
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.legal-modal-body p,
.legal-modal-body ul {
  margin-bottom: 6px;
}


/* =========================
   CONTRATTI & FIRMA
   ========================= */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sign-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.sign-label{
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 860px){
  .sign-grid{ grid-template-columns: 1fr 1fr; }
}

.sign-box {
  margin: 12px 0 16px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

#sign-canvas-1,
#sign-canvas-2 {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: crosshair;
}

.sign-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  color: var(--text-muted);
}

/* =========================
   SELECT (stile TUTTO LAVORO)
   ========================= */

.select-wrap {
  position: relative;
  width: 100%;
}

/* Select "chiuso" */
.tl-select {
  width: 100%;
  height: 44px;
  padding: 10px 44px 10px 14px;
  border-radius: 12px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 16, 28, 0.55);
  color: rgba(255, 255, 255, 0.92);

  outline: none;

  /* rimuove stile nativo (freccia) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* coerenza font */
  font-size: 14px;
  line-height: 1;

  /* effetto "glass" */
  backdrop-filter: blur(8px);

  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* Hover */
.tl-select:hover {
  border-color: rgba(46, 204, 113, 0.35);
}

/* Focus (glow verde come il tema) */
.tl-select:focus {
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow:
    0 0 0 3px rgba(46, 204, 113, 0.18),
    0 10px 26px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Placeholder "Seleziona" (opzione vuota) */
.tl-select:invalid {
  color: rgba(255, 255, 255, 0.55);
}

/* Freccia custom (sempre coerente) */
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-55%) rotate(45deg);

  border-right: 2px solid rgba(255, 255, 255, 0.65);
  border-bottom: 2px solid rgba(255, 255, 255, 0.65);

  pointer-events: none;
  opacity: 0.9;
}

/* Disabilitato */
.tl-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Migliora contrasto del menu dropdown (supporto non garantito su tutti i browser) */
.tl-select option {
  background: #0b1324;
  color: rgba(255, 255, 255, 0.92);
}

/* =========================
   DATE INPUT – STILE TUTTO LAVORO
   ========================= */

input[type="date"] {
  margin-top: 4px;
  width: 100%;
  height: 40px;
  padding: 9px 12px;
  border-radius: 12px;

  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);

  font-family: var(--font-main);
  font-size: 14px;

  outline: none;
  appearance: none;
  -webkit-appearance: none;

  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

/* Focus (glow verde come select e input) */
input[type="date"]:focus {
  border-color: var(--accent-green);
  box-shadow:
    0 0 0 2px rgba(52, 211, 153, 0.25),
    0 10px 26px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Icona calendario (Chrome / Edge) */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.75);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Città sempre in MAIUSCOLO (visuale) */
input.city-uppercase {
  text-transform: uppercase;
}

.city-uppercase {
  text-transform: uppercase;
}

/* Barra alfabetica città */
.alpha-bar {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
  overflow-x: auto;
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none;    /* Firefox */
}

.alpha-bar::-webkit-scrollbar {
  display: none;
}

.alpha-letter {
  border: none;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}

.alpha-letter:hover {
  background: rgba(52, 211, 153, 0.35);
  color: #022c22;
  transform: translateY(-1px);
}

.alpha-letter.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.alpha-letter.active {
  background: rgba(52, 211, 153, 0.55);
  color: #022c22;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.6);
  transform: none;
}

/* Nasconde le città precedenti alla lettera selezionata */
.filter-pill.alpha-hidden {
  display: none;
}



/* ===========================
   Mobile UX (smartphone)
   =========================== */

@media (max-width: 768px) {
  /* Topbar più compatta e navigazione “thumb friendly” */
  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo-text .subtitle {
    display: none;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
  }

  /* Layout pagina */
  .page {
    padding: 16px 14px 28px;
  }

  /* Search bar: layout verticale + controlli a piena larghezza */
  .search-bar {
    flex-direction: column;
    gap: 8px;
  }

  .search-bar input {
    min-width: 100%;
    font-size: 16px; /* evita zoom su iOS */
  }

  .search-bar button {
    width: 100%;
  }

  /* Cards: una per riga */
  .cards-list {
    grid-template-columns: 1fr;
  }

  .job-card {
    padding: 16px;
  }

  .job-card h3 {
    font-size: 17px;
  }

  /* Form: più comodi su touch */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* evita zoom su iOS */
    padding: 12px 14px;
  }

  label {
    font-size: 14px;
  }

  /* Barra alfabetica città: sticky + tap più ampio */
  #city-alpha-bar {
    position: sticky;
    top: 64px; /* sotto la topbar */
    z-index: 18;
    padding: 8px 6px;
    margin-top: 6px;
    background: rgba(5, 8, 22, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(10px);
  }

  .alpha-letter {
    min-width: 34px;
    height: 34px;
    font-size: 14px;
  }

  /* Modali: full-screen su telefono */
  .modal-content {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 18px 16px 16px;
  }

  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-actions-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* =========================================================
   FIX MOBILE: MODALE FIRMA CONTRATTO SCROLL + AZIONI VISIBILI
   - Risolve blocco scroll su iPhone/Android
   - Mantiene i pulsanti sempre raggiungibili
   ========================================================= */

#sign-modal .modal-content{
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* Barra azioni sempre visibile in basso (sticky) */
#sign-modal .modal-actions{
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));

  /* Niente “alone” scuro rettangolare dietro i tasti */
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;

  /* Separatore leggero (non invasivo) */
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

@media (max-width: 640px){
  #sign-modal .modal-content{
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    padding: 16px 14px 12px;
  }

  /* Pulsanti più grandi e su più righe */
  #sign-modal .modal-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  #sign-modal .modal-actions button{
    flex: 1 1 48%;
    min-width: 48%;
    padding: 12px 14px;
    font-size: 14px;
  }

  /* Il bottone principale occupa tutta la riga */
  #sign-modal #btn-sign-confirm{
    flex-basis: 100%;
    min-width: 100%;
  }

  /* Canvas più basso: lascia spazio allo scroll */
  #sign-canvas-1,
  #sign-canvas-2{
    height: 170px;
  }
}

/* ===============================
   RIMOZIONE OMBRE PULSANTI MODALE FIRMA
   =============================== */

/* Pulsanti nella modale firma */
#sign-modal .primary-btn,
#sign-modal .secondary-btn,
#sign-modal .nav-pill {
  box-shadow: none !important;
}

/* Stato hover (desktop) */
#sign-modal .primary-btn:hover,
#sign-modal .secondary-btn:hover,
#sign-modal .nav-pill:hover {
  box-shadow: none !important;
}

/* Barra azioni sticky in basso */
#sign-modal .modal-actions,
#sign-modal .modal-footer {
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* =========================
   Canvas firme – override
   ========================= */
.signature-canvas {
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  touch-action: none;
}


/* Nav: stato bloccato (Home/Ricerca) */
.nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.nav-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}


/* Gate Home/Ricerca (contratto firmato per ruolo) */
.nav-btn.is-locked{opacity:.45;cursor:not-allowed;pointer-events:auto;filter:grayscale(0.2);}
.nav-btn.is-locked:hover{transform:none;box-shadow:none;}
