/* ==========================================================================
   CDLA-Vote Modern Light Mode Design System
   Camping du lac d'Argent S.E.N.C. - Electronic Voting Interface
   ========================================================================== */

:root {
  /* Canvas & Backgrounds */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #f1f5f9;
  --bg-card-active: #ecfdf5;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-subtle: #f1f5f9;
  --bg-inset: #f8fafc;

  /* Brand & Accent Colors */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.2);

  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #eff6ff;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Borders & Shadows */
  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-active: #059669;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 18px rgba(5, 150, 105, 0.25);

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container-max-width: 1040px;
  --header-height: 72px;
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(241, 245, 249, 0.8) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout Elements */
.app-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem 1.25rem;
  flex: 1;
}

/* Header & Glassmorphism Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}

.nav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #ffffff;
  padding: 2px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.brand-wrapper:hover .brand-logo {
  transform: scale(1.05);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.user-badge-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

.user-badge-nav .user-avatar {
  font-size: 0.95rem;
}

.btn-logout {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Hamburger Menu Button */
.burger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.burger-icon {
  width: 24px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.burger-icon span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: #0f172a;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hero & Main Sections */
.hero-section {
  text-align: center;
  padding: 2.5rem 1rem 3rem 1rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #0f172a 40%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem auto;
  line-height: 1.5;
}

/* Feature Cards Grid (Home) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  text-align: left;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: #a7f3d0;
  box-shadow: var(--shadow-lg);
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
  color: #ffffff;
}

.btn-accent {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-card);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: calc(50% - 10px);
  left: calc(50% - 10px);
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Cards & Containers */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

/* User Info Banner */
.user-profile-card {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.user-profile-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  border: 1px solid #a7f3d0;
}

.user-profile-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.user-profile-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lot-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  line-height: 1.2;
}

.badge-lot {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid #cbd5e1;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.badge-info {
  background: var(--accent-blue-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-neutral {
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid #e2e8f0;
}

.status-dot-closed {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: #64748b;
  display: inline-block;
}

/* Section Titles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Poll / Questions Card Grid */
.polls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.poll-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.poll-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.poll-card.active-poll::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #059669, #2563eb);
}

.poll-header-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.poll-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.poll-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.35;
}

.poll-actions-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lot-vote-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Candidate Card Grid for Voting */
.voting-meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.voting-lot-badge {
  font-size: 1.05rem;
  padding: 0.4rem 1rem;
  margin-bottom: 0.75rem;
}

.multi-lot-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem 0;
}

.selection-rules-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-blue-light);
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem 0;
}

.candidate-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 80px;
  box-shadow: var(--shadow-sm);
}

.candidate-card:hover {
  background: var(--bg-card-hover);
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.candidate-card.is-selected {
  background: var(--bg-card-active);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.candidate-checkbox-custom {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.candidate-card.is-selected .candidate-checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.candidate-checkbox-custom svg {
  display: none;
  width: 16px;
  height: 16px;
}

.candidate-card.is-selected .candidate-checkbox-custom svg {
  display: block;
}

.candidate-photo {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.candidate-info {
  flex: 1;
  min-width: 0;
}

.candidate-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-part {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Real-time selection counter floating pill */
.selection-counter-bar {
  position: sticky;
  bottom: 1.5rem;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.counter-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.counter-text b {
  color: var(--primary);
  font-size: 1.15rem;
}

/* Results Screen Elements */
.results-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-value.valid { color: #059669; }
.stat-value.invalid { color: #dc2626; }

.ca-rules-card {
  background: var(--accent-blue-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #1e3a8a;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.result-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.result-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-candidate-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-row-card.elected .result-rank-badge {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.result-stats-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-elected { background: linear-gradient(90deg, #059669, #10b981); }
.fill-qualified { background: linear-gradient(90deg, #d97706, #f59e0b); }
.fill-other { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

/* Proof / Receipt Screen */
.proof-certificate-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  margin: 1.5rem auto;
  max-width: 540px;
  text-align: center;
}

.proof-status-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.proof-status-icon.success {
  background: var(--success-bg);
  color: var(--success);
  border: 2px solid var(--success-border);
}

.proof-status-icon.invalid {
  background: var(--danger-bg);
  color: var(--danger);
  border: 2px solid var(--danger-border);
}

.signature-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.signature-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.03em;
  word-break: break-all;
  text-align: left;
}

.signature-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  color: #0f172a;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  word-break: break-all;
  display: inline-block;
}

.btn-copy {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: #e2e8f0;
}

/* Auth / Login Page */
.auth-wrapper {
  max-width: 440px;
  margin: 1.5rem auto;
  width: 100%;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  min-height: 48px;
  box-shadow: var(--shadow-sm);
}

.google-btn:hover {
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.google-btn:active {
  transform: scale(0.99);
}

.google-icon {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.85rem;
}

.form-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.form-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 0.75rem 2.65rem;
  transition: all 0.2s ease;
  min-height: 46px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  background: #ffffff;
}

.form-input::placeholder {
  color: var(--text-light);
}

/* Alerts & Notifications */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.3s ease;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 0.25rem;
}

.alert-close:hover {
  opacity: 1;
}

/* Audit / Table Responsive Component */
.audit-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  margin-top: 1rem;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  background: #ffffff;
}

.audit-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-card);
}

.audit-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.audit-table tr:hover td {
  background: #f8fafc;
}

/* Toast Notification for signature copy */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #059669;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  margin-top: auto;
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints & Mobile Enhancements */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .app-container {
    padding: 1rem 0.85rem 2rem 0.85rem;
  }

  .burger-btn {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-card);
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.is-active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    justify-content: flex-start;
  }

  .user-badge-nav {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
  }

  .btn-logout {
    text-align: center;
    padding: 0.75rem;
  }

  .polls-grid {
    grid-template-columns: 1fr;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding: 1.5rem 0.5rem 2rem 0.5rem;
  }

  .selection-counter-bar {
    bottom: 1rem;
    padding: 0.75rem 1rem;
    flex-direction: column;
    text-align: center;
  }

  .selection-counter-bar .btn {
    width: 100%;
  }

  .proof-certificate-card {
    padding: 1.5rem 1rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }
}

/* Owner Candidate Selector Styles */
.owners-picker-container {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: var(--bg-body);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
}

.owner-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.owner-select-card:hover {
  background: #f8fafc;
  border-color: var(--primary-light);
}

.owner-select-card.selected {
  background: #ecfdf5;
  border-color: #059669;
}

.owner-select-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #059669;
  cursor: pointer;
  flex-shrink: 0;
}

.owner-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.selected-candidates-box {
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}

.selected-candidates-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.candidate-pill-tag {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.candidate-pill-tag .btn-remove-pill {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: bold;
  transition: color 0.15s ease;
}

.candidate-pill-tag .btn-remove-pill:hover {
  color: var(--danger);
}

/* ==========================================================================
   Modal / Dialog Styles
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.forgot-password-link {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.forgot-password-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Candidate Photo Upload & Preview Rows
   ========================================================================== */
.selected-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.selected-candidate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.selected-candidate-row:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.candidate-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-card);
  flex-shrink: 0;
  background: #f1f5f9;
}

.candidate-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.candidate-row-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.candidate-row-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.candidate-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-upload-photo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-upload-photo:hover {
  background: var(--bg-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-remove-candidate {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-remove-candidate:hover {
  color: var(--danger);
  background: #fee2e2;
}