/* ==========================================================================
 * Global CSS Variables - Optimized for OGS Branding & Accessibility
 * ========================================================================== */

:root {
  /* Font Family Overrides - Bootstrap Italia Typography Standards */
  --bs-font-sans-serif: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-serif: "Lora", Georgia, "Times New Roman", Times, serif;
  --bs-font-monospace: "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-heading-font-family: var(--bs-font-sans-serif);

  /* Brand Palette - OGS */
  --color-brand-primary: #11366D; /* Blu Zaffiro Profondo */
  --color-brand-secondary: #18b3dd; /* Accent cyan */
  --color-action-default: #005a9c; /* Default action color */
  --color-action-hover: #194680;  
  --color-action-active: #0D2952;  
  --color-link: var(--color-action-default);  

  /* Interactive State Colors */
  --color-state-error: #d32f2f;  
  --color-state-error-light: #ffebee;  
  --color-state-success: #2e7d32;  
  --color-state-success-light: #e8f5e8;  
  --color-state-info: var(--color-brand-secondary);  
  --color-state-info-light: #e1f5fe;  
  --color-state-warning: #f57c00;  
  --color-state-warning-light: #fff3e0;  

  /* Neutral Colors & Backgrounds */
  --color-neutral-light: #ffffff;  
  --color-neutral-dark: #193153;  
  --color-neutral-darker: #0f1f38;  
  --color-neutral-border: #b3b9c5;  
  --color-neutral-border-light: #e1e5eb;  
  --color-neutral-background: #f8fafc;  
  --color-neutral-gray: #64748b;  

  /* Gradients & Semantic Backgrounds */
  --gradient-primary: var(--color-brand-primary);  
  --color-bg-body: var(--color-neutral-background);  
  --color-bg-main: var(--color-neutral-light);  
  --color-bg-help: #f0f7ff;  
  --color-bg-component: #f8fbff;  
  --color-bg-note: #f9fafb;  
  --color-bg-code: #1e293b;  
  --color-bg-disabled: #e2e8f0;

  /* Text Colors */
  --color-text-default: var(--color-neutral-dark);  
  --color-text-light: var(--color-neutral-gray);  
  --color-text-code: #e2e8f0;  
  --color-text-note: #334e68;  

  /* Shadows */
  --shadow-opacity-low: 0.08;
  --shadow-opacity-medium: 0.15;
  --shadow-opacity-high: 0.25;
  --shadow-color-accent: 0, 90, 156;  
  --shadow-color-light: 148, 163, 184;  
  --shadow-main: 0 2px 8px rgba(var(--shadow-color-light), var(--shadow-opacity-medium));  
  --shadow-component: 0 1px 4px rgba(var(--shadow-color-accent), var(--shadow-opacity-low));  
  --shadow-hover: 0 8px 30px rgba(17, 54, 109, var(--shadow-opacity-medium));  

  /* Borders & Radii */
  --border-width-lg: 0.375rem;  
  --border-width-md: 2px;  
  --border-width-sm: 1px;  
  --border-width-focus: 3px;  
  --radius-xl: 1rem;
  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-xs: 0.25rem;

  /* Spacing Scale */
  --space-10x: 5rem;
  --space-8x: 4rem;
  --space-6x: 3rem;
  --space-5x: 2.5rem;
  --space-4x: 2rem;
  --space-3x: 1.5rem;
  --space-2x: 1rem;
  --space-1x: 0.5rem;
  --space-0_5x: 0.25rem;

  /* Responsive Font Sizes (Fluid Typography via clamp) */
  --font-h1: clamp(1.4rem, 5vw, 2.2rem);
  --font-h2: clamp(1.2rem, 4vw, 1.8rem);
  --font-h3: clamp(1.1rem, 3vw, 1.4rem);
  --font-h4: clamp(1rem, 2.5vw, 1.25rem);
  --font-h5: clamp(0.95rem, 2.2vw, 1.1rem);
  --font-h6: clamp(0.9rem, 2vw, 1rem);
  --font-header-title: clamp(1.2rem, 3vw, 1.6rem);
  --font-body: clamp(0.9rem, 2vw, 1.05rem);
  --font-editorial: clamp(1.05rem, 2.2vw, 1.2rem);
  --font-small: clamp(0.85rem, 1.8vw, 0.95rem);
  --font-xsmall: clamp(0.8rem, 1.6vw, 0.875rem);

  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}

/* ==========================================================================
 * Base Styles & Resets
 * ========================================================================== */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg-body);
  font-family: var(--bs-body-font-family);
  font-size: var(--font-body);
  line-height: 1.7;
  color: var(--color-text-default);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* WCAG Compliant Focus Ring - Esclusi gli input di sistema gestiti da Bootstrap */
:not(input):not(select):not(textarea):not(.form-check-input):focus-visible {
  outline: var(--border-width-focus) solid var(--color-action-default);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.8);
}

::selection {
  background-color: rgba(0, 90, 156, 0.2);
  color: var(--color-text-default);
}

/* ==========================================================================
 * Layout (Main Container)
 * ========================================================================== */

#main {
  background-color: var(--color-bg-main);
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(17, 54, 109, 0.08);
  margin-top: var(--space-4x);
  margin-bottom: var(--space-10x);
  max-width: 1140px; 
  margin-left: auto;
  margin-right: auto;
}

#main .col-lg-8,
#main .col-lg-10 {
  margin-left: auto;
  margin-right: auto;
}

.site-container {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  max-width: 100%;
}

/* ==========================================================================
 * Typography & Text Content
 * ========================================================================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.it-title, .custom-legend, #token-title, #selector-title, #download-title {
  font-family: var(--bs-heading-font-family);
  color: var(--color-brand-primary);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--font-h1); margin-bottom: var(--space-4x); }
h2 { font-size: var(--font-h2); margin-top: var(--space-6x); margin-bottom: var(--space-3x); }
h3 { font-size: var(--font-h3); margin-top: var(--space-4x); margin-bottom: var(--space-2x); }
h4 { font-size: var(--font-h4); margin-top: var(--space-3x); margin-bottom: var(--space-1x); }
h5 { font-size: var(--font-h5); margin-top: var(--space-2x); margin-bottom: var(--space-1x); font-weight: 600; }
h6 { font-size: var(--font-h6); margin-top: var(--space-2x); margin-bottom: var(--space-1x); font-weight: 600; color: var(--color-text-light); }

h1.it-title {
  text-align: center;
  width: 100%;
  margin-bottom: var(--space-4x);
}

/* Centers the elements immediately preceding an h1.it-title (e.g., badges) */
.mb-3:has(+ h1.it-title) {
  text-align: center;
  width: 100%;
}

.lead {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  color: var(--color-text-light);
}

.note {
  color: var(--color-text-note);
  display: block;
  margin: var(--space-1x) 0 var(--space-2x);
  font-style: italic;
  font-size: var(--font-small);
}

/* Editorial Content (Articoli, Testi estesi) - Bootstrap Italia Lora Implementation */
article p, 
.editorial-content p {
  font-family: var(--bs-font-serif);
  font-size: var(--font-editorial);
  line-height: 1.8;
  color: var(--color-text-default);
  margin-bottom: var(--space-3x);
}

/* ==========================================================================
 * Header Overrides (Dark Theme Adaptation)
 * ========================================================================== */

.it-header-wrapper {
  position: relative;
  background: transparent;
  background-image: none;
  box-shadow: none;
}

/* Creates the solid blue background behind the transparent header components */
.it-header-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-brand-primary); 
  z-index: 0; 
  pointer-events: none;
}

.it-header-wrapper .it-header-slim-wrapper,
.it-header-wrapper .it-header-center-wrapper,
.it-header-wrapper .it-header-navbar-wrapper {
  background: transparent;
  position: relative;
  z-index: 1;
}

.it-header-wrapper .it-header-center-wrapper {
  padding-top: var(--space-3x);
  padding-bottom: var(--space-7x);
}

/* Enforce white color for all elements inside the dark header, EXCEPT dropdowns */
.it-header-wrapper,
.it-header-wrapper *:not(.dropdown-menu):not(.dropdown-item):not(.dropdown-menu *) {
  color: #ffffff;
}

/* Restore default colors for dropdown menus */
.it-header-wrapper .dropdown-menu,
.it-header-wrapper .dropdown-menu *,
.it-header-wrapper .dropdown-item {
  background-color: #ffffff;
  color: var(--color-neutral-darker);
}

/* Ensure center wrapper elements are properly aligned */
.it-header-center-wrapper .it-brand-text h5 {
  font-size: var(--font-header-title);
  margin-bottom: 0;
  text-align: center;
}
.it-header-center-wrapper .col-12.d-flex,
.it-header-center-wrapper .col-12 > div.d-flex.flex-column {
  align-items: center;
}

/* Logos */
.logo-header, .logo-footer {
  max-width: clamp(220px, 30vw, 500px);
  width: 100%;
  height: auto;
  display: inline-block;
  user-select: none;
}
.logo-header { margin: var(--space-3x) auto; }
.logo-footer { margin: var(--space-3x) 0; }

/* Constrain logo heights specifically */
.logo-header-img, .logo-sponsor-img {
  max-height: 80px;
  width: auto;
  object-fit: contain; /* Prevent stretching */
}

/* ==========================================================================
 * Language Selector
 * ========================================================================== */

.lang-selector { margin-bottom: var(--space-0_5x); }

.lang-selector .btn-group {
  display: inline-flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.lang-selector .btn-group .btn {
  border-radius: 0;
  padding: var(--space-0_5x) var(--space-2x);
  font-size: var(--font-small);
  font-weight: 600;
  background-color: transparent;
  color: #ffffff;
  border: none;
  transition: background-color 0.2s ease;
}

.lang-selector .btn-group .btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Active State Logic */
.lang-selector .btn-group .btn.active,
html[lang="it"] .lang-selector .btn[lang="it"],
html[lang="en"] .lang-selector .btn[lang="en"] { 
  background-color: var(--color-action-default); 
  color: #ffffff; 
  font-weight: 700; 
}

/* ==========================================================================
 * UI Components (Cards, Buttons, Accordions)
 * ========================================================================== */

/* Cards */
.card-bg {
  background-color: var(--color-neutral-light); 
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-bg:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.card-bg .card-title, .card-bg h3, .card-bg .text-primary {
  color: var(--color-brand-primary);
}

/* Buttons */
.btn-primary { 
  border-radius: 50px; 
}

/* Definizione strutturale per pulsanti con icona */
.btn.btn-icon {
  display: inline-flex;
  flex-direction: row; 
  align-items: center; 
  justify-content: center;
  gap: 0.5rem; 
  vertical-align: middle;
  padding: 0.5rem 1rem; 
}

/* Comportamento stringente per l'icona SVG: evita deformazioni e a-capo non desiderati */
.btn.btn-icon svg.icon { 
  margin: 0 !important; 
  display: block; 
  flex-shrink: 0; 
}

/* Comportamento stringente per lo span di testo: allinea il testo alla base dell'icona */
.btn.btn-icon span:not(.visually-hidden) { 
  display: block;
  margin: 0; 
  padding: 0; 
  line-height: 1; 
  white-space: nowrap; 
}

/* ==========================================================================
 * Detached Accordion Customization
 * ========================================================================== */

.custom-detached-accordion .accordion-item {
  background-color: var(--color-neutral-light);
  border: 1px solid var(--color-neutral-border-light);
  border-left: 4px solid var(--color-brand-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-component);
  margin-bottom: var(--space-3x);
  overflow: hidden;
}

/* Override dei bordi nativi di Bootstrap Italia per il primo e ultimo elemento */
.custom-detached-accordion .accordion-item:first-of-type,
.custom-detached-accordion .accordion-item:last-of-type {
  border-radius: var(--radius-md) !important;
}

.custom-detached-accordion .accordion-button {
  padding: 1.25rem 1.5rem;
  background-color: transparent;
  font-weight: 600;
  color: var(--color-brand-primary);
  box-shadow: none !important; /* Rimuove l'outline blu nativa al click */
}

/* Stile quando il pannello è aperto */
.custom-detached-accordion .accordion-button:not(.collapsed) {
  background-color: #f8fafc;
  color: var(--color-brand-primary);
}

/* Linea separatrice tra bottone e contenuto */
.custom-detached-accordion .accordion-collapse {
  border-top: 1px solid var(--color-neutral-border-light);
}

/* Nasconde le pseudo-linee grigie native tra i blocchi accordion di Bootstrap */
.custom-detached-accordion .accordion-header::before,
.custom-detached-accordion .accordion-item::before,
.custom-detached-accordion .accordion-item::after {
  display: none !important;
}

/* Layout Flexbox per centramento e spaziatura del corpo interno */
.custom-detached-accordion .accordion-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.custom-detached-accordion .accordion-body p {
  margin-bottom: 1rem;
}

/* Rimuove il margine inferiore dell'ultimo figlio per bilanciare il padding */
.custom-detached-accordion .accordion-body > :last-child {
  margin-bottom: 0;
}

/* ==========================================================================
 * Form Elements & Custom Sections
 * ========================================================================== */

.help {
  background-color: var(--color-bg-help);
  border-left: var(--border-width-lg) solid var(--color-action-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-component);
  margin-bottom: var(--space-5x);
  padding: clamp(var(--space-2x), 4vw, var(--space-3x));
}
.help ul, #limit-message ul { padding-left: 1.5em; margin: 0; }
.help li, #limit-message li { margin-bottom: var(--space-1x); font-size: var(--font-body); }

.custom-fieldset {
  background-color: var(--color-bg-component);
  border: var(--border-width-md) solid var(--color-neutral-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5x);
  padding: clamp(var(--space-2x), 4vw, var(--space-3x));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.custom-fieldset:focus-within {
  border-color: var(--color-action-default);
  box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}
.custom-legend {
  background-color: var(--color-bg-component);
  padding: 0 var(--space-1x);
  margin-left: var(--space-1x);
}

.card-highlight {
  background-color: var(--color-bg-component);
  border: var(--border-width-sm) solid var(--color-action-default);
  border-radius: var(--radius-md);
  padding: clamp(var(--space-2x), 4vw, var(--space-3x));
}

/* Forms Inputs & Feedback */
.form-label, label:not(.form-check-label):not(.custom-control-label) {
  font-size: var(--font-small);
  font-weight: 600;
  margin-bottom: var(--space-1x);
  display: block;
}

.form-select.it-select, .form-control.it-input {
  border: var(--border-width-sm) solid var(--color-neutral-border); 
  border-radius: var(--radius-sm);
  padding: var(--space-1x) var(--space-2x); 
  font-size: var(--font-body); 
  background-color: var(--color-neutral-light);
}

.invalid-feedback {
  display: none; 
  color: var(--color-state-error); 
  margin-top: var(--space-1x);
  font-weight: 600; 
  font-size: var(--font-xsmall); 
  padding: var(--space-0_5x) var(--space-1x);
  background-color: var(--color-state-error-light); 
  border-radius: var(--radius-sm);
  border-left: var(--border-width-sm) solid var(--color-state-error); 
  width: fit-content; 
  max-width: 100%;
}
.is-invalid ~ .invalid-feedback { display: block; }
.is-invalid { 
  border-color: var(--color-state-error) !important; 
  box-shadow: 0 0 0 0.2rem rgba(211, 47, 47, 0.1) !important; 
}
#station-checkbox-list.is-invalid, #channel-checkbox-list.is-invalid {
  border-color: var(--color-state-error) !important; 
  box-shadow: 0 0 0 0.1rem rgba(211, 47, 47, 0.1) !important;
}

/* ==========================================================================
 * Station / Channel Checkbox Grids
 * ========================================================================== */

.station-header-group { margin-top: var(--space-4x); }
.station-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  max-height: min(400px, 50vh);
  overflow-y: auto;
  padding: 1.5rem;
  border: 1px solid var(--color-neutral-border-light);
  border-radius: var(--radius-md);
  background-color: var(--color-neutral-light);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.station-checkbox-list .form-check {
  margin-bottom: 0;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}
.station-checkbox-list .form-check:hover { background-color: var(--color-bg-disabled); }

/* Custom Scrollbar for the grids */
.station-checkbox-list::-webkit-scrollbar { width: 6px; }
.station-checkbox-list::-webkit-scrollbar-thumb { background-color: rgba(var(--shadow-color-accent), 0.3); border-radius: var(--radius-sm); }
.station-checkbox-list::-webkit-scrollbar-track { background-color: var(--color-bg-note); border-radius: var(--radius-sm); }

/* ==========================================================================
 * Terminal Commands & Copy Functionality (Bootstrap Italia Roboto Mono)
 * ========================================================================== */

.cmd-box {
  background-color: var(--color-bg-code);
  border: var(--border-width-md) solid var(--color-action-default);
  border-radius: var(--radius-md);
  color: var(--color-text-code);
  font-family: var(--bs-font-monospace);
  font-size: var(--font-small);
  margin: var(--space-2x) 0;
  padding: clamp(var(--space-1x), 3vw, var(--space-2x));
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.cmd-box::before { content: "\00BB"; color: var(--color-brand-secondary); margin-right: var(--space-1x); font-weight: bold; }

.copy-button-container { display: block; width: 100%; margin-top: var(--space-2x); }
.copy-btn-wrapper { display: flex; align-items: center; gap: var(--space-2x); flex-wrap: wrap; margin-bottom: var(--space-1x); }

.copy-btn {
  background-color: var(--color-action-default);
  border: none; border-radius: var(--radius-sm);
  color: var(--color-neutral-light);
  cursor: pointer; padding: var(--space-1x) var(--space-3x);
  font-size: var(--font-small); font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--space-1x);
  transition: background-color 0.2s ease;
  width: fit-content;
}
.copy-btn:hover, .copy-btn:focus-visible { background-color: var(--color-action-hover); color: var(--color-neutral-light); }
.copy-btn:active { background-color: var(--color-action-active); }

.copy-feedback {
  color: var(--color-state-success); display: none; margin-left: var(--space-2x);
  font-weight: 600; font-size: var(--font-small); padding: var(--space-0_5x) var(--space-1x);
  background-color: var(--color-state-success-light); border-radius: var(--radius-sm);
  width: fit-content;
}

/* ==========================================================================
 * Alerts - Ottimizzazione Layout e UI Accessibile
 * ========================================================================== */

.alert-result-container { 
  width: 100%; 
  display: block; 
}

.alert {
  border-radius: var(--radius-md); 
  padding: var(--space-2x) var(--space-3x);
  font-weight: 600; 
  text-align: left; 
  display: flex; 
  flex-wrap: wrap; 
  width: 100%; 
  align-items: flex-start; 
  gap: var(--space-1x);
  font-size: var(--font-body); 
  line-height: 1.5; 
  margin-bottom: var(--space-3x);
}

.alert > * {
  flex: 1 1 0%;
  min-width: 0;
}

.alert::before {
  content: ""; 
  flex: 0 0 1.5rem; 
  width: 1.5rem; 
  height: 1.5rem;
  background-repeat: no-repeat; 
  background-position: center; 
  background-size: contain; 
  margin-top: 0.125rem;
  background-color: transparent; 
  border: none; 
  box-shadow: none;
}

.alert-info {
  border: var(--border-width-sm) solid var(--color-state-info); 
  background-color: var(--color-state-info-light); 
  color: var(--color-text-default);
}
.alert-info::before { 
  background-image: url("data:image/svg+xml;charset=utf-8;"); 
}

.alert-success {
  border: var(--border-width-sm) solid var(--color-state-success); 
  background-color: var(--color-state-success-light); 
  color: var(--color-state-success);
}
.alert-success::before { 
  background-image: url("data:image/svg+xml;charset=utf-8;"); 
}

.alert-warning {
  border: var(--border-width-sm) solid var(--color-state-warning); 
  background-color: var(--color-state-warning-light); 
  color: var(--color-state-warning);
}
.alert-warning::before {
  background-image: url("data:image/svg+xml;charset=utf-8;");
}

.alert-danger {
  border: var(--border-width-sm) solid var(--color-state-error); 
  background-color: var(--color-state-error-light); 
  color: var(--color-state-error);
}
.alert-danger::before {
  background-image: url("data:image/svg+xml;charset=utf-8;");
}

/* ==========================================================================
 * Footer Custom Link Styles
 * ========================================================================== */

.footer-custom-link {
  color: #ffffff !important;
  text-decoration: none !important;
  transition: color 0.2s ease-in-out, text-decoration-color 0.2s ease-in-out;
}

.footer-custom-link:hover,
.footer-custom-link:focus-visible {
  color: var(--color-brand-secondary) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px;
  outline: none;
}

footer.it-footer {
  background-color: var(--color-brand-primary);
  background-image: none;
  color: var(--color-neutral-light);
  margin-top: var(--space-8x);
  padding: var(--space-6x) 0 0 0;
}

/* Force transparency to avoid framework overrides on background */
footer.it-footer *, footer.it-footer .container { background: transparent; }

footer.it-footer h4, footer.it-footer .fs-6 {
  color: var(--color-neutral-light); font-weight: 600; margin-bottom: var(--space-2x);
}

footer.it-footer a, footer.it-footer p { 
  color: #cbd5e1; 
  text-decoration: none; 
  transition: color 0.2s; 
}
footer.it-footer a:hover, footer.it-footer a:focus-visible { 
  color: var(--color-neutral-light); 
  text-decoration: underline; 
}

/* Reset for the nested UL elements inside footer */
footer.it-footer ul.footer-list { list-style: none; padding: 0; margin: 0; }
footer.it-footer ul.footer-list li { margin-bottom: var(--space-1x); color: var(--color-neutral-light); }

/* Footer Small Prints */
footer.it-footer .it-footer-small-prints {
  background-color: var(--color-action-active); 
  padding: var(--space-3x) 0;
  margin-top: var(--space-4x);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer.it-footer .it-footer-small-prints .d-flex {
  flex-wrap: wrap;
}

footer.it-footer .it-footer-small-prints a {
  color: var(--color-neutral-light);
  font-size: var(--font-small);
  font-weight: 600;
  text-decoration: none;
}
footer.it-footer .it-footer-small-prints a:hover {
  color: var(--color-brand-secondary);
  text-decoration: underline;
}

/* ==========================================================================
 * Utilities
 * ========================================================================== */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon-white, .icon-white use { fill: var(--color-neutral-light); color: var(--color-neutral-light); }
.icon-primary, .icon-primary use { fill: var(--color-brand-primary); color: var(--color-brand-primary); }

/* ==========================================================================
 * Media Queries
 * ========================================================================== */

@media (max-width: 991.98px) {
  .it-header-wrapper::before { background-color: var(--color-brand-primary); }
  .it-header-center-wrapper .col-12 { text-align: center; }
  .lang-selector .btn-group .btn { padding: 0.125rem var(--space-0_5x); font-size: var(--font-xsmall); line-height: 1.3; }
}

@media (max-width: 767.98px) {
  #main { padding: var(--space-2x); margin-top: var(--space-2x); }
  .copy-btn-wrapper { flex-direction: column; align-items: stretch; }
  .copy-btn { width: 100%; justify-content: center; }
  .station-checkbox-list { grid-template-columns: 1fr; }
}

/* A11y Media Queries */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { 
    animation-duration: 0.01ms !important; 
    animation-iteration-count: 1 !important; 
    transition-duration: 0.01ms !important; 
    scroll-behavior: auto !important; 
  }
}

@media (prefers-contrast: high) {
  :root { 
    --color-neutral-border: #000000; 
    --color-action-default: #0000ff; 
    --color-state-error: #ff0000;
    --radius-md: 0; 
    --radius-sm: 0;
  }
  .card-bg, .custom-fieldset, .cmd-box { border: 2px solid #000000 !important; }
}

/* ==========================================================================
 * Print Optimization
 * ========================================================================== */
@media print {
  body { background-color: #fff; color: #000; }
  .it-header-wrapper, footer.it-footer, .copy-btn, .lang-selector { display: none !important; }
  #main { 
    box-shadow: none !important; 
    margin: 0 !important; 
    padding: 0 !important; 
    max-width: 100% !important; 
  }
  .card-bg, .custom-fieldset { 
    border: 1px solid #000 !important; 
    box-shadow: none !important; 
    page-break-inside: avoid;
  }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.9em; color: #555; }
}