:root {
  /* Dating App Color Palette (Accessible contrast) */
  --color-primary: #c2185b; /* Darker pink for better contrast */
  --color-primary-dark: #880e4f;
  --color-secondary: #b23a10; /* Darker orange, passes 4.5:1 */
  --color-accent: #fbc02d;
  
  --color-text-light: #555555; /* Darker gray for better contrast */
}

body:not(.bad-layout) {
  --color-bg: #f9f9fc;
  --color-surface: #ffffff;
  --color-text: #222222; /* Darker text */
}

:root {
  
  --color-error: #c62828;
  --color-success: #2e7d32;

  /* Inaccessible specific colors */
  --color-bad-contrast-text: #a8a8a8; /* Poor contrast on white */
  --color-bad-contrast-bg: #f0f0f0;
  --color-bad-error: #ffb3b3; /* Hard to read */

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --border-radius-lg: 24px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --box-shadow-hover: 0 12px 32px rgba(254, 60, 114, 0.2);
  --border-radius-lg: 1.5rem;
  --border-radius-md: 0.75rem;
  --border-radius-sm: 0.5rem;
  --box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
  --box-shadow-hover: 0 0.75rem 2rem rgba(254, 60, 114, 0.2);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
}

/* Accessibility Focus */
*:focus-visible {
  outline: 3px solid #000;
  box-shadow: 0 0 0 3px #fff;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Text limits for readability */
p {
  max-width: 80ch;
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; margin-top: 2.5rem; background: linear-gradient(45deg, var(--color-primary), var(--color-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
  color: var(--color-primary);
  text-decoration: underline;
}

a:hover, a:focus {
  color: var(--color-secondary);
  text-decoration: none;
}

/* Layout */
.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  background-color: var(--color-surface);
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 1001;
  padding: 0.9375rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.logo span {
  font-size: 2.2rem;
}

#main-nav > ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.25rem;
  flex-wrap: wrap;
}

#main-nav a, #bad-nav a {
  display: block;
  padding: 0.625rem 0.9375rem;
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
}

#main-nav a:hover, #main-nav a:focus, #bad-nav a:hover, #bad-nav a:focus {
  background-color: rgba(254, 60, 114, 0.1);
  color: var(--color-primary);
  text-decoration: none;
}

#main-nav a[aria-current="page"], #main-nav a[aria-current="true"], #bad-nav a.active {
  background-color: rgba(254, 60, 114, 0.1);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 900;
}

/* Burger Menu Styles */
.burger-btn {
  display: none;
  background: transparent;
  border: 2px solid transparent;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
}
.burger-btn:focus-visible {
  outline: 3px solid var(--color-primary);
}
.burger-line {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  ul.dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 0 1rem !important;
    background: transparent !important;
    margin-top: 0.5rem !important;
    width: 100%;
  }
  .bad-dropdown {
    display: flex !important;
    flex-direction: column;
    width: 100%;
  }
  #bad-menu {
    position: static !important;
    width: 100%;
    margin-top: 10px;
  }

  .burger-btn {
    display: block;
  }
  nav#main-nav {
    width: 100%;
  }
  #main-nav > ul {
    display: none; /* Hide by default on mobile */
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    gap: 0.5rem;
  }
  #main-nav ul.menu-open {
    display: flex;
  }
  
  /* Bad Burger */
  .bad-burger-btn {
    display: block;
    font-size: 24px;
    cursor: pointer;
  }
  nav#bad-nav {
    display: none;
    width: 100%;
    margin-top: 10px;
  }
  nav#bad-nav > div {
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  .bad-burger-btn {
    display: none;
  }
  nav#bad-nav {
    display: block !important;
  }
}

main {
  padding: 2.5rem 0;
  min-height: 80vh;
}

/* Components */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  border-radius: 3.125rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0.25rem 0.9375rem rgba(254, 60, 114, 0.3);
  text-align: center;
}

.btn:hover {
  transform: translateY(-0.125rem);
  box-shadow: var(--box-shadow-hover);
  color: white; /* For links */
}

.btn:disabled {
  filter: opacity(0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid #ccc;
  box-shadow: none;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
  background: rgba(254, 60, 114, 0.05);
}

/* --- ACCESSIBILITY SPECIFICS --- */
/* Good Focus Rings (Handled above, keeping rule empty or removed) */
*:focus-visible {
  outline: 3px solid #000;
  box-shadow: 0 0 0 3px #fff;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip Link */
.skip-links {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--color-primary);
  color: white !important;
  padding: 0.625rem 1.25rem;
  text-decoration: underline;
}
.skip-link:focus, .skip-link:focus-visible {
  left: 0;
  position: static;
  display: inline-block;
}

/* Breadcrumb */
.breadcrumb {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}
.breadcrumb a {
  color: var(--color-text-light);
  text-decoration: underline;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.breadcrumb li:not(:last-child)::after {
  content: "›" / ""; /* Invisible aux lecteurs d'écran */
  margin-left: 0.625rem;
  color: var(--color-text-light);
}
.breadcrumb span[aria-current="page"] {
  font-weight: 700;
  color: var(--color-text);
}

/* Glossary Definitions */
dl {
  margin-bottom: 2rem;
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow);
}
dt {
  font-weight: 800;
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}
dt:first-child {
  margin-top: 0;
}
dd {
  margin-left: 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}


/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.75rem), 1fr));
  gap: 1.875rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: var(--box-shadow-hover);
}

.card-img {
  width: 100%;
  height: 25rem;
  object-fit: cover;
  object-position: center;
}

.card-body {
  padding: 1.5625rem;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.625rem;
}

.card-title h3 {
  margin: 0;
}


.card-age {
  background: var(--color-accent);
  color: #000;
  padding: 0.25rem 0.625rem;
  border-radius: 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.card-desc {
  color: var(--color-text-light);
  margin-bottom: 1.25rem;
}

/* Complex Table */
.a11y-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  margin-bottom: 1.875rem;
}

.a11y-table th, .a11y-table td {
  padding: 0.9375rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.a11y-table th {
  background-color: #f5f5f5;
  font-weight: 700;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tabs */
.tabs {
  margin-top: 1.875rem;
}
.tab-list {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
    padding: 0;
    list-style: none;
    gap: 10px;
}
.tab-btn {
  padding: 0.625rem 1.25rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -0.125rem;
}
.tab-btn[aria-selected="true"] {
  border-bottom-width: inherit;
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}


/* Forms */
.form-group {
  margin-bottom: 1.5625rem;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: clamp(4px, 0.5rem, 12px);
}
input[type="text"],
input[type="number"],
input[inputmode="numeric"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9375rem;
  border: 2px solid #767676; /* WCAG 3:1 contrast */
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary) !important;
}
.error-msg {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 0.3125rem;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.3125rem;
}
input[aria-invalid="true"] {
  border-color: var(--color-error);
}

/* Choice Group (for checkboxes/radios) */
.choice-group { 
  display: flex;
  flex-direction: column;
}

/* Authentication layout */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.auth-col {
  background: var(--color-surface);
  padding: 30px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
}
@media (max-width: 768px) {
  .dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  ul.dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 0 1rem !important;
    background: transparent !important;
    margin-top: 0.5rem !important;
    width: 100%;
  }
  .bad-dropdown {
    display: flex !important;
    flex-direction: column;
    width: 100%;
  }
  #bad-menu {
    position: static !important;
    width: 100%;
    margin-top: 10px;
  }

  .auth-container {
    grid-template-columns: 1fr;
  }
}

.choice-group label { 
  display: flex; 
  align-items: center; 
  gap: clamp(8px, 2vw, 32px); 
  cursor: pointer; 
  font-weight: 600; 
  margin-bottom: 0;
} 

/* Custom Checkbox */
input[type="checkbox"] {
  appearance: none;
  background-color: var(--color-surface);
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.25em;
  height: 1.25em;
  border: 2px solid #767676; /* WCAG 3:1 */
  border-radius: 4px;
  display: grid;
  place-content: center;
  cursor: pointer;
}
input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em white;
  background-color: white;
}
input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background-color: inherit;
    margin: 0;
    cursor: pointer;
    display: grid;
    place-content: center;
}
input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: var(--color-primary);
}
input[type="radio"]:checked::before {
    transform: scale(1);
}

/* Fieldset and Legend */
fieldset {
  border: 2px solid #767676;
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--color-surface);
}
legend {
  font-weight: 800;
  color: var(--color-primary);
  padding: 0 0.5rem;
  font-size: 1.2rem;
}

/* Password Rules List */
.password-rules {
  background: rgba(0,0,0,0.02);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin-top: 1rem;
}
.rule-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.rule-item.pending {
  color: var(--color-text-light);
}
.rule-item.valid {
  color: var(--color-success);
}
.rule-item.invalid {
  color: var(--color-error);
}
.rule-item .icon {
  font-size: 1.1rem;
}

/* --- INACCESSIBLE SPECIFICS (BAD PRACTICES) --- */
.bad-layout header {
  /* No semantic nav, just divs */
}
.bad-focus *:focus {
  outline: none !important; /* The worst offense */
}
.bad-contrast {
  color: var(--color-bad-contrast-text) !important;
}
.bad-contrast-bg {
  background-color: var(--color-bad-contrast-bg) !important;
  color: #fff; /* White on light gray = very bad */
}
.bad-btn {
  /* Looks like a button but is a div */
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-primary);
  color: white;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  /* Missing focus states, keyboard handlers, roles, etc. */
}
.bad-table {
  /* Used for layout, no th, no scopes */
  display: table;
}
.bad-input {
  border: 1px solid #ccc;
  padding: 10px;
  /* No label associated */
}
.bad-error {
  color: #ffcccc; /* Terible contrast for an error */
  font-size: 12px;
}
.sr-only-bad {
  display: none; /* Completely hides from screen readers instead of visually hiding */
}

/* Screen Reader Only (visually hidden but accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Media Player */
.media-container {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  background: #000;
}
video {
  width: 100%;
  display: block;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-surface);
  padding: 30px;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 500px;
  width: 90%;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  background: #222;
  color: #fff;
  margin-top: 60px;
}
footer a,
.footer-btn {
  color: white;
  text-decoration: underline;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.625rem 0.9375rem;
  font-family: inherit;
  font-size: inherit;
}

footer a:hover,
footer a:focus,
.footer-btn:hover,
.footer-btn:focus {
  color: var(--color-accent);
  text-decoration: none;
}

button#open-cookies-btn:hover, button#open-cookies-btn:focus {
    background: rgba(254, 60, 114, 0.1);
    border-radius: var(--border-radius-sm);
}


/* Review Carousel Responsive Layout */
.carousel-controls-reviews {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.reviews-track {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.4s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .reviews-track {
        transition: none;
    }
}

.review-slide {
    flex: 0 0 100%;
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow);
    border: 1px solid #eee;
    box-sizing: border-box;
}

.review-slide:not(:last-child) {
    margin-right: 20px;
}

@media (min-width: 600px) {
    .review-slide { flex: 0 0 calc((100% - 20px) / 2); }
}

@media (min-width: 900px) {
    .review-slide { flex: 0 0 calc((100% - 60px) / 4); }
}

@media (min-width: 1200px) {
    .review-slide { flex: 0 0 calc((100% - 80px) / 5); }
}


/* Stretched link utility for cards */
.stretched-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
}


.profile-about-img {
    width: 100%;
    max-width: 300px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
}

/* Combobox */
.combobox-wrapper {
    position: relative;
    width: 100%;
}
.combobox-group {
    display: flex;
    align-items: stretch;
}
.combobox-group input {
    flex-grow: 1;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    margin: 0;
}
.combobox-group button {
    border: 1px solid #ccc;
    border-left: none;
    background: #f8f9fa;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    padding: 0 10px;
    cursor: pointer;
    color: var(--color-text);
}
.combobox-listbox {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid #ccc;
    border-top: none;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.combobox-listbox [role="option"] {
    padding: 10px;
    cursor: pointer;
}
.combobox-listbox [role="option"]:hover,
.combobox-listbox [role="option"].focused {
    background: var(--color-primary);
    color: white;
}
.combobox-listbox [role="option"][aria-selected="true"] {
    background: var(--color-primary);
    color: white;
    font-weight: bold;
}

.required-asterisk {
    color: var(--color-primary);
}

/* Placeholder color for all browsers */
::-webkit-input-placeholder {
    color: #555555 !important;
    opacity: 1 !important;
}
::-moz-placeholder {
    color: #555555 !important;
    opacity: 1 !important;
}
:-ms-input-placeholder {
    color: #555555 !important;
    opacity: 1 !important;
}
:-moz-placeholder {
    color: #555555 !important;
    opacity: 1 !important;
}
::placeholder {
    color: #555555 !important;
    opacity: 1 !important;
}

#cb1-button {
    border-color: #767676 !important;
    border-top: 2px solid;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-left: 0;
}

button.tab-trigger.p-0.current {
    background: var(--color-primary);
    transform: scale(1.3);
}
button.tab-trigger.p-0 {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    padding: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Style de base partagé pour les barres de progression */
progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px; /* Barre fine et élégante */
  border: 2px solid var(--color-primary);
  background-color: rgba(254, 60, 114, 0.1);
}

/* --- Style du conteneur (fond de la barre) --- */
progress::-webkit-progress-bar {
  background-color: rgba(254, 60, 114, 0.1);
}

/* --- Style de la jauge (progression) --- */
progress::-webkit-progress-value {
  background-color: var(--color-primary);
  transition: width 0.3s ease; /* Animation fluide lors de la mise à jour de la valeur */
}

progress::-moz-progress-bar {
  background-color: var(--color-primary);
}

/* Anomalie d'accessibilité volontaire : Ne pas déclarer le fond blanc et le texte noir (utilisation des défauts du navigateur) */
.bad-layout {
  --color-surface: initial;
  --color-bg: initial;
  --color-text: initial;
  background-color: initial !important;
  color: initial !important;
}

.bad-layout .card-age,
.bad-layout input[type="checkbox"] {
  color: initial !important;
  background-color: initial !important;
  box-shadow: none !important;
}

/* Dual-thumb Range Slider */


.dual-slider-container {
    position: relative;
    width: 100%;
    height: 30px; /* enough height for touch */
    margin: 10px 0;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #ddd;
    transform: translateY(-50%);
    border-radius: 4px;
}

.slider-range {
    position: absolute;
    top: 50%;
    height: 8px;
    background-color: var(--color-primary);
    transform: translateY(-50%);
    border-radius: 4px;
    /* width and left are controlled via JS */
    left: 0%;
    width: 100%;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background-color: white;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2; /* To sit above the track */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    /* left is controlled via JS */
}

/* Ensure focus is highly visible */
.slider-thumb:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 3;
}


/* --- CHIPS COMPONENT --- */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 10px 0 0 0;
    list-style: none;
}

.chip, .bad-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e0e0e0;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.chip-delete-btn {
    background: none;
    border: none;
    margin-left: 8px;
    margin-right: -4px;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    padding: 0;
}

.chip-delete-btn:hover {
    color: #000;
    background-color: #ccc;
}

.chip-delete-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.bad-delete {
    margin-left: 8px;
    margin-right: -4px;
    color: #999;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 4px;
}
/* No focus or hover styles for bad-delete */


/* --- CHIP TOGGLES COMPONENT --- */
.chip-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.chip-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.chip-checkbox .chip-label, .bad-chip-toggle {
    display: inline-block;
    padding: 5px 15px;
    background-color: #e0e0e0;
    color: #333;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-size: 0.9em;
}
.chip-checkbox input[type="checkbox"]:checked + .chip-label, .bad-chip-toggle.selected {
    background-color: var(--color-primary);
    color: white;
}
.chip-checkbox input[type="checkbox"]:focus-visible + .chip-label {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}


/* --- DATE PICKER COMPONENT --- */
.datepicker-grid { table-layout: fixed; }
.datepicker-grid th {
    text-align: center;
    padding: 10px 5px;
    color: #555;
}
.datepicker-grid td {
    padding: 2px;
}
.dp-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dp-btn:hover {
    background: #f0f0f0;
}
.dp-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    background: #e6f3ff;
}
.dp-btn[aria-current="true"] {
    background: var(--color-primary);
    color: white;
    font-weight: bold;
}
.dp-btn[aria-current="true"]:hover {
    background: var(--color-primary-dark, #cc3d2b);
}
.dp-btn.outside-month {
    color: #ccc;
}

/* Inaccessible version styles */
.bad-dp-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}
.bad-dp-cell:hover {
    background: #f0f0f0;
}
.bad-dp-cell.selected {
    background: var(--color-primary);
    color: white;
    font-weight: bold;
}
.bad-dp-cell.outside-month {
    color: #ccc;
}


.dp-btn[aria-current="date"] {
    font-weight: bold;
    color: var(--color-primary);
    position: relative;
}
.dp-btn[aria-current="date"]::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--color-primary);
}




/* Responsive Chat History */
.chat-fieldset {
    flex: 2 1 400px; min-width: 0; 
    display: flex; 
    flex-direction: column; 
    margin-top: 0;
}
.chat-history-container {
    flex: 1; min-height: 0;
    overflow-y: auto;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
  .dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  ul.dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 0 1rem !important;
    background: transparent !important;
    margin-top: 0.5rem !important;
    width: 100%;
  }
  .bad-dropdown {
    display: flex !important;
    flex-direction: column;
    width: 100%;
  }
  #bad-menu {
    position: static !important;
    width: 100%;
    margin-top: 10px;
  }

    .chat-history-container {
        max-height: 250px;
    }
}
@media (min-width: 769px) {
    .chat-wrapper {
        align-items: stretch;
    }
    .chat-fieldset {
        height: auto;
    }
}


@media (max-width: 768px) {
  .dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  ul.dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 0 1rem !important;
    background: transparent !important;
    margin-top: 0.5rem !important;
    width: 100%;
  }
  .bad-dropdown {
    display: flex !important;
    flex-direction: column;
    width: 100%;
  }
  #bad-menu {
    position: static !important;
    width: 100%;
    margin-top: 10px;
  }

    .chat-fieldset {
        min-height: 400px !important;
    }
    .chat-absolute-wrapper {
        position: absolute;
        top: 35px; /* below legend */
        bottom: 15px;
        left: 15px;
        right: 15px;
    }
}
@media (min-width: 769px) {
    .chat-absolute-wrapper {
        position: absolute;
        top: 35px;
        bottom: 15px;
        left: 15px;
        right: 15px;
    }
}


.btn-icon {
    padding: 0.25rem 0.5rem;
    min-width: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}


.disabled-date {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}


/* PASSWORD COMPONENT CSS */
#psw-container {
    background-color: transparent;
    border: solid 1px var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 0;
    margin-top: 10px;
}

.password-container {
    width: 100%;
}







meter {
    width: 100%;
    height: 12px;
    margin: 10px 0;
    display: block;
}

.icon-box {
    display: inline-block;
    width: 25px;
    font-weight: bold;
}
.icon-v, .icon-x { display: none; }

.rule {
    color: #585858;
    padding: 5px 0;
    font-size: 14px;
    margin: 5px 0;
    transition: color 0.2s;
}

.password-container:not(.pristine) .rule.invalid { color: #b41212; }
.password-container:not(.pristine) .rule.invalid .icon-x { display: inline; color: #b41212; }

.rule.valid { color: #0f5e30; }
.rule.valid .icon-v { display: inline; color: #0f5e30; }


/* --- Chart Animations --- */
.animated-bar {
    transform-origin: center 250px;
    transform: scaleY(0);
}

.animated-bar.in-view {
    animation: growBar 4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.bad-animated-bar {
    animation: badGrowBar 8s ease-in-out infinite alternate;
    transform-origin: center 250px;
}

@keyframes growBar {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes badGrowBar {
    from { transform: scaleY(0.1); fill: #ff0000; }
    to { transform: scaleY(1); fill: #0000ff; }
}

@media (prefers-reduced-motion: reduce) {
    .animated-bar {
        animation: none !important;
        transform: scaleY(1) !important;
    }
}

/* Override AltCha internal variables */
altcha-widget {
    --altcha-max-width: 100% !important;
}

.altcha-label {
  margin: 0 !important;
}

/* OTP Styles */
.otp-inputs input {
  aspect-ratio: 3/4;
  width: 44px;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #767676;
  background-color: #fff;
  color: var(--color-text);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.otp-inputs input:focus-visible {
  outline-offset: 2px;
}

.otp-inputs input[aria-invalid="true"] {
  border-color: var(--color-error, #d32f2f);
}


/* OTP Tooltip */
.otp-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-text, #333);
  color: var(--color-bg, #fff);
  padding: 4px 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
  border-radius: 4px;
}

.input-wrapper:focus-within .otp-tooltip,
.input-wrapper:hover .otp-tooltip {
  opacity: 1;
  pointer-events: auto;
}

/* Accessible Dropdown Menu Fixes */
ul.dropdown-menu {
  display: flex;
  flex-direction: column !important;
  gap: 0 !important;
  min-width: max-content;
  z-index: 100;
  top: 100%;
  left: 0;
}
ul.dropdown-menu[hidden] {
  display: none !important;
}

/* Dropdown Button Styles */
.nav-dropdown-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0.625rem 0.9375rem; /* Match nav a padding */
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-dropdown-btn:hover, .nav-dropdown-btn:focus {
  background-color: rgba(254, 60, 114, 0.1);
  color: var(--color-primary);
}
.dropdown-icon {
  transition: transform 0.3s ease;
  width: 1rem;
  height: 1rem;
}
.nav-dropdown-btn[aria-expanded="true"] .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Sitemap */
.sitemap-list, .sitemap-list ul {
  padding-left: 2rem;
  margin-bottom: 1rem;
}
.sitemap-list li {
  margin-bottom: 0.5rem;
}

/* Support Chatbot Label Focus */
#support-form:focus-within .support-input-label {
    position: absolute;
    width: auto;
    height: auto;
    clip: auto;
    white-space: normal;
    background: var(--color-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    top: -22px;
    left: 0;
    z-index: 10;
    margin: 0;
}

/* Profile Chat Label Focus */
#chat-form:focus-within .chat-input-label {
    position: absolute;
    width: auto;
    height: auto;
    clip: auto;
    white-space: normal;
    background: var(--color-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    top: -22px;
    left: 0;
    z-index: 10;
    margin: 0;
}

/* Disabled inputs */
input:disabled, textarea:disabled {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
    filter: opacity(0.5);
}
