/* =================================================================
   NEW: Global Styles & Variables (from main.css)
   ================================================================= */

/* --- Font Setup (Inter) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter/Inter-VariableFont.woff2') format('woff2');
}

:root {
    /* Peritiq Color System: High-Tech, Sleek, Confident */
    /* Primitives */
    --peritiq-yellow: #F7CB18;
    --peritiq-yellow-hover: #E0B615;
    --peritiq-cyan-electric: #00C7C7;
    --peritiq-rose-graphite: #B9929F;
    --peritiq-sand-warm: #F4E5C2;
    --peritiq-blue-deep: #191923;
    --peritiq-graphite-soft: #292b30;
    --peritiq-graphite-medium: #4A4D55;
    --peritiq-gray-light: #A0A3AB;
    --peritiq-white: #FFFFFF;

    /* Semantic Tokens (Prefixed for Peritiq Brand) */
    --peritiq-background-base: var(--peritiq-blue-deep);
    --peritiq-background-secondary: var(--peritiq-graphite-soft);
    --peritiq-background-deep: #0c0f14;
    --peritiq-text-primary: var(--peritiq-white);
    --peritiq-text-secondary: var(--peritiq-gray-light);
    --peritiq-text-accent: var(--peritiq-cyan-electric);
    --peritiq-text-inverse: var(--peritiq-blue-deep);
    --peritiq-border-primary: var(--peritiq-graphite-medium);
    --peritiq-border-secondary: #1f232c;
    --peritiq-border-subtle: rgba(255, 255, 255, 0.08);
    --peritiq-brand-primary: var(--peritiq-yellow);
    --peritiq-brand-primary-hover: var(--peritiq-yellow-hover);
    --peritiq-accent-signal: var(--peritiq-cyan-electric);
    /* RGB channels for rgba() usage: rgba(var(--peritiq-brand-rgb), 0.1) */
    --peritiq-brand-rgb: 0, 199, 199;

    /* Surface elevation */
    --peritiq-surface-elevated: #14171e;
    --peritiq-surface-overlay: rgba(255, 255, 255, 0.05);
    --peritiq-surface-overlay-hover: rgba(255, 255, 255, 0.08);
    --peritiq-surface-overlay-active: rgba(255, 255, 255, 0.1);

    /* Shadows */
    --peritiq-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --peritiq-shadow-md: 0 8px 28px rgba(0, 0, 0, 0.35);
    --peritiq-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

    /* Gradients */
    --peritiq-gradient-panel: linear-gradient(180deg, #1A1B20 0%, #141519 100%);

    /* Status */
    --peritiq-success: #22c55e;
    --peritiq-success-bg: #1a2b1f;
    --peritiq-error: #ef4444;
    --peritiq-error-bg: #2b1a1a;
    --peritiq-warning-bg: #2b2718;
    --peritiq-info-bg: #1a2f2f;

    /* Accent colors (semantic — used in analysis sections, badges) */
    --peritiq-accent-gold: #c9a227;
    --peritiq-accent-red: #e04848;
    --peritiq-accent-orange: #e09832;

    /* Form inputs */
    --peritiq-input-bg: rgba(255, 255, 255, 0.04);
    --peritiq-input-bg-hover: rgba(255, 255, 255, 0.08);
    --peritiq-input-bg-focus: rgba(255, 255, 255, 0.05);

    /* Backdrop */
    --peritiq-backdrop: rgba(0, 0, 0, 0.7);

    /* Scrollbar */
    --peritiq-scrollbar-thumb: rgba(0, 199, 199, 0.35);
    --peritiq-scrollbar-thumb-hover: rgba(0, 199, 199, 0.6);

    /* Typography */
    --peritiq-font-heading: 'Inter', sans-serif;
    --peritiq-font-body: 'Inter', sans-serif;

    /* Sizing & Radius */
    --peritiq-border-radius: 0.375rem; /* 6px */

    /* --- ADDED FROM app.css --- */
    --header-height: 64px;
}

/* =================================================================
   Light Theme Overrides
   ================================================================= */
[data-theme="light"] {
    /* Background: slightly darker for clear card separation (like Apple #F2F2F7) */
    --peritiq-background-base: #ECEDF2;
    --peritiq-background-secondary: #F3F4F7;
    --peritiq-background-deep: #E3E4EA;
    --peritiq-text-primary: #1A1D26;
    --peritiq-text-secondary: #4B5563;
    --peritiq-text-accent: #007A7A;
    --peritiq-text-inverse: #FFFFFF;
    --peritiq-border-primary: #B0B4BE;
    --peritiq-border-secondary: #D5D8DE;
    --peritiq-border-subtle: rgba(0, 0, 0, 0.10);

    /* Brand: Cyan replaces yellow in light mode — darkened for AA contrast (4.75:1 with white) */
    --peritiq-brand-primary: #008085;
    --peritiq-brand-primary-hover: #006B70;

    --peritiq-surface-elevated: #FFFFFF;
    --peritiq-surface-overlay: rgba(0, 0, 0, 0.04);
    --peritiq-surface-overlay-hover: rgba(0, 0, 0, 0.07);
    --peritiq-surface-overlay-active: rgba(0, 0, 0, 0.10);

    /* Shadows: stronger for clear card elevation on light backgrounds */
    --peritiq-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
    --peritiq-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
    --peritiq-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.10);

    --peritiq-gradient-panel: linear-gradient(180deg, #FFFFFF 0%, #F2F2F6 100%);

    --peritiq-success-bg: #ECFDF5;
    --peritiq-error-bg: #FEF2F2;
    --peritiq-warning-bg: #FFFBEB;
    --peritiq-info-bg: #ECFEFF;

    /* Accent colors: darkened for AA contrast on light backgrounds */
    --peritiq-accent-gold: #8B6914;    /* 5.2:1 on white */
    --peritiq-accent-red: #B83030;     /* 4.8:1 on white */
    --peritiq-accent-orange: #A06A10;  /* 4.6:1 on white */

    --peritiq-input-bg: rgba(0, 0, 0, 0.03);
    --peritiq-input-bg-hover: rgba(0, 0, 0, 0.05);
    --peritiq-input-bg-focus: rgba(0, 0, 0, 0.02);

    --peritiq-backdrop: rgba(0, 0, 0, 0.40);

    --peritiq-scrollbar-thumb: rgba(0, 130, 130, 0.30);
    --peritiq-scrollbar-thumb-hover: rgba(0, 130, 130, 0.50);

    /* Primitives: override dark-only values */
    --peritiq-yellow: #008085;
    --peritiq-yellow-hover: #006B70;
    --peritiq-cyan-electric: #008085;
    --peritiq-graphite-soft: #E4E5EA;
    --peritiq-graphite-medium: #D5D8DE;
    --peritiq-accent-signal: var(--peritiq-brand-primary);
    --peritiq-brand-rgb: 0, 128, 133;
}

/* Smooth theme transition (only applied during manual toggle via JS) */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

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

html, body {
 min-height: 100%;           /* allow natural page growth */
 overflow-y: auto;           /* ensure scrolling when needed */

}
/* ---
   THIS IS THE MISSING RULE
   It applies your base styles to all pages, fixing the black text issue.
--- */
body {
    font-family: var(--peritiq-font-body);
    background-color: var(--peritiq-background-base);
    color: var(--peritiq-text-primary);
    display: block;             /* restore default flow */
}

/* =================================================================
   Toast Notifications (Global)
   ================================================================= */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(20px);
    padding: 14px 20px;
    border-radius: var(--peritiq-border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 380px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-left: 4px solid;
    background: var(--peritiq-graphite-soft);
    color: var(--peritiq-text-primary);
}
.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-notification.info {
    border-left-color: var(--peritiq-cyan-electric);
    background: var(--peritiq-info-bg);
}
.toast-notification.success {
    border-left-color: var(--peritiq-success);
    background: var(--peritiq-success-bg);
}
.toast-notification.warning {
    border-left-color: #f59e0b;
    background: var(--peritiq-warning-bg);
}
.toast-notification.error {
    border-left-color: var(--peritiq-error);
    background: var(--peritiq-error-bg);
}

/* =================================================================
   APPEND THIS TO THE END OF global.css
   Password Input Wrapper & Toggle Button (Global)
   ================================================================= */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 50px !important;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--peritiq-text-secondary);
    cursor: pointer;
    padding: 4px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.password-toggle-btn:hover {
    color: var(--peritiq-accent-signal);
}

.password-toggle-btn .material-symbols-outlined {
    font-size: 20px;
}

/* =================================================================
   Password Requirements Checklist (Global)
   ================================================================= */
.password-checklist {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
}

.password-checklist li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--peritiq-text-secondary);
    background: var(--peritiq-surface-overlay);
    border: 1px solid var(--peritiq-border-subtle);
    border-radius: 100px;
    padding: 0.3rem 0.6rem;
    transition: all 0.2s ease;
}

.password-checklist li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--peritiq-surface-overlay-active);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.password-checklist li.met {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.password-checklist li.met::before {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* =================================================================
   Form Error/Success Messages (Global)
   ================================================================= */
.form-error-message {
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 0.4rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.form-error-message.show {
    display: flex;
}

.form-error-message::before {
    content: '⚠';
    font-size: 0.7rem;
}

.form-success-message {
    font-size: 0.75rem;
    color: #4ade80;
    margin-top: 0.4rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.form-success-message.show {
    display: flex;
}

.form-success-message::before {
    content: '✓';
    font-size: 0.7rem;
}

.form-group input.input-error {
    border-color: #f87171 !important;
}

.form-group input.input-valid {
    border-color: #4ade80 !important;
}

/* =================================================================
   SECURITY MODAL SYSTEM (Global - shared by Chat & Investor)
   ================================================================= */

.security-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--peritiq-backdrop);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.security-modal-dialog {
  position: relative;
  background: var(--peritiq-gradient-panel);
  border: 1px solid var(--peritiq-border-primary);
  box-shadow: var(--peritiq-shadow-md);
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}

.security-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--peritiq-border-primary);
  margin-bottom: 20px;
}

.security-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--peritiq-text-primary);
  margin: 0;
}

.security-modal-close {
  background: transparent;
  border: 1px solid var(--peritiq-border-primary);
  color: var(--peritiq-text-primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.security-modal-close:hover {
  background: var(--peritiq-surface-overlay-active);
  transform: scale(1.05);
}

.security-modal-body {
  padding: 0;
}

.security-modal-dialog h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--peritiq-text-primary);
  margin: 0 0 20px 0;
}

.security-modal-dialog p {
  font-size: 0.9rem;
  color: var(--peritiq-text-secondary);
  margin: 0 0 16px 0;
}

.security-modal-dialog .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.security-modal-dialog .form-group:last-child {
  margin-bottom: 0;
}

.security-modal-dialog .form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--peritiq-text-secondary);
  line-height: 1.3;
  margin-bottom: 0 !important;
}

.security-modal-dialog .form-control {
  width: 100%;
  background: var(--peritiq-input-bg);
  border: 1px solid var(--peritiq-border-primary);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--peritiq-text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.security-modal-dialog .form-control:hover {
  background: var(--peritiq-input-bg-hover);
  border-color: var(--peritiq-border-primary);
}

.security-modal-dialog .form-control:focus {
  background: var(--peritiq-input-bg-focus);
  border-color: var(--peritiq-accent-signal);
  box-shadow: 0 0 0 1px var(--peritiq-accent-signal);
}

.security-modal-dialog .form-control.input-valid {
  border-color: #198754;
  box-shadow: 0 0 0 1px #198754;
}

.security-modal-dialog .form-control.input-error {
  border-color: #e74c5e;
  box-shadow: 0 0 0 1px #e74c5e;
}

.security-modal-dialog .form-actions,
.security-modal-dialog .modal-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
  gap: 12px;
}

.security-modal-dialog .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.security-modal-dialog .btn-primary {
  background: var(--peritiq-brand-primary);
  color: var(--peritiq-text-inverse);
  border-color: var(--peritiq-brand-primary);
}

.security-modal-dialog .btn-primary:hover {
  background: var(--peritiq-brand-primary-hover);
  border-color: var(--peritiq-brand-primary-hover);
}

.security-modal-dialog .btn-primary:disabled {
  background: var(--peritiq-brand-primary);
  opacity: 0.5;
  cursor: wait;
}

.security-modal-dialog .btn-secondary {
  background: var(--peritiq-surface-overlay);
  color: var(--peritiq-text-primary);
  border: 1px solid var(--peritiq-border-primary);
}

.security-modal-dialog .btn-secondary:hover {
  background: var(--peritiq-surface-overlay-active);
}

.security-modal-dialog .btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #ef4444;
  border-color: rgba(220, 53, 69, 0.3);
}

.security-modal-dialog .btn-danger:hover {
  background: rgba(220, 53, 69, 0.25);
}

/* Feedback Alerts (Security Modals) */
.auth-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: block;
  line-height: 1.5;
}

.auth-alert-error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #e74c5e;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.auth-alert-success {
  background-color: rgba(0, 199, 199, 0.1);
  color: var(--peritiq-brand-primary);
  border: 1px solid rgba(0, 199, 199, 0.3);
}

/* Password Strength Meter (Security Modals) */
.security-modal-dialog .password-strength-meter {
  height: 10px;
  width: 100%;
  background: var(--peritiq-surface-overlay);
  border-radius: 5px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  display: none;
}

.security-modal-dialog .strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background-color: #dc3545;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.security-modal-dialog .strength-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--peritiq-text-secondary);
  margin-left: 8px;
  white-space: nowrap;
}

.security-modal-dialog .password-strength-meter.weak .strength-bar,
.security-modal-dialog .password-strength-meter.strength-weak .strength-bar {
  width: 33%;
  background-color: #dc3545;
}

.security-modal-dialog .password-strength-meter.medium .strength-bar,
.security-modal-dialog .password-strength-meter.strength-medium .strength-bar {
  width: 66%;
  background-color: #ffc107;
}

.security-modal-dialog .password-strength-meter.strong .strength-bar,
.security-modal-dialog .password-strength-meter.strength-strong .strength-bar {
  width: 100%;
  background-color: #198754;
}

/* ═══════════════════════════════════════════════════════════════
   iOS SAFARI TOUCH/CLICK FIX
   iOS requires cursor:pointer for touch events to fire reliably
   ═══════════════════════════════════════════════════════════════ */
button,
[role="button"],
a[href],
input[type="button"],
input[type="submit"],
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.nav-link,
.dropdown-item,
.tab-link {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 199, 199, 0.15);
}

/* Prevent iOS text size adjustment */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* iOS momentum scrolling for overflow containers */
.modal-body,
.dropdown-menu,
.scrollable,
.security-modal-dialog {
    -webkit-overflow-scrolling: touch;
}

/* Fix for iOS input zoom (inputs < 16px trigger zoom) */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* iOS safe area support for notched devices */
@supports (padding: max(0px)) {
    .app-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* =================================================================
   APPEND TO END OF global.css
   Peritiq Global Scrollbar (Unified)
   ================================================================= */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--peritiq-scrollbar-thumb) transparent;
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--peritiq-scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--peritiq-scrollbar-thumb-hover);
}

/* Hide scrollbar on very small elements where it's noise */
::-webkit-scrollbar-corner {
    background: transparent;
}

/* =================================================================
   Language Switcher — Global Peritiq Dark Component
   Shared across questionnaires, vote pages, and all public pages.
   Two modes:
     1. Custom dropdown (.language-switcher) — preferred
     2. Native <select> fallback — auto-styled dark
   ================================================================= */

/* --- Custom Dropdown (preferred) --- */
.language-switcher-wrapper {
    position: absolute;
    top: -3rem;
    right: 0;
    z-index: 100;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.language-switcher-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.language-switcher {
    position: relative;
    display: inline-block;
}

.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: transparent;
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 8px;
    color: var(--peritiq-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.lang-trigger:hover {
    background: var(--peritiq-surface-overlay);
    border-color: var(--peritiq-border-subtle);
    color: var(--peritiq-text-primary);
}

.lang-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 128, 133, 0.2);
}

.lang-trigger i.bi-globe2 { font-size: 0.95rem; }
.lang-trigger .material-symbols-outlined { font-size: 1rem; line-height: 1; }
.lang-current { font-weight: 600; letter-spacing: 0.5px; }
.lang-chevron { font-size: 0.6rem; transition: transform 0.2s ease; }
.language-switcher.open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--peritiq-surface-elevated);
    border: 1px solid var(--peritiq-border-primary);
    border-radius: 12px;
    box-shadow: var(--peritiq-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    overflow: hidden;
    padding: 4px;
    z-index: 200;
}

.language-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    color: var(--peritiq-text-primary);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 450;
    transition: background 0.12s ease;
    border-radius: 8px;
}

.lang-option:hover {
    background: var(--peritiq-surface-overlay);
    color: var(--peritiq-text-primary);
    text-decoration: none;
}

.lang-option.active {
    background: rgba(0, 128, 133, 0.08);
    color: var(--peritiq-brand-primary);
    font-weight: 600;
}

.lang-option.active::after {
    content: '\2713';
    margin-left: auto;
    font-weight: 700;
    font-size: 0.8rem;
}

.lang-flag { font-size: 1.1rem; line-height: 1; }

/* --- Vote Page Content Wrapper (relative parent for switcher positioning) --- */
.pv-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-top: 3rem;
}

/* --- Native <select> Fallback (any page without custom switcher) --- */
select[name="lang"],
select.vote-lang-select,
.vote-page-header select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A0A3AB'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 10px 6px;
    border: 1px solid var(--peritiq-border-primary, #4A4D55);
    border-radius: 8px;
    color: var(--peritiq-text-secondary, #A0A3AB);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

select[name="lang"]:hover,
select.vote-lang-select:hover,
.vote-page-header select:hover {
    background-color: var(--peritiq-surface-overlay);
    border-color: var(--peritiq-border-subtle);
    color: var(--peritiq-text-primary, #FFFFFF);
}

select[name="lang"]:focus,
select.vote-lang-select:focus,
.vote-page-header select:focus {
    box-shadow: 0 0 0 2px rgba(0, 128, 133, 0.2);
    border-color: var(--peritiq-brand-primary);
}

select[name="lang"] option,
select.vote-lang-select option,
.vote-page-header select option {
    background: var(--peritiq-surface-elevated);
    color: var(--peritiq-text-primary, #FFFFFF);
    padding: 0.5rem;
}

/* --- Language Switcher Responsive --- */
@media (max-width: 767.98px) {
    .language-switcher-wrapper { top: -2.75rem; }
    .lang-trigger { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
}

@media (max-width: 575.98px) {
    .language-switcher-wrapper { top: -2.5rem; }
    .lang-dropdown { min-width: 140px; }
}

/* ── Onboarding brand logo ── */
.onboarding-brand {
    font-size: 0;          /* collapse any inherited text sizing */
    line-height: 1;
    margin-bottom: 20px;
}
.onboarding-brand .logo img {
    height: 40px;
    width: auto;
}
