/* ==========================================================
   TPER — Design System CSS
   Phase C: Website Redesign
   Palette: TPER Rosso #CA1424, Bianco #FFFFFF
   ========================================================== */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #F5F5F5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #CA1424; text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #A0101C; }
a:focus-visible { outline: 3px solid #CA1424; outline-offset: 2px; border-radius: 2px; }
ul, ol { padding-left: 1.5rem; }

/* ---------- TYPOGRAPHY ---------- */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; color: #333; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; color: #333; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: #333; }
h4 { font-size: 1.125rem; font-weight: 600; color: #333; }
p { margin-bottom: 0.75rem; }
small { font-size: 0.875rem; color: #777; }

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  background: #CA1424; color: #fff; padding: 8px 16px;
  z-index: 10000; border-radius: 0 0 4px 4px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------- HEADER ---------- */
.site-header {
  background: #CA1424;
  color: #fff;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 1rem;
  height: 60px;
  gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.25rem; font-weight: 700; color: #fff;
  text-decoration: none; white-space: nowrap;
}
.logo svg { width: 32px; height: 32px; }
.logo svg .logo-bg { fill: #fff; }
.logo svg .logo-dot { fill: #CA1424; }
.logo:hover { color: #FFD; }

/* Navigation */
.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav ul {
  list-style: none; display: flex; gap: 0.25rem;
  padding: 0; margin: 0;
}
.main-nav a {
  color: #FFD; text-decoration: none;
  padding: 0.5rem 0.75rem; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Header utility controls */
.header-utilities {
  display: flex; align-items: center; gap: 0.5rem;
}
.lang-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.4);
  color: #fff; padding: 0.3rem 0.6rem; border-radius: 4px;
  font-size: 0.8rem; cursor: pointer; min-width: 4.5rem;
  white-space: nowrap; transition: background 0.2s;
}
.lang-btn:hover { background: rgba(255,255,255,0.2); }
.contrast-toggle, .font-toggle {
  background: none; border: none; color: #fff;
  font-size: 1rem; cursor: pointer; padding: 0.25rem;
  border-radius: 4px; line-height: 1;
}
.contrast-toggle:hover, .font-toggle:hover { background: rgba(255,255,255,0.2); }

/* ---------- HAMBURGER (mobile) ---------- */
.hamburger {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.5rem; cursor: pointer;
  padding: 0.25rem;
}
@media (max-width: 768px) {
  .hamburger { display: block; }
  .main-nav {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    background: #CA1424; padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { display: block; padding: 0.75rem 1rem; }
  .lang-btn { min-width: 2.5rem; font-size: 0.65rem; padding: 0.2rem 0.35rem; }
}

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, #CA1424 0%, #A0101C 100%);
  color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
}
.hero h1 { color: #fff; font-size: 2.25rem; margin-bottom: 0.75rem; }
.hero p { color: #FFD; font-size: 1.125rem; max-width: 600px; margin: 0 auto 1.5rem; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: #FFD;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* ---------- ROUTE PLANNER (hero widget) ---------- */
.route-planner {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  text-align: left;
}
.route-planner .form-row {
  display: flex; gap: 0.75rem;
  flex-wrap: wrap;
}
.route-planner .form-group {
  flex: 1; min-width: 180px;
}
.route-planner label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.route-planner input, .route-planner select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
}
.route-planner input:focus, .route-planner select:focus {
  border-color: #CA1424;
  outline: none;
  box-shadow: 0 0 0 3px rgba(202,20,36,0.15);
}
.route-planner .swap-btn {
  background: #F5F5F5;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  font-size: 1rem;
  transition: background 0.2s;
  align-self: center;
}
.route-planner .swap-btn:hover { background: #ddd; }
.btn-primary {
  display: inline-block;
  background: #CA1424; color: #fff;
  border: none; padding: 0.6rem 1.5rem;
  border-radius: 8px; font-size: 1rem;
  font-weight: 600; cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: #A0101C; color: #fff; }
.btn-secondary {
  display: inline-block;
  background: #F5F5F5; color: #555;
  border: 1px solid #ddd;
  padding: 0.6rem 1.5rem;
  border-radius: 8px; font-size: 1rem;
  font-weight: 500; cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #ddd; }

/* ---------- CONTAINER ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }

/* ---------- PLANNER LAYOUT (mappa + form) ---------- */
.planner-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}
.planner-map {
  flex: 1.3;
  min-width: 0;
}
.planner-map .map-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.planner-map .map-image:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 28px rgba(0,0,0,0.2);
}
.planner-form {
  flex: 1;
  min-width: 320px;
}
.planner-form .route-planner {
  max-width: none;
  margin: 0;
}
@media (max-width: 900px) {
  .planner-layout { flex-direction: column; }
}


/* ---------- INFO BANNER ---------- */
.info-banner {
  background: #FFF0F0;
  border: 1px solid #FCC;
  border-left: 4px solid #CA1424;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.info-banner .icon { font-size: 1.25rem; flex-shrink: 0; }
.info-banner p { margin: 0; font-size: 0.95rem; color: #333; }
.info-banner strong { color: #CA1424; }

/* ---------- CARD GRID ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid #ddd;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.card .card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: #555; font-size: 0.95rem; margin-bottom: 1rem; }
.btn-outline {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 2px solid #CA1424;
  color: #CA1424;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
  background: #CA1424;
  color: #fff;
}

/* Card colors - TPER palette */
.card-red .card-icon { background: #FFF0F0; color: #CA1424; }
.card-green .card-icon { background: #F0FFF4; color: #2E7D32; }
.card-orange .card-icon { background: #FFF8F0; color: #E65100; }
.card-purple .card-icon { background: #F8F0FF; color: #6A1B9A; }
.card-teal .card-icon { background: #F0FFFA; color: #00695C; }
.card-blue .card-icon { background: #F0F5FF; color: #1565C0; }

/* Accessibility card actions */
.a11y-actions, .a11y-langs {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.a11y-actions .btn-outline { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
.a11y-langs .btn-outline { font-size: 0.8rem; padding: 0.3rem 1rem; }

/* ---------- SECTION HEADER ---------- */
.section-header {
  text-align: center;
  margin-bottom: 1rem;
}
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: #777; max-width: 600px; margin: 0 auto; }
.section-header--compact { margin-bottom: 0.5rem; }
.section-header--compact .hero-badge { margin-bottom: 0.4rem; font-size: 0.7rem; padding: 0.2rem 0.6rem; }
.section-header--compact h1 { font-size: 1.3rem; margin-bottom: 0.15rem; }
.section-header--compact p { font-size: 0.85rem; }

/* ---------- PROGRESS BAR ---------- */
.progress-bar {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding: 0;
}
.progress-step {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  position: relative;
  min-width: 80px;
}
.progress-step::after {
  content: '';
  position: absolute;
  top: 50%; right: -50%;
  width: 100%; height: 3px;
  background: #ddd;
  z-index: 0;
  transform: translateY(-50%);
}
.progress-step:last-child::after { display: none; }
.progress-step .step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #F5F5F5;
  color: #999;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  margin: 0 auto 0.5rem;
  position: relative; z-index: 1;
  transition: background 0.3s, color 0.3s;
}
.progress-step.active .step-num { background: #CA1424; color: #fff; }
.progress-step.completed .step-num { background: #2E7D32; color: #fff; }
.progress-step .step-label { font-size: 0.8rem; color: #999; }
.progress-step.active .step-label { color: #CA1424; font-weight: 600; }
.progress-step.completed .step-label { color: #2E7D32; }

/* ---------- CHANNEL CARDS (Dove Comprare) ---------- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.channel-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #ddd;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.channel-card:hover {
  border-color: #CA1424;
  box-shadow: 0 4px 12px rgba(202,20,36,0.1);
}
.channel-card .channel-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}
.channel-card h3 { margin-bottom: 0.25rem; }
.channel-card p { color: #777; font-size: 0.85rem; margin-bottom: 0.75rem; }
/* Channel grid compact variant */
.channel-grid--compact { gap: 0.75rem; }
.channel-grid--compact .channel-card { padding: 0.9rem; }
.channel-grid--compact .channel-card .channel-icon {
  width: 40px; height: 40px; font-size: 1.2rem; margin: 0 auto 0.4rem;
}
.channel-grid--compact .channel-card .channel-tag { margin-bottom: 0.4rem; }
.channel-grid--compact .channel-card p { margin-bottom: 0.5rem; }
.channel-grid--compact .channel-card .btn-primary,
.channel-grid--compact .channel-card .btn-outline {
  padding: 0.3rem 0.7rem; font-size: 0.8rem;
}

.channel-card .channel-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #F5F5F5;
  color: #555;
  margin-bottom: 0.75rem;
}

/* Channel-specific icon colors */
.channel-solweb .channel-icon { background: #FFF0F0; color: #CA1424; }
.channel-roger .channel-icon { background: #F0FFF4; color: #2E7D32; }
.channel-puntotper .channel-icon { background: #FFF8F0; color: #E65100; }
.channel-tabaccheria .channel-icon { background: #F8F0FF; color: #6A1B9A; }
.channel-contactless .channel-icon { background: #F0FFFA; color: #00695C; }
.channel-sanzioni .channel-icon { background: #FFF0F0; color: #B71C1C; }

/* ---------- COMPARISON TABLE ---------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.comparison-table th, .comparison-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #eee;
}
.comparison-table th {
  background: #CA1424;
  color: #fff;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.comparison-table th:first-child {
  text-align: left;
  background: #B0101E;
  width: 130px;
  min-width: 100px;
}
.comparison-table td {
  text-align: center;
  font-size: 0.9rem;
}
.comparison-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #333;
  background: #fafafa;
  border-right: 1px solid #eee;
  font-size: 0.82rem;
}
.comparison-table tbody tr:nth-child(even) td {
  background: #fcfcfc;
}
.comparison-table tbody tr:nth-child(even) td:first-child {
  background: #f5f5f5;
}
.comparison-table tbody tr:hover td {
  background: #FFF5F5;
}
.comparison-table tbody tr:hover td:first-child {
  background: #FFEEEE;
}
.comparison-table .check {
  color: #2E7D32;
  font-size: 1.05rem;
  font-weight: 700;
}
.comparison-table .cross {
  color: #ddd;
  font-size: 0.9rem;
}

/* ---------- ACCORDION ---------- */
.accordion { margin: 1rem 0; }
.accordion-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.accordion-header {
  background: #fff;
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: #333;
}
.accordion-header:hover { background: #F5F5F5; }
.accordion-header .arrow { transition: transform 0.2s; }
.accordion-item.open .accordion-header .arrow { transform: rotate(180deg); }
.accordion-content {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.accordion-item.open .accordion-content {
  max-height: 500px;
  padding: 0 1.25rem 1rem;
}

/* Accordion compact variant */
.accordion--compact { margin: 0.5rem 0; }
.accordion--compact .accordion-header {
  padding: 0.55rem 0.85rem; font-size: 0.9rem;
}
.accordion--compact .accordion-item { margin-bottom: 0.3rem; }
.accordion--compact .accordion-content ol,
.accordion--compact .accordion-content ul { margin-top: 0.25rem !important; margin-bottom: 0.25rem; }
.accordion--compact .accordion-item.open .accordion-content {
  padding: 0 0.85rem 0.6rem;
}

/* ---------- MODAL ---------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.modal .modal-icon { font-size: 3rem; margin-bottom: 1rem; }
.modal h2 { margin-bottom: 0.75rem; }
.modal p { color: #555; margin-bottom: 0.5rem; }
.modal .modal-url {
  background: #F5F5F5;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: monospace;
  margin: 1rem 0;
  word-break: break-all;
}

/* ---------- TRAINER OVERLAY ---------- */
.trainer-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 1500;
}
.trainer-overlay.active { display: block; }


.trainer-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 3px solid #CA1424;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 1502;
  padding: 1rem 1.5rem;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}
.trainer-panel.active { display: block; }
.trainer-panel .trainer-progress {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.trainer-panel .trainer-progress .tp-step {
  height: 6px; flex: 1;
  background: #ddd;
  border-radius: 3px;
  transition: background 0.3s;
}
.trainer-panel .trainer-progress .tp-step.done { background: #2E7D32; }
.trainer-panel .trainer-progress .tp-step.current { background: #CA1424; }
.trainer-panel .trainer-instruction {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.trainer-panel .trainer-description {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.trainer-panel .trainer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.trainer-panel .trainer-actions button {
  flex: 1; min-width: 80px;
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #777;
  flex-wrap: wrap;
}
.breadcrumb a { color: #CA1424; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #ccc; }

/* ---------- SKELETON LOADING ---------- */
.skeleton {
  background: linear-gradient(90deg, #F5F5F5 25%, #ddd 50%, #F5F5F5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 80%; }
.skeleton-title { height: 1.5rem; margin-bottom: 1rem; width: 60%; }
.skeleton-card { height: 200px; margin-bottom: 1rem; }

/* ---------- STATE MESSAGES ---------- */
.state-message {
  text-align: center;
  padding: 3rem 1rem;
}
.state-message .state-icon { font-size: 3rem; margin-bottom: 1rem; }
.state-message h2 { margin-bottom: 0.5rem; }
.state-message p { color: #777; max-width: 400px; margin: 0 auto 1.5rem; }

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem; left: 1.5rem;
  background: #CA1424; color: #fff;
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 950;
  display: none;
  transition: transform 0.2s;
}
.back-to-top.visible { display: flex; align-items: center; justify-content: center; }
.back-to-top:hover { transform: scale(1.1); }

/* ---------- JOURNEY MAP (percorso) ---------- */
.journey-map {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Timeline variant: adds a vertical connecting line */
.journey-map-timeline {
  position: relative;
  padding: 2rem 0;
}
.journey-map-timeline::before {
  content: '';
  position: absolute;
  left: 32px; top: 0; bottom: 0;
  width: 4px;
  background: #CA1424;
  border-radius: 2px;
}
.journey-node {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  position: relative;
}
.journey-node .node-marker {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #CA1424;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}
.journey-node .node-marker.completed { background: #2E7D32; }
.journey-node .node-card {
  flex: 1;
  background: #fff;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.journey-node .node-card h3 { margin-bottom: 0.25rem; }
.journey-node .node-card p { color: #777; font-size: 0.9rem; margin: 0; }
.journey-node .node-card .node-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.node-tag.tperit { background: #FFF0F0; color: #CA1424; }
.node-tag.solweb { background: #F0F5FF; color: #1565C0; }
.node-tag.roger { background: #F0FFF4; color: #2E7D32; }
.node-tag.fisico { background: #FFF8F0; color: #E65100; }

/* ---------- FOOTER ---------- */
.site-footer {
  background: #333;
  color: #999;
  padding: 2rem 1rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-section h4 { color: #fff; margin-bottom: 0.75rem; }
.footer-section ul { list-style: none; padding: 0; }
.footer-section li { margin-bottom: 0.4rem; }
.footer-section a { color: #999; text-decoration: none; font-size: 0.9rem; }
.footer-section a:hover { color: #fff; }
.footer-section button {
  background: none; border: none;
  color: #999; cursor: pointer; font-size: 0.9rem;
  text-decoration: underline; padding: 0;
}
.footer-section button:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px; margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #555;
  text-align: center;
  font-size: 0.85rem;
}

/* ---------- ACCESSIBILITY: HIGH CONTRAST ---------- */
body.high-contrast { background: #000; color: #fff; }
.high-contrast .card, .high-contrast .channel-card,
.high-contrast .route-planner, .high-contrast .modal,
.high-contrast .journey-node .node-card,
.high-contrast .trainer-panel { background: #1A1A1A; border-color: #fff; }
.high-contrast a { color: #FF9999; }
.high-contrast h1, .high-contrast h2, .high-contrast h3, .high-contrast h4 { color: #fff; }
.high-contrast p, .high-contrast .card p, .high-contrast .channel-card p { color: #ddd; }
.high-contrast .info-banner { background: #1A1A1A; border-color: #FF9999; }
.high-contrast .info-banner p { color: #ddd; }
.high-contrast .site-header { background: #000; border-bottom: 2px solid #FF9999; }
.high-contrast .hero { background: #000; }
.high-contrast .route-planner label { color: #ddd; }
.high-contrast .route-planner input { background: #000; color: #fff; border-color: #666; }
.high-contrast .comparison-table th { background: #222; color: #FF9999; }
.high-contrast .comparison-table th:first-child { background: #1A1A1A; }
.high-contrast .comparison-table td { border-color: #444; background: #111; color: #eee; }
.high-contrast .comparison-table td:first-child { background: #1A1A1A; border-right-color: #444; }
.high-contrast .comparison-table tbody tr:nth-child(even) td { background: #181818; }
.high-contrast .comparison-table tbody tr:nth-child(even) td:first-child { background: #151515; }
.high-contrast .comparison-table tbody tr:hover td { background: #222; }
.high-contrast .comparison-table .check { color: #6FCF6F; }
.high-contrast .comparison-table .cross { color: #666; }
.high-contrast .progress-step .step-label { color: #ddd; }
    .high-contrast .journey-map-timeline::before { background: #FF9999; }

/* ---------- ACCESSIBILITY: LARGE TEXT ---------- */
html.font-large { font-size: 20px; }

/* ---------- SOLWEB PAGES ---------- */
.solweb-header {
  background: #1565C0;
}
.solweb-header .logo { color: #fff; }
.solweb-header .main-nav a:hover { background: rgba(255,255,255,0.2); }
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid #ddd;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.form-card h2 { margin-bottom: 1.5rem; text-align: center; }
.form-card--compact { padding: 1.25rem; }
.form-card--compact h2 { margin-bottom: 0.75rem; font-size: 1rem; }
.form-card--compact .form-group { margin-bottom: 0.75rem; }
.form-card--compact .form-group label { font-size: 0.82rem; margin-bottom: 0.2rem; }
.form-card--compact .form-group input { padding: 0.5rem 0.6rem; font-size: 0.88rem; }
.form-card--compact .form-actions { margin-top: 0.75rem; gap: 0.5rem; }
.form-card--compact .form-actions .btn-primary { padding: 0.5rem 0.75rem; font-size: 0.88rem; }
.form-card--compact .form-divider { margin: 0.75rem 0; font-size: 0.8rem; }
.form-card--compact .info-banner { margin-top: 0.75rem !important; }
.form-card--compact .text-center { margin: 0.5rem 0; font-size: 0.85rem; }
.form-group {
  position: relative;
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.35rem;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: #1565C0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}
.form-group .form-help {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.25rem;
}

/* Inline error message (R10) */
.form-error {
  background: #FCE4EC;
  border: 1px solid #EF9A9A;
  border-left: 3px solid #CA1424;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: #B71C1C;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}
.form-error .fe-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.form-error-list { margin: 0.25rem 0 0 0; padding-left: 1.2rem; }
.form-error-list li { margin-bottom: 0.15rem; }
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.form-actions .btn-primary { background: #1565C0; }
.form-actions .btn-primary:hover { background: #0D47A1; }
.form-actions .btn-secondary { background: #F5F5F5; }
.form-divider {
  text-align: center;
  margin: 1.5rem 0;
  color: #999;
  position: relative;
}
.form-divider::before,
.form-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: 45%;
  height: 1px;
  background: #ddd;
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

/* ---------- SANZIONI (Fines Payment) ---------- */
.sanzioni-tabs {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border-radius: 8px; overflow: hidden;
  border: 1px solid #ddd;
}
.sanzioni-tab {
  flex: 1; padding: 0.75rem 1rem;
  background: #f5f5f5; border: none;
  cursor: pointer; font-size: 0.9rem;
  font-weight: 600; color: #555;
  transition: all 0.2s;
}
.sanzioni-tab.active { background: #1565C0; color: #fff; }
.sanzioni-tab:hover:not(.active) { background: #e0e0e0; }
.sanzioni-tab-content { display: none; }
.sanzioni-tab-content.active { display: block; }
.sanzioni-results { max-width: 560px; margin: 1.5rem auto 0; }
.sanzioni-detail-card { background: #f9f9f9; border-radius: 8px; padding: 1rem; }
.sanzioni-detail-row {
  display: flex; justify-content: space-between; padding: 0.5rem 0;
  border-bottom: 1px solid #eee; font-size: 0.9rem;
}
.sanzioni-detail-row:last-child { border-bottom: none; }
.sanzioni-detail-label { font-weight: 600; color: #555; }
.sanzioni-detail-value { color: #333; }
.sanzioni-stato-da-pagare { color: #CA1424; font-weight: 700; }
.sanzioni-pay-summary { background: #f9f9f9; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; }
.sanzioni-pay-row {
  display: flex; justify-content: space-between; padding: 0.5rem 0;
  font-size: 0.9rem;
}
.sanzioni-pay-total {
  border-top: 2px solid #333; margin-top: 0.5rem; padding-top: 0.75rem;
  font-weight: 700; font-size: 1rem;
}
.radio-label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0; cursor: pointer; font-size: 0.9rem;
}

/* ---------- UTILITY ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------- TRAINER BAR ---------- */
.trainer-bar {
  position: fixed;
  top: 0;
  right: -320px; /* hidden by default */
  width: 320px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #ddd;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: right 0.3s ease;
}
.trainer-bar.open {
  right: 0;
}
.trainer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f5f5f5;
  border-bottom: 1px solid #eee;
}
.trainer-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
}
.trainer-errors-badge {
  font-size: 0.75rem;
  color: #718096;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: #f0f0f0;
  white-space: nowrap;
  font-weight: 600;
}
.trainer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0.25rem;
}
.trainer-close:hover {
  color: #333;
}
.trainer-progress-bar {
  height: 6px;
  background: #eee;
  overflow: hidden;
}
.trainer-progress-fill {
  height: 100%;
  background: #CA1424;
  width: 0%;
  transition: width 0.3s ease;
}
.trainer-step-counter {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}
.trainer-nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  border-top: 1px solid #eee;
}
.trainer-nav button {
  flex: 1;
  margin: 0 0.25rem;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.trainer-nav .trainer-prev {
  background: #f5f5f5;
  color: #555;
}
.trainer-nav .trainer-prev:hover {
  background: #e0e0e0;
}
.trainer-nav .trainer-next {
  background: #CA1424;
  color: #fff;
}
.trainer-nav .trainer-next:hover {
  background: #A0101C;
}
.trainer-modules {
  padding: 1rem;
}
.trainer-modules h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #333;
}
.trainer-module-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 2px solid #eee;
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.trainer-module-btn:hover {
  border-color: #CA1424;
  box-shadow: 0 0 0 2px rgba(202,20,36,0.2);
}
.trainer-module-btn strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  color: #333;
}
.trainer-module-btn small {
  display: block;
  color: #777;
  font-size: 0.85rem;
}
.trainer-step {
  padding: 1rem;
  border-top: 1px solid #eee;
}
.trainer-step.active {
  background: #fafafa;
}
.trainer-step .step-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
}
.trainer-step .step-desc {
  color: #555;
  line-height: 1.4;
}
.trainer-step .trainer-action {
  margin-top: 1rem;
}
.trainer-step .trainer-action a.btn-primary {
  display: inline-block;
  background: #CA1424;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}
.trainer-step .trainer-action a.btn-primary:hover {
  background: #A0101C;
}
.trainer-back {
  display: block;
  text-align: left;
  color: #CA1424;
  text-decoration: underline;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.trainer-back:hover {
  color: #A0101C;
}


/* ---------- TRAINER TOGGLE BUTTON (floating, fixed bottom-right) ---------- */
.trainer-toggle-btn {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: #CA1424; color: #fff;
  border: none; border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.trainer-toggle-btn:hover { transform: scale(1.1); }

/* ---------- ORARI E LINEE ---------- */
.line-search {
  display: flex; gap: 0.5rem; max-width: 600px; margin: 0 auto 2rem;
}
.line-search input {
  flex: 1; padding: 0.75rem 1rem; border: 2px solid #ddd; border-radius: 8px;
  font-size: 1rem; outline: none; transition: border-color 0.2s;
}
.line-search input:focus { border-color: #CA1424; }
.line-search button {
  background: #CA1424; color: #fff; border: none; border-radius: 8px;
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.2s;
}
.line-search button:hover { background: #A0101C; }

.line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.line-card {
  background: #fff; border: 1px solid #ddd; border-radius: 12px;
  padding: 1.25rem; cursor: pointer; text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.line-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.line-num {
  background: #CA1424; color: #fff; width: 48px; height: 48px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
}
.line-name { font-weight: 600; font-size: 0.95rem; color: #333; }
.line-info { font-size: 0.8rem; color: #999; }

.line-detail-card {
  background: #fff; border: 1px solid #ddd; border-radius: 12px;
  padding: 2rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.line-detail-header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.ldh-num {
  background: #CA1424; color: #fff; width: 64px; height: 64px;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; flex-shrink: 0;
}
.line-detail-header h3 { margin-bottom: 0.25rem; }
.line-detail-header p { color: #777; margin: 0; }

.line-schedule { margin-bottom: 1.5rem; }
.line-schedule h4, .line-stops h4 { margin-bottom: 0.75rem; font-size: 1.05rem; }

.line-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.line-table th, .line-table td {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid #eee; text-align: left;
}
.line-table th { color: #777; font-weight: 600; font-size: 0.8rem; }
.line-table td { color: #333; }

.stop-list { display: flex; flex-direction: column; gap: 0.5rem; }
.stop-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0;
}
.stop-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #CA1424;
  flex-shrink: 0;
}
.stop-name { font-size: 0.95rem; color: #333; flex: 1; }
.stop-tag {
  font-size: 0.75rem; background: #FFF0F0; color: #CA1424;
  padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600;
}

/* ---------- ZONE FILTER ---------- */
.zone-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  justify-content: center;
}
.zone-btn {
  background: #F5F5F5;
  border: 2px solid transparent;
  border-radius: 24px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.zone-btn:hover {
  background: #E8E8E8;
  border-color: #ddd;
  color: #333;
}
.zone-btn.active {
  background: #CA1424;
  border-color: #CA1424;
  color: #fff;
  font-weight: 600;
}
@media (max-width: 600px) {
  .zone-filter { gap: 0.35rem; }
  .zone-btn { font-size: 0.78rem; padding: 0.35rem 0.9rem; }
}

/* ---------- TICKET WIZARD ---------- */
.ticket-wizard-card {
  background: #fff; border: 1px solid #ddd; border-radius: 16px;
  padding: 2rem; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  margin-bottom: 2rem; max-width: 680px; margin-left: auto; margin-right: auto;
}
.ticket-wizard-step { text-align: center; animation: trainerFadeInUp 0.3s ease-out; }
.ticket-wizard-progress {
  font-size: 0.8rem; color: #999; margin-bottom: 1rem;
}
.ticket-wizard-step h3 {
  font-size: 1.15rem; margin-bottom: 1.25rem; color: #333;
}
.ticket-wizard-options {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.ticket-wizard-opt {
  width: min(100%, 450px); padding: 1rem 1.25rem;
  margin: 0 auto; border: 2px solid #E2E8F0;
  border-radius: 10px; background: #fff; cursor: pointer;
  text-align: center; font-size: 1rem; color: #333;
  transition: border-color 0.2s, background 0.2s;
}
.ticket-wizard-opt:hover { border-color: #CA1424; background: #FFF5F5; }
.ticket-wizard-opt.selected, .ticket-wizard-opt:active { border-color: #CA1424; background: #FFF0F0; }
.ticket-wizard-back {
  margin-top: 0.5rem; font-size: 0.85rem; padding: 0.4rem 1rem;
}
.ticket-wizard-result { text-align: center; animation: trainerFadeInUp 0.35s ease-out; }
.twr-badge {
  display: inline-block; background: #E8F5E9; color: #2E7D32;
  padding: 0.35rem 1rem; border-radius: 20px; font-size: 0.85rem;
  font-weight: 600; margin-bottom: 1rem;
}
.twr-card {
  background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 1.5rem; margin-bottom: 1rem; text-align: left;
}
.twr-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #CA1424; }
.twr-card p { color: #555; font-size: 0.95rem; margin-bottom: 1rem; }
.twr-action { display: flex; gap: 0.5rem; justify-content: center; }
.twr-action .btn-outline { padding: 0.5rem 1.5rem; border-color: #CA1424; color: #CA1424; }
.ticket-wizard-restart {
  margin-top: 0.75rem; font-size: 0.85rem; padding: 0.4rem 1rem;
}

/* ---------- CARD FILTERS ---------- */
.card-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 1rem; background: #FAFAFA; border: 1px solid #E5E7EB;
  border-radius: 12px; margin-bottom: 1.5rem;
}
.card-filters .filter-group {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.card-filters .filter-label {
  font-size: 0.75rem; color: #999; font-weight: 600; text-transform: uppercase;
  margin-right: 0.25rem; white-space: nowrap;
  display: flex; align-items: center;
}
.filter-pill {
  padding: 0.3rem 0.75rem; border: 1px solid #ddd;
  border-radius: 20px; background: #fff; cursor: pointer;
  font-size: 0.8rem; color: #555; white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill:hover { border-color: #CA1424; color: #CA1424; }
.filter-pill.active { background: #CA1424; color: #fff; border-color: #CA1424; }
.filter-reset {
  padding: 0.3rem 0.75rem; border: 1px dashed #ccc;
  border-radius: 20px; background: transparent; cursor: pointer;
  font-size: 0.8rem; color: #999; margin-left: auto;
}
.filter-reset:hover { border-color: #999; color: #333; }
.filter-count { font-size: 0.8rem; color: #999; margin-left: 0.5rem; }

/* Compact filter layout — wrapped label+group pairs */
.card-filters--compact { gap: 0.35rem; padding: 0.6rem 0.75rem; }
.filter-block {
  display: inline-flex; align-items: center; gap: 0.2rem;
}
.filter-block + .filter-block { margin-left: 0.15rem; }
.filter-actions {
  display: flex; align-items: center; gap: 0.35rem; margin-left: auto;
}
.card-filters--compact .filter-pill {
  padding: 0.2rem 0.55rem; font-size: 0.75rem;
}
.card-filters--compact .filter-label { font-size: 0.7rem; }
.card-filters--compact .filter-group { gap: 0.2rem; }
.card-filters--compact .filter-reset { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.card-filters--compact .filter-count { font-size: 0.75rem; }

/* Info banner compact variant */
.info-banner--compact {
  padding: 0.55rem 0.85rem; margin-top: 0.4rem; margin-bottom: 0.4rem;
  gap: 0.5rem;
}
.info-banner--compact .icon { font-size: 1rem; }
.info-banner--compact p { font-size: 0.85rem; line-height: 1.35; }
.info-banner--compact .btn-primary {
  display: inline-block; margin-top: 0.25rem !important;
  padding: 0.25rem 0.65rem; font-size: 0.8rem;
}

/* Tighter card grid */
.card-grid--compact { gap: 0.75rem; }
.card-grid--compact .card { padding: 0.7rem; }

/* Tighter wizard section */
.wizard-section--compact { margin-bottom: 0.75rem; }
.wizard-section--compact .section-header { margin-bottom: 0.4rem; }
.wizard-section--compact h2 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.wizard-section--compact p { font-size: 0.85rem; }
#start-guide { display: block; margin-left: auto; margin-right: auto; }

/* ---------- SCROLL INDICATOR ---------- */
.scroll-indicator {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.15rem; padding: 0.5rem 0 0.25rem;
  text-decoration: none; cursor: pointer;
  transition: opacity 0.2s;
}
.scroll-indicator:hover { opacity: 0.7; }
.scroll-indicator__text {
  font-size: 0.8rem; color: #999; font-weight: 500;
}
.scroll-indicator__chevron {
  font-size: 0.75rem; color: #CA1424;
  animation: scrollBounce 1.5s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================================
   TRAINER ENHANCED — Dashboard (R13), Riepilogo (R6), Rating
   ============================================================ */

.trainer-step {
  animation: trainerFadeInUp 0.35s ease-out;
}
@keyframes trainerFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Welcome message (R9) */
.trainer-welcome {
  background: #FFF8E1;
  border: 1px solid #FFC107;
  border-left: 3px solid #F9A825;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #5D4037;
  margin-bottom: 1rem;
  line-height: 1.4;
  text-align: center;
}

.trainer-highlight {
  outline: 3px solid #CA1424;
  outline-offset: 6px;
  border-radius: 8px;
  animation: trainerGlow 2s ease-in-out infinite;
  transition: box-shadow 0.3s;
}
@keyframes trainerGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(202,20,36,0.35); }
  50%      { box-shadow: 0 0 0 14px rgba(202,20,36,0); }
}

/* Trainer tooltip (R4) */
.trainer-tooltip {
  position: fixed;
  background: #333;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  max-width: 260px;
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  line-height: 1.4;
  text-align: center;
}
.trainer-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

/* Dashboard (R13) */
.trainer-dashboard {
  padding: 1rem;
  border-bottom: 2px solid #f0f0f0;
}
.trainer-dashboard-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 0.5rem;
}
.trainer-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.trainer-dashboard-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 0.6rem;
  text-align: center;
  border: 1px solid #eee;
  transition: transform 0.15s;
}
.trainer-dashboard-card:hover {
  transform: translateY(-1px);
}
.trainer-dashboard-card .tdc-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #CA1424;
}
.trainer-dashboard-card .tdc-label {
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.15rem;
}
.trainer-dashboard-empty {
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  padding: 0.5rem;
}
.trainer-dashboard-reset {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.3rem;
  background: none;
  border: 1px dashed #ddd;
  border-radius: 4px;
  color: #999;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.trainer-dashboard-reset:hover {
  border-color: #CA1424;
  color: #CA1424;
}

/* Module Cards - Enhanced */
.trainer-module-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  border: 2px solid #eee;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s;
}
/* Trainer field validation indicator */
.trainer-field-check {
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #2E7D32;
  font-weight: bold;
  font-size: 1rem;
  pointer-events: none;
}

.trainer-module-card:hover {
  border-color: #CA1424;
  box-shadow: 0 2px 12px rgba(202,20,36,0.12);
  transform: translateY(-2px);
}
.trainer-module-card .tmc-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: #fff;
}
.trainer-module-card .tmc-info {
  flex: 1;
  min-width: 0;
}
.trainer-module-card .tmc-info strong {
  display: block;
  font-size: 0.95rem;
  color: #222;
  margin-bottom: 0.15rem;
}
.trainer-module-card .tmc-info small {
  display: block;
  font-size: 0.75rem;
  color: #888;
}
.trainer-module-card .tmc-meta {
  font-size: 0.7rem;
  color: #aaa;
  text-align: right;
  flex-shrink: 0;
}

/* Tip bubble */
.trainer-tip {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #FFF8E1;
  border-left: 3px solid #F9A825;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #6D4C00;
  line-height: 1.4;
}
.trainer-tip strong {
  color: #E65100;
}

/* Step action button - enhanced */
.trainer-step-action {
  margin-top: 0.75rem;
}
.trainer-step-action a,
.trainer-step-action button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #CA1424;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.trainer-step-action a:hover,
.trainer-step-action button:hover {
  background: #A0101C;
  transform: translateY(-1px);
}

/* Hint indicator */
.trainer-hint {
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #FCE4EC;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #CA1424;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Completion message */
.trainer-complete-msg {
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  color: #2E7D32;
  animation: trainerFadeInUp 0.4s ease-out;
}

/* Progress bar segmented */
.trainer-progress-segmented {
  display: flex;
  gap: 3px;
  padding: 0 1rem 0.5rem;
}
.trainer-progress-segmented .tps-seg {
  flex: 1;
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  transition: background 0.3s;
}
.trainer-progress-segmented .tps-seg.done    { background: #2E7D32; }
.trainer-progress-segmented .tps-seg.current { background: #CA1424; animation: tpsPulse 1s ease-in-out infinite; }
@keyframes tpsPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* Likert / Rating (R6) */
.trainer-rating {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid #eee;
}
.trainer-rating p {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.5rem;
}
.trainer-rating-stars {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.trainer-rating-stars button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  color: #bbb;
  transition: all 0.2s;
}
.trainer-rating-stars button:hover {
  border-color: #CA1424;
  color: #CA1424;
}
.trainer-rating-stars button.active {
  background: #CA1424;
  border-color: #CA1424;
  color: #fff;
  transform: scale(1.1);
}
.trainer-rating-skip {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #aaa;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}
.trainer-rating-skip:hover {
  color: #888;
}

/* Summary / Riepilogo (R6) */
.trainer-summary {
  padding: 1rem;
}
.trainer-summary h4 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #CA1424;
  padding-bottom: 0.35rem;
}
.trainer-summary-section {
  margin-bottom: 1rem;
}
.trainer-summary-section h5 {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.trainer-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}
.trainer-summary-item .tsi-label {
  color: #555;
}
.trainer-summary-item .tsi-value {
  font-weight: 600;
  color: #333;
}
.trainer-summary-contacts {
  background: #f9f9f9;
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.6;
  white-space: pre-line;
}
.trainer-summary-print-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem;
  background: #CA1424;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.trainer-summary-print-btn:hover {
  background: #A0101C;
}

/* Rating stars in summary */
.trainer-summary-stars {
  display: inline-flex;
  gap: 2px;
}
.trainer-summary-stars .tss-star {
  color: #CA1424;
  font-size: 1rem;
}
.trainer-summary-stars .tss-star.empty {
  color: #ddd;
}

/* Print mode for summary */
@media (max-width: 720px) {
  .comparison-table { font-size: 0.75rem; }
  .comparison-table th, .comparison-table td { padding: 0.5rem 0.35rem; }
  .comparison-table th { font-size: 0.7rem; }
  .comparison-table th:first-child { width: 90px; min-width: 80px; }
  .comparison-table td:first-child { font-size: 0.72rem; }
  .comparison-table .check { font-size: 0.9rem; }
  .comparison-table .cross { font-size: 0.75rem; }
}

@media print {
  .trainer-bar {
    position: static !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .trainer-header,
  .trainer-nav,
  .trainer-rating,
  .trainer-dashboard,
  .trainer-progress-bar,
  .trainer-progress-segmented,
  .trainer-step-counter,
  .trainer-complete-msg {
    display: none !important;
  }
  .trainer-summary {
    page-break-inside: avoid;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.625rem; }
  .hero p { font-size: 1rem; }
  .route-planner .form-row { flex-direction: column; }
  .route-planner .swap-btn { align-self: flex-end; margin-top: -0.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 0.5rem; }
  .site-footer .footer-inner { grid-template-columns: 1fr; }
  .journey-map-timeline::before { left: 24px; }
  .journey-node .node-marker { width: 48px; height: 48px; font-size: 1.1rem; }
  .trainer-panel { max-height: 260px; }
  .trainer-bar { width: 100vw; }
  .trainer-bar.open { right: 0; }
  .form-card { padding: 1.25rem; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- PRINT ---------- */
@media print {
  .site-header, .site-footer, .trainer-panel,
  .trainer-overlay, .back-to-top, .hamburger { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .hero { background: #fff; color: #000; padding: 1rem; }
  .hero h1 { color: #000; }
  .route-planner { box-shadow: none; border: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- SEARCH TOGGLE ---------- */
.search-toggle {
  background: none; border: none; color: #fff;
  font-size: 1rem; cursor: pointer; padding: 0.25rem 0.5rem;
  border-radius: 4px; line-height: 1;
}
.search-toggle:hover { background: rgba(255,255,255,0.2); }

/* ---------- SEARCH OVERLAY ---------- */
.search-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999; justify-content: center;
  padding: 2rem;
}
.search-overlay.open { display: flex; }
.search-overlay-content {
  background: #fff; border-radius: 12px;
  max-width: 600px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
}
.search-overlay-header {
  display: flex; align-items: center;
  padding: 1rem; gap: 0.5rem;
  border-bottom: 1px solid #eee;
}
.search-overlay-input {
  flex: 1; border: 1px solid #ddd;
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 1rem; outline: none;
}
.search-overlay-input:focus { border-color: #CA1424; }
.search-overlay-close {
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: #666; padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.search-overlay-close:hover { background: #f5f5f5; color: #333; }
.search-overlay-results { padding: 1rem; flex: 1; }
.search-overlay-result {
  display: block; padding: 0.75rem;
  border-radius: 8px; text-decoration: none;
  color: #333; border-bottom: 1px solid #f0f0f0;
}
.search-overlay-result:hover { background: #f9f9f9; }
.search-overlay-result h4 { margin-bottom: 0.25rem; color: #CA1424; }
.search-overlay-result p { font-size: 0.875rem; color: #666; margin: 0; }
.search-overlay-empty {
  text-align: center; padding: 2rem;
  color: #999; font-size: 0.9rem;
}

/* ---------- NEWS PAGE ---------- */
.news-header {
  background: linear-gradient(135deg, #CA1424 0%, #A0101C 100%);
  color: #fff; padding: 2rem 1rem; text-align: center;
}
.news-header h1 { color: #fff; font-size: 2rem; margin-bottom: 0.5rem; }
.news-header p { color: #FFD; max-width: 600px; margin: 0 auto; }
.news-categories {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center; padding: 1.5rem 1rem 1rem;
  background: #fff; border-bottom: 1px solid #eee;
}
.news-cat-btn {
  background: #f5f5f5; border: 1px solid #ddd;
  padding: 0.5rem 1rem; border-radius: 20px;
  font-size: 0.85rem; cursor: pointer;
  transition: all 0.2s; color: #555;
}
.news-cat-btn:hover { background: #eee; }
.news-cat-btn.active { background: #CA1424; color: #fff; border-color: #CA1424; }
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; padding: 2rem 0;
}
.news-card {
  background: #fff; border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.news-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.news-card-image {
  width: 100%; height: 160px;
  background: #f0f0f0; display: flex;
  align-items: center; justify-content: center;
  color: #aaa; font-size: 2.5rem;
}
.news-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.news-card-tag {
  display: inline-block; font-size: 0.75rem;
  background: #f0f0f0; color: #CA1424;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  font-weight: 600; margin-bottom: 0.5rem;
  align-self: flex-start;
}
.news-card-date { font-size: 0.8rem; color: #999; margin-bottom: 0.5rem; }
.news-card h3 { font-size: 1rem; margin-bottom: 0.5rem; line-height: 1.4; }
.news-card p { font-size: 0.875rem; color: #666; margin-bottom: 1rem; flex: 1; }
.news-card .btn-outline { align-self: flex-start; margin-top: auto; }
.news-load-more { text-align: center; padding: 1.5rem 0; }

@media (max-width: 768px) {
  .news-grid { grid-template-columns: 1fr; }
  .search-overlay { padding: 1rem; }
  .search-overlay-content { max-height: 90vh; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- PROGRESS LABEL ---------- */
.progress-label {
  text-align: center; color: #666; font-size: 0.85rem;
  margin-bottom: 0.75rem; font-weight: 500;
}
.progress-bar--compact { margin-bottom: 1rem; }
.progress-bar--compact .progress-step { padding: 0.35rem 0.3rem; min-width: 60px; }
.progress-bar--compact .progress-step .step-num {
  width: 26px; height: 26px; font-size: 0.78rem; margin-bottom: 0.25rem;
}
.progress-bar--compact .progress-step .step-label { font-size: 0.7rem; }
.progress-bar--compact .progress-step::after { height: 2px; }

/* ---------- R6: PRINT SUMMARY 14pt ---------- */
@media print {
  .trainer-summary { font-size: 14pt !important; }
  .trainer-summary h4 { font-size: 16pt !important; }
  .trainer-summary h5 { font-size: 14pt !important; }
  .trainer-summary-item { font-size: 13pt !important; }
  .trainer-summary-item small { font-size: 11pt !important; }
  .trainer-summary-contacts { font-size: 12pt !important; white-space: pre-line; }
  .trainer-summary-print-btn { display: none !important; }
  /* R11: show missing docs in print */
  .doc-card { border: 1px solid #ddd; }
  .doc-card .doc-check:not(:checked) ~ *,
  .doc-card:has(.doc-check:not(:checked)) { outline: 2px solid #CA1424; }
}

/* ---------- BUY BANNER ---------- */
.buy-banner {
  background: #CA1424; color: #fff; padding: 0.75rem 1rem;
  position: sticky; top: 60px; z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.buy-banner-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.buy-banner-icon { font-size: 1.5rem; }
.buy-banner-inner span { flex: 1; font-size: 0.9rem; min-width: 200px; }
.buy-banner-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.buy-banner-links a {
  color: #fff; text-decoration: underline;
  font-weight: 600; font-size: 0.85rem;
  text-underline-offset: 3px;
}
.buy-banner-links a:hover { color: #FFD; }
#dismiss-buy-banner {
  background: none; border: 1px solid rgba(255,255,255,0.5);
  color: #fff; padding: 0.3rem 0.6rem; border-radius: 4px;
  cursor: pointer; font-size: 0.8rem; white-space: nowrap;
}
#dismiss-buy-banner:hover { background: rgba(255,255,255,0.2); }
@media (max-width: 768px) {
  .buy-banner-inner { flex-direction: column; text-align: center; }
  .buy-banner-links { justify-content: center; }
}

/* ---------- DOCUMENT VISUAL (PR-01) ---------- */
.doc-visual { margin: 0.75rem 0; }
.doc-visual-card {
  background: #fafafa; border: 1px solid #ddd;
  border-radius: 8px; padding: 0.6rem 0.75rem;
  font-family: 'Courier New', monospace; font-size: 0.78rem;
  max-width: 300px; line-height: 1.5;
}
.doc-visual-header {
  font-weight: 700; font-size: 0.75rem;
  color: #333; margin-bottom: 0.35rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.doc-visual-body span {
  display: block; color: #777; margin-bottom: 0.12rem;
}
.doc-visual-highlight {
  background: #FFF9C4; border-left: 3px solid #F9A825;
  padding: 0.1rem 0.4rem; color: #333 !important;
  font-weight: 600; margin: 0.2rem 0;
}

/* ---------- TOOLTIP TERM (PR-04) ---------- */
.tooltip-term {
  border-bottom: 1px dashed #CA1424;
  cursor: help;
  position: relative;
}
.tooltip-term:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: #333; color: #fff;
  padding: 0.5rem 0.75rem; border-radius: 6px;
  font-size: 0.8rem; line-height: 1.4; white-space: normal;
  width: 260px; z-index: 100; pointer-events: none;
}

/* ---------- POST-PURCHASE STEPS (UR-02) ---------- */
.post-purchase-steps { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.pps-step { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; color: #333; }
.pps-num { background: #2E7D32; color: #fff; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }

/* ---------- UR-03: ERROR ANIMATION & ICON ---------- */
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.form-error-field {
  animation: fieldShake 0.4s ease;
  border-color: #CA1424 !important;
}
.field-error-icon {
  display: inline-block; color: #CA1424;
  font-size: 1.1rem; margin-left: 0.3rem;
  animation: fieldShake 0.4s ease;
  vertical-align: middle;
}
