/* ------------------------------------------------------------------
   1. FONT FACE
   ------------------------------------------------------------------ */

/* Figtree Regular (Variable Font: 300-900) */
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree/Figtree-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* Figtree Italic (Variable Font: 300-900) */
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree/Figtree-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

/* ------------------------------------------------------------------
   2. RESET
   ------------------------------------------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ------------------------------------------------------------------
   3. UTILITY CLASSES
   ------------------------------------------------------------------ */
.offscreen {
  position: absolute;
  left: -10000px;
}

.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ------------------------------------------------------------------
   4. VARIABLES
   ------------------------------------------------------------------ */
:root {
  /* Fonts */
  --font-base: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.5;

  /* Typography Scale */
  --font-size-xs: 0.75rem;    /* 12px - Level 6 */
  --font-size-sm: 0.875rem;   /* 14px - Level 5 */
  --font-size-base: 1rem;     /* 16px - Level 4 */
  --font-size-lg: 1.125rem;   /* 18px - Level 3 */
  --font-size-xl: 1.5rem;     /* 24px - Level 2 */
  --font-size-2xl: 2rem;      /* 32px - Level 1 */

  /* Font Weights */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;

  /* Colors */
  --color-green: #006600;
  --color-red: #BB0000;
  --color-dark: #000000;
  --color-white: #FFFFFF;
  --color-light: #F8F9FA;

  /* Neutral Palette */
  --color-slate-900: #0F172A;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748B;
  --color-slate-400: #94A3B8;
  --color-slate-300: #CBD5E1;
  --color-slate-200: #E2E8F0;
  --color-slate-100: #F1F5F9;
  --color-slate-50: #F8FAFC;

  /* Spacing (Mobile-First: smaller base values) */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* ------------------------------------------------------------------
   5. GENERAL CLASSES
   ------------------------------------------------------------------ */
body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-dark);
  background-color: var(--color-light);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--font-size-2xl);}

h2 { font-size: var(--font-size-xl); }

h3 { font-size: var(--font-size-lg); }

h4 { font-size: var(--font-size-lg); }

h5 { font-size: var(--font-size-base); }

h6 { font-size: var(--font-size-sm); }

p { margin-bottom: var(--space-md);}

a {
  color: var(--color-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-red);
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   6. LAYOUT WRAPPERS
   ------------------------------------------------------------------ */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
}

.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--space-sm);
}

.content-wrapper {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
}

.vote-wrapper,
.summary-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.filter-wrapper,
.candidates-wrapper,
.modules-wrapper,
.results-wrapper,
.maps-wrapper,
.predictions-wrapper,
.history-wrapper {
  width: 100%;
}

/* ------------------------------------------------------------------
   7. HEADER
   ------------------------------------------------------------------ */
.header {
  background: linear-gradient(to right,
      var(--color-dark) 0%,
      var(--color-red) 50%,
      var(--color-green) 100%);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-md);
}

.header__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  max-width: var(--container-xl);
  margin: 0 auto;
}

.header__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin: 0;
}

  .header__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
  }

  .language-selector__button {
    color: var(--color-dark);
    background: transparent;
    border: 2px solid var(--color-dark);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
  }

  .language-selector__button:hover {
    background: var(--color-green);
    color: var(--color-dark);
  }

  .language-selector__button:active {
    background: var(--color-red);
    color: var(--color-light);
  }
  

  #login_reg_btn:hover {
    background: var(--color-green);
  }


  /* ------------------------------------------------------------------
   8. TABS
   ------------------------------------------------------------------ */
  .nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    padding: var(--space-xs);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .nav-pills>li {
    list-style: none;
  }

  .nav-pills>li>a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--color-slate-700);
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    white-space: nowrap;
  }

  .nav-pills>li>a:hover {
    background-color: var(--color-slate-100);
    color: var(--color-dark);
    text-decoration: none;
  }

  .nav-pills>li.active>a {
    background-color: var(--color-green);
    border-color: var(--color-green);
    color: var(--color-white);
  }

  .nav-pills>li.active>a:hover {
    background-color: #004d00;
    border-color: #004d00;
  }

  /* ------------------------------------------------------------------
   9. TOOLBAR & FILTERS
   ------------------------------------------------------------------ */
  .global-toolbar {
    background: var(--color-white);
    border: 1px solid var(--color-slate-200);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
  }

  .global-toolbar .row {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center; /* Vertical Center */
  }

  .global-toolbar .row>div[class*="col-"] {
    padding-left: var(--space-xs);
    padding-right: var(--space-xs);
  }

  .toolbar-metric-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 0.125rem;
  }

  .toolbar-metric {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-sm);
    line-height: 1.2;
  }

  .metric-label {
    color: var(--color-slate-600);
    font-weight: var(--font-weight-semibold);
  }

  .toolbar-metric strong {
    color: var(--color-dark);
  }

  .ss-caption {
    font-size: var(--font-size-sm);
    color: var(--color-slate-600);
    text-align: center;
    padding: var(--space-xs) 0;
    margin: 0;
  }

  .ss-caption strong {
    color: var(--color-dark);
    font-weight: var(--font-weight-semibold);
  }

  /* ------------------------------------------------------------------
   10. VOTING PANEL - GRID
   ------------------------------------------------------------------ */
  .voting-panel__grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr;
    padding: var(--space-sm) 0;
  }

  .voting-helpicon {
    margin-bottom: var(--space-sm);
    color: var(--color-slate-600);
    font-size: 1rem;
    cursor: pointer;
  }

  /* ------------------------------------------------------------------
   11. CANDIDATE CARDS
   ------------------------------------------------------------------ */
  .candidate-card {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .candidate-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }

  /* --- UPDATED: Fix Images with CONTAIN (No Cropping) --- */
  .candidate-card__media {
    position: relative;
    padding-top: 10%;
    /* 100% - Square , 125% (4:5 Ratio - Taller than square) */
    width: 100%;
    /* Not used when padding-top = 100% */
    overflow: hidden;
    background: var(--color-slate-50);
    /* Subtle background for empty bars */
  }

  .candidate-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensures whole image is visible */
    object-position: center;
    
  }

  .candidate-card__body {
    padding: var(--space-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .candidate-card__name {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    line-height: 1.3;
  }

  
  .vote-btn {
    margin-top: auto;
    /* Use light green (#44BF17) if variable is missing or null */
    background-color: var(--candidate-color, #44BF17);
    border: 2px solid var(--color-dark);
    padding: var(--space-sm);
    color: var(--color-dark);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
  }

  .vote-btn:hover:not([disabled]):not(.is-voted):not(.is-locked) {
    background-color: var(--candidate-color, var(--color-green));
    color: var(--color-white);
    transform: translateY(-1px);
  }

  .vote-btn:active:not([disabled]):not(.is-voted):not(.is-locked) {
    transform: translateY(0);
  }

  .vote-btn.is-voted {
    background-color: var(--candidate-color, var(--color-green));
    border-color: var(--candidate-color, var(--color-green));
    color: var(--color-white);
    cursor: default;
  }

  .vote-btn[disabled],
  .vote-btn.is-locked {
    background-color: var(--color-slate-100);
    border-color: var(--color-slate-300);
    color: var(--color-slate-500);
    cursor: not-allowed;
  }

  .vote-btn--active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .vote-btn:focus-visible {
    outline: 3px solid var(--candidate-color, var(--color-green));
    outline-offset: 2px;
  }

  .candidate-card__badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--candidate-color, var(--color-green));
    color: var(--color-white);
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 2;
    font-size: var(--font-size-base);
  }

  .candidate-card.is-voted {
    box-shadow:
      0 0 0 3px var(--candidate-color, var(--color-green)) inset,
      var(--shadow-lg);
  }

  .candidate-card.is-locked {
    filter: grayscale(0.4);
    opacity: 0.65;
  }

  .candidate-card.is-locked:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  /* ------------------------------------------------------------------
   12. CARDS & CONTAINERS
   ------------------------------------------------------------------ */
  .card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-slate-200);
  }
  
  .module-header {
    display: flex;             /* Forces children to sit in a row */
    align-items: center;       /* Vertically centers the text and the icon */
    gap: var(--space-xs);      /* Adds a consistent gap between them */
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-slate-200); /*Header look */
    margin-bottom: var(--space-md);
  }

  .module-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark);
  }

  .module-header .fa-info-circle {
    /* margin-left: var(--space-xs); */
    color: var(--color-slate-500);
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: color var(--transition-fast);
  }

  .module-header .fa-info-circle:hover {
    color: var(--color-green);
  }

  /* ------------------------------------------------------------------
   13. RESULTS MODULE - FLEX LAYOUT
   ------------------------------------------------------------------ */
  .results-charts {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
  }

  .chart-card {
    flex: 1;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    min-width: 0;
  }

  .chart-card h5 {
    margin-bottom: var(--space-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
  }

  /* ------------------------------------------------------------------
   14. PLOTS & CHARTS
   ------------------------------------------------------------------ */
  .plot-container,
  .map-container {
    width: 100%;
    height: auto;
    min-height: 300px;
  }

  .plotly,
  .leaflet-container {
    width: 100% !important;
    height: 420px !important;
    max-height: 60vh;
  }

  /* ------------------------------------------------------------------
   15. EMPTY STATES
   ------------------------------------------------------------------ */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: var(--space-xl);
    text-align: center;
    color: var(--color-slate-600);
  }

  .empty-state .fa {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.3;
    color: var(--color-slate-400);
  }

  .empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-slate-700);
    margin-bottom: var(--space-sm);
  }

  .empty-state p {
    font-size: var(--font-size-sm);
    color: var(--color-slate-500);
  }

  /* ------------------------------------------------------------------
   16. MODALS
   ------------------------------------------------------------------ */
  .modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
  }

  .modal-header {
    background: linear-gradient(to right,
        var(--color-green),
        var(--color-red));
    color: var(--color-white);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-md);
  }

  .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
  }

  .modal-body {
    padding: var(--space-md);
  }

  .modal-footer {
    border-top: 1px solid var(--color-slate-200);
    padding: var(--space-md);
  }

  /* ------------------------------------------------------------------
   17. BUTTONS
   ------------------------------------------------------------------ */
  /*
.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary,
.button--primary {
  background-color: var(--color-green);
  border-color: var(--color-green);
  color: var(--color-white);
}

.btn-primary:hover,
.button--primary:hover {
  background-color: #004d00;
  border-color: #004d00;
  text-decoration: none;
}

.btn-secondary,
.button--secondary {
  background-color: var(--color-slate-600);
  border-color: var(--color-slate-600);
  color: var(--color-white);
}

.btn-secondary:hover,
.button--secondary:hover {
  background-color: var(--color-slate-700);
  border-color: var(--color-slate-700);
}

.btn:disabled,
.button:disabled {
  background-color: var(--color-slate-200);
  border-color: var(--color-slate-300);
  color: var(--color-slate-500);
  cursor: not-allowed;
  opacity: 0.6;
}
*/

  /* ------------------------------------------------------------------
   18. FORMS
   ------------------------------------------------------------------ */
  /*
  .form-group {
    margin-bottom: var(--space-md);
  }

  .form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-dark);
  }

  .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-dark);
    background-color: var(--color-white);
    border: 1px solid var(--color-slate-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
  }

  .form-control:focus {
    outline: none;
    border-color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(0, 102, 0, 0.1);
  }
*/
  /* ------------------------------------------------------------------
   19. LOADING STATES
   ------------------------------------------------------------------ */
  /*
  .loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--color-slate-200);
    border-top-color: var(--color-green);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
*/
  /* ------------------------------------------------------------------
   20. MODIFIERS
   ------------------------------------------------------------------ */
 /*
  .text-primary {
    color: var(--color-green);
  }

  .text-accent {
    color: var(--color-red);
  }

  .text-muted {
    color: var(--color-slate-500);
  }

  .text-dark {
    color: var(--color-dark);
  }

  .bg-primary {
    background-color: var(--color-green);
  }

  .bg-accent {
    background-color: var(--color-red);
  }

  .bg-light {
    background-color: var(--color-light);
  }

  .mb-0 {
    margin-bottom: 0;
  }

  .mb-sm {
    margin-bottom: var(--space-sm);
  }

  .mb-md {
    margin-bottom: var(--space-md);
  }

  .mb-lg {
    margin-bottom: var(--space-lg);
  }

  .mt-0 {
    margin-top: 0;
  }

  .mt-sm {
    margin-top: var(--space-sm);
  }

  .mt-md {
    margin-top: var(--space-md);
  }

  .mt-lg {
    margin-top: var(--space-lg);
  }
*/
  /* ------------------------------------------------------------------
   21. MEDIA QUERIES
   ------------------------------------------------------------------ */

  /* Small Devices (576px+) */
  @media screen and (min-width: 576px) {
    :root {
      --space-sm: 1rem;
      --space-md: 1.25rem;
      --space-lg: 1.75rem;
    }

    .voting-panel__grid {
      grid-template-columns: repeat(2, 1fr);
    }

    .candidate-card__media {
      padding-top: 65%;
    }

    .plotly,
    .leaflet-container {
      height: 400px !important;
      max-height: 55vh;
    }
  }

  /* Medium Devices (768px+) */
  @media screen and (min-width: 768px) {
    :root {
      --space-sm: 1rem;
      --space-md: 1.5rem;
      --space-lg: 2rem;
      --space-xl: 2.5rem;
    }

    h1 {
      font-size: 2.5rem;
    }

    h2 {
      font-size: var(--font-size-2xl);
    }

    h3 {
      font-size: var(--font-size-xl);
    }

    h4 {
      font-size: var(--font-size-lg);
    }

    .header {
      padding: var(--space-md) var(--space-lg);
    }

    .header__content {
      flex-direction: row;
      justify-content: space-between;
    }

    .header__title {
      font-size: var(--font-size-xl);
      text-align: left;
    }

    .main-wrapper {
      padding: var(--space-md);
    }

    .voting-panel__grid {
      grid-template-columns: repeat(3, 1fr);
    }

    .candidate-card__media {
      padding-top: 60%;
    }

    .candidate-card__name {
      font-size: var(--font-size-lg);
    }

    .nav-pills>li>a {
      font-size: var(--font-size-base);
      padding: 0.625rem 1.25rem;
    }

    .well.ss-toolbar {
      padding: var(--space-md);
    }

    .ss-metric {
      font-size: var(--font-size-base);
    }

    .ss-caption {
      font-size: var(--font-size-base);
    }

    .card {
      padding: var(--space-lg);
    }

    .card__heading {
      font-size: var(--font-size-xl);
    }

    .module-header h4 {
      font-size: var(--font-size-lg);
    }

    .module-header .fa-info-circle {
      margin-left: var(--space-sm);
      font-size: var(--font-size-lg);
    }

    .plotly,
    .leaflet-container {
      height: 420px !important;
      max-height: 50vh;
    }

    .modal-dialog {
      max-width: 500px;
    }
  }

  /* Large Devices (992px+) */
  @media screen and (min-width: 992px) {
    :root {
      --space-md: 1.5rem;
      --space-lg: 2rem;
      --space-xl: 3rem;
    }

    .main-wrapper {
      padding: var(--space-lg);
    }

    .voting-panel__grid[data-grid-cols="3"] {
      grid-template-columns: repeat(3, 1fr);
    }

    .voting-panel__grid[data-grid-cols="4"] {
      grid-template-columns: repeat(4, 1fr);
    }

    .voting-panel__grid[data-grid-cols="5"] {
      grid-template-columns: repeat(5, 1fr);
    }

    .candidate-card__media {
      padding-top: 50%;
    }

    .results-charts {
      flex-direction: row;
    }

    .chart-card {
      flex: 1 1 calc(50% - var(--space-md) / 2);
    }

    .plotly,
    .leaflet-container {
      height: 420px !important;
      max-height: 60vh;
    }
  }

  /* Extra Large Devices (1200px+) */
  @media screen and (min-width: 1200px) {
    .app-wrapper {
      max-width: var(--container-xl);
    }

    .voting-panel__grid {
      max-width: var(--container-xl);
      margin: 0 auto;
    }
  }

  /* ------------------------------------------------------------------
   22. PRINT STYLES
   ------------------------------------------------------------------ */
  @media print {

    .header-wrapper,
    .nav-pills,
    .filter-wrapper,
    .vote-btn,
    .btn,
    .button {
      display: none;
    }

    body {
      background: white;
      color: black;
    }

    .candidate-card {
      break-inside: avoid;
    }
  }

  /* ------------------------------------------------------------------
   23. ANIMATIONS
   ------------------------------------------------------------------ */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .fade-in {
    animation: fadeIn 0.3s ease-in-out;
  }

/* ------------------------------------------------------------------
   24. LOGIN / REGISTRATION PAGE
   ------------------------------------------------------------------ */
  .login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  .login-container {
    display: flex;
    min-height:400px;
    max-width: 900px;
    margin: auto;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .login-left-panel {
    flex: 1;
    background: linear-gradient(to right,
        var(--color-dark) 0%,
        var(--color-red) 50%,
        var(--color-green) 100%);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-md);
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
  }

  .login-right-panel {
    flex: 1;
    background: var(--color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-top-right-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
  }

  .login-card {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--color-light);
    padding: var(--space-md);
  }

  .mode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-sm);
  }

  .login-submit-btn,
  .login-survey-btn {
    width: 100%;
    margin-top: var(--space-sm);
    background-color: var(--color-red);
    color: var(--color-white);
    border: none;
    padding: var(--space-sm);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
  }

  .login-submit-btn:hover ,
  .login-survey-btn:hover{
    background-color: #B71C1C;
  }

  /* Fix spacing for the survey section in registration */
  .login-survey p,
  .login-survey .login-survey-btn {
    margin-top: 0; 
    margin-bottom: var(--space-sm); 
  }

  @media screen and (max-width: 768px) {
    .login-container {
      height: auto;
      flex-direction: column;
      margin: var(--space-md) auto;
    }

    .login-left-panel,
    .login-right-panel {
      flex: none;
      width: 100%;
    }

    .login-left-panel {
      border-top-left-radius: var(--radius-lg);
      border-top-right-radius: var(--radius-lg);
      border-bottom: none;
    }

    .login-right-panel {
      border-bottom-left-radius: var(--radius-lg);
      border-bottom-right-radius: var(--radius-lg);
      border-top: none;
    }

    .modal-dialog {
      margin: var(--space-sm);
    }

    .modal-content {
      border-radius: var(--radius-md);
    }
  }

  /* ------------------------------------------------------------------
   25. FORM ELEMENTS (RADIO, CHECKBOXES & DROPDOWNS)
   ------------------------------------------------------------------ */
  
  /* --- 1. RADIO & CHECKBOX LAYOUT --- */

  /* Force Radio Groups to be Horizontal */
  .custom-radio-group .shiny-options-group,
  .mode-selector .shiny-options-group {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
  }

  /* Global :  Vertical Center of Input vs Label Text */
  .radio-inline, 
  .checkbox label {
    display: inline-flex !important; 
    align-items: center;             
    gap: 8px;                        
    margin-bottom: 0 !important;     
    font-weight: 400 !important;     
    padding-left: 0 !important;      
  }

  /* Reset default margins on the inputs */
  .radio-inline input[type="radio"],
  .checkbox input[type="checkbox"] {
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    margin-left: 0 !important;
    accent-color: var(--color-green); 
  }

  /* Remove container margin  for the mode selector */
  .mode-selector .shiny-input-container {
    margin-bottom: 0 !important;
  }

  /* --- 2. GENERAL INPUTS --- */

  /* Default width for all inputs - unless inline */
  .shiny-input-container:not(.shiny-input-container-inline) {
    width: 100%;
  }

  /* --- 3. DROPDOWNS (SELECTIZE) --- */

  .selectize-input {
    min-height: 45px;
    padding: 10px 12px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-slate-300);
    box-shadow: var(--shadow-sm);
  }

  .selectize-input.focus {
    border-color: var(--color-green);
    box-shadow: 0 0 0 2px rgba(0, 102, 0, 0.2);
  }

  .selectize-dropdown {
    font-size: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-slate-200);
  }

  .selectize-dropdown-content .option {
    padding: 10px 12px;
  }

  .selectize-dropdown-content .active {
    background-color: var(--color-green);
    color: white;
  }

  /* ------------------------------------------------------------------
   26. UTILITY CLASSES
   ------------------------------------------------------------------ */
  .d-flex {
    display: flex !important;
  }

  .justify-content-center {
    justify-content: center !important;
  }

  .align-items-center {
    align-items: center !important;
  }

  .text-center {
    text-align: center !important;
  }

  .w-100 {
    width: 100% !important;
  }

  .official-location-display {
    padding: var(--space-md);
    background-color: var(--color-light);
    border-left: 3px solid var(--color-green);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
  }

  .official-location-display h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: var(--space-xs);
  }

  .official-location-display p {
    margin-bottom: 0;
    color: var(--color-slate-600);
  }

  /* ------------------------------------------------------------------
   27. SURVEY MODAL SPECIFICS
   ------------------------------------------------------------------ */

/* Spacing Utility check */
.gap-md {
  gap: var(--space-md) !important;
}

/* Footer Container */
.survey-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
}

/* CANCEL BUTTON: Default (Grayish) -> Hover (Red) */
.survey-footer .btn-default {
  background-color: var(--color-slate-100);
  color: var(--color-dark);
  border: 1px solid var(--color-slate-300);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-sm);
}

.survey-footer .btn-default:hover,
.survey-footer .btn-default:active,
.survey-footer .btn-default:focus {
  background-color: var(--color-red) !important;
  border-color: var(--color-red) !important;
  color: white !important; /* White text vs Red vs Black */
}

/* SUBMIT BUTTON: Default - Clear/White -> Hover (Green) */
.survey-footer .btn-primary {
  background-color: white;           
  color: var(--color-dark);          
  border: 2px solid var(--color-green); 
  font-weight: var(--font-weight-bold);
  padding: var(--space-sm);
}

.survey-footer .btn-primary:hover,
.survey-footer .btn-primary:active,
.survey-footer .btn-primary:focus {
  background-color: var(--color-green) !important; /* Green bg */
  border-color: var(--color-green) !important;
  color: white !important;           /* White txt on green*/
}

  /* ------------------------------------------------------------------
   END OF STYLES
   ------------------------------------------------------------------ */