

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  color: #111827;
  min-height: 100vh;
  background: linear-gradient(
    90deg,
    #002654 0%,
    #002654 33%,
    #ffffff 33%,
    #ffffff 66%,
    #e31836 66%,
    #e31836 100%
  );
}



.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}



.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}



.site-header {
  background: rgba(255, 255, 255, 0.96);
  padding: 1.2rem 1.5rem;
  border-radius: 0.9rem 0.9rem 0 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
  text-align: center;
  border-bottom: 3px solid #e5e7eb;
}

.site-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #111827;
}

.site-header p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: #4b5563;
}

main {
  background: rgba(255, 255, 255, 0.97);
  padding: 1.2rem 1.5rem 1.5rem;
  border-radius: 0 0 0.9rem 0.9rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  flex: 1;
}

.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #e5e7eb;
  margin-top: 0.75rem;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.7);
}



.form-container {
  background: #ffffff;
  padding: 1.25rem 1.1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.form-container h2 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}


.form-container .hint {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: #6b7280;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: #374151;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font: inherit;
  resize: vertical;
  min-height: 3rem;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}



.error-message,
.success-message {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}


.error-message:empty,
.success-message:empty {
  display: none;
}

.error-message {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.success-message {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
}



button {
  font: inherit;
  cursor: pointer;
}

.primary-btn {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  background: #1e40af;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}



.questions-container {
  margin-top: 0.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.2rem;
}



.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.theme-filter {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 0.9rem;
}


th.sortable {
  cursor: pointer;
  white-space: nowrap;
}

th.sortable .sort-indicator {
  margin-left: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.7;
}


.sort-btn:hover {
  background: #e0edff;
  border-color: #93c5fd;
}



.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

thead {
  background-color: #f3f4f6;
}

th,
td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

th {
  font-weight: 600;
  color: #374151;
}

tr:last-child td {
  border-bottom: none;
}




.vote-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.vote-bar {
  width: 69px;
  max-width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.vote-bar-oui {
  height: 100%;
  background: #16a34a;
}

.vote-bar-non {
  height: 100%;
  background: #ef4444;
}

.vote-legend {
  font-size: 0.78rem;
  color: #4b5563;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.vote-oui {
  color: #166534;
  font-weight: 500;
}

.vote-non {
  color: #b91c1c;
  font-weight: 500;
}

.vote-total {
  color: #6b7280;
}



.vote-btn {
  padding: 0.35rem 0.45rem;
  font-size: 0.85rem;
  margin-right: 0.25rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: opacity 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
}

.vote-btn:hover {
  opacity: 0.95;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.vote-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.vote-oui-btn {
  background: #16a34a;
}

.vote-non-btn {
  background: #ef4444;
}



@media (max-width: 640px) {
  .site-header h1 {
    font-size: 1.4rem;
  }

  main {
    padding: 1rem 0.9rem 1.2rem;
  }

  .form-container {
    padding: 0.9rem 0.85rem;
  }

  th,
  td {
    padding: 0.6rem 0.5rem;
    font-size: 0.83rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters {
    justify-content: flex-start;
  }
}



.top-nav {
  margin-top: 0.9rem;
  display: inline-flex;
  padding: 0.15rem;
  background: #e5e7eb;
  border-radius: 999px;
}

.nav-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-btn-active {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}



.dashboard-container {
  margin-top: 1.25rem;
}

.dashboard-intro {
  font-size: 0.92rem;
  color: #4b5563;
  margin: 0.25rem 0 1.25rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dashboard-card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.9rem 0.95rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  border-top: 3px solid #1d4ed8;
}

.dashboard-card h3 {
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
  color: #4b5563;
}

.card-main {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.card-sub {
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
  color: #6b7280;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
}

.dashboard-panel {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.9rem 0.95rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.dashboard-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}



.db-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
}

.db-question-item {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e7eb;
}

.db-question-item:last-child {
  border-bottom: none;
}

.db-question-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
  color: #111827;
}

.db-question-meta {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}



.theme-row {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e7eb;
}

.theme-row:last-child {
  border-bottom: none;
}

.theme-row-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.theme-name {
  font-weight: 500;
  color: #111827;
}

.theme-meta {
  color: #6b7280;
}



.theme-bar {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.theme-bar-inner {
  height: 100%;
  background: #1d4ed8;
}



@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


.question-row-voted {
  opacity: 0.6;
}

.question-row-voted .vote-btn {
  cursor: not-allowed;
}


.actions-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}


.vote-btn {
  margin-right: 0;
}



.submit-progress {
  margin-top: 0.75rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.submit-progress-bar {
  position: relative;
  flex: 1;
  min-width: 80px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.submit-progress-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  transform: translateX(-100%);
  background: linear-gradient(90deg, #93c5fd, #1d4ed8);
  animation: submit-progress-indeterminate 1s infinite;
}

.submit-progress-label {
  white-space: nowrap;
}

@keyframes submit-progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(150%);
  }
}



.realtime-banner {
  margin: 0.4rem 0 0.6rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  display: inline-flex;       
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;     
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #4b5563;
}


.realtime-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.realtime-label {
  font-weight: 600;
  color: #166534;
}

.realtime-separator {
  color: #9ca3af;
}

.reset-info {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
  justify-content: center;    
}

.reset-date strong {
  font-weight: 600;
}



.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #4b5563;
  cursor: pointer;
}

.filter-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #1d4ed8;
}



.vote-btn-selected {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  opacity: 1;
}

.question-row-voted .vote-btn {
  opacity: 0.4;
}

.question-row-voted .vote-btn-selected {
  opacity: 1; 
}






.realtime-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.realtime-text {
  font-weight: 600;
}

.reset-text strong {
  font-weight: 600;
}

.reset-subtext {
  color: #6b7280;
  margin-left: 0.25rem;
}



.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
}

.filter-toggle input {
  margin: 0;
}



.vote-btn-selected {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}


.question-row-voted {
  opacity: 1; 
  background-color: #f3f4f6;
}

.question-row-voted td {
  color: #6b7280;
}


.vote-btn-selected {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}


.question-row-voted .vote-btn:not(.vote-btn-selected) {
  opacity: 0.5;
}



.install-btn {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

#installAppBtn {
    display: none;
}

#installAppBtn.show {
    display: block;
}



.secondary-btn {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.secondary-btn:hover {
  background: #e5e7eb;
}

.danger-btn {
  background: #b91c1c;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.danger-btn:hover {
  background: #991b1b;
}


.delete-question-btn {
  background: #f97316;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #ffffff;
}

.delete-question-btn:hover {
  background: #ea580c;
}



body.legal-page {
  background: #f3f4f6;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #111827;
}

.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.legal-card {
  background: #ffffff;
  padding: 2rem 1.75rem 2.5rem;
  border-radius: 0.9rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.legal-title {
  font-size: 1.9rem;
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.legal-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.legal-card h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.2rem;
}

.legal-card h3 {
  font-size: 1.05rem;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.legal-card p,
.legal-card li {
  font-size: 0.95rem;
}

.legal-card ul {
  padding-left: 1.2rem;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.muted {
  color: #6b7280;
  font-size: 0.85rem;
}

.legal-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  background: #f3f4f6;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
}




:root{
  --brand:#1d4ed8;        
  --ink:#111827;          
  --muted:#6b7280;        
  --line:#e5e7eb;         
  --paper:#ffffff;
  --soft:#f9fafb;
}

body.legal-page{
  background:var(--soft);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Inter,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.legal-container{
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.legal-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}

.legal-title{
  margin:0 0 .25rem;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  letter-spacing:.2px;
}

.legal-subtitle{
  margin:0 0 1rem;
  color:var(--muted);
  font-size:.95rem;
}

.legal-card h2{
  margin:1.2rem 0 .4rem;
  padding-top:.4rem;
  border-top:1px solid var(--line);
  font-size: clamp(1.2rem, 2vw, 1.35rem);
}

.legal-card p, .legal-card li{ font-size:1rem; }
.legal-card ul{ margin:.2rem 0 .8rem 1.25rem; }

.legal-card a{
  color:var(--brand);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:2px;
}

.legal-note{
  background: #eef2ff; 
  border:1px solid #c7d2fe;
  padding:.75rem .9rem;
  border-radius:.6rem;
  margin:.6rem 0 1rem;
  font-size:.95rem;
}

.legal-kv{
  border:1px dashed var(--line);
  border-radius:.6rem;
  padding:.6rem .8rem;
  display:grid;
  grid-template-columns: 200px 1fr;
  gap:.4rem .8rem;
  margin:.4rem 0 1rem;
}
.legal-kv dt{color:var(--muted)}
.legal-kv dd{margin:0}

.badge{
  display: inline-block;
  background: #ecfeff;
  color:#0e7490;
  border:1px solid #a5f3fc;
  border-radius:999px;
  padding:.12rem .5rem;
  font-size:.8rem;
}


.consent-box {
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:12px;
  padding: .9rem 1rem;
  margin: .75rem 0 1rem;
}
.consent-box h4 { margin:.2rem 0 .6rem; font-size:1rem; }
.consent-steps { margin:.25rem 0 .5rem 1rem; }
.consent-steps li { margin:.35rem 0; }
.consent-check { margin-left:.5rem; font-size:.95rem; color:#374151; }
.consent-final { display:block; margin-top:.6rem; font-weight:600; }
.consent-final input { margin-right:.35rem; accent-color:var(--brand); }
.consent-warning{
  color:#b45309; background:#fffbeb; border:1px solid #fde68a;
  padding:.5rem .6rem; border-radius:.5rem; font-size:.9rem; margin:.5rem 0;
}


.modal{
  position: fixed; inset:0; z-index: 1000;
  display:none; align-items:center; justify-content:center;
  background: rgba(0,0,0,.5);
}
.modal[open]{ display:flex; }
.modal-card{
  width:min(920px, 92vw);
  height:min(78vh, 900px);
  background:var(--paper);
  border-radius:12px;
  border:1px solid var(--line);
  box-shadow:0 8px 24px rgba(0,0,0,.22);
  display:flex; flex-direction:column;
  overflow:hidden;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:.6rem .9rem; border-bottom:1px solid var(--line);
}
.modal-title{ margin:0; font-size:1rem; }
.modal-close{
  background:transparent; border:0; cursor:pointer; font-size:1.2rem; line-height:1;
}
.modal-body{ flex:1; overflow:auto; }
.modal-body iframe{ width:100%; height:100%; border:0; }
.modal-foot{
  display:flex; align-items:center; gap:.5rem;
  padding:.6rem .9rem; border-top:1px solid var(--line);
  background:var(--soft);
}
.btn{
  appearance:none; border:1px solid var(--line); border-radius:.6rem;
  padding:.55rem .75rem; background:var(--paper); cursor:pointer;
}
.btn.primary{ background:var(--brand); border-color:var(--brand); color:white; }
.btn[disabled]{ opacity:.6; cursor:not-allowed; }




.btn.is-disabled,
.btn[aria-disabled="true"] { opacity:.6; cursor:not-allowed; }



.actions-td {
  vertical-align: middle;
  white-space: nowrap;
}

.actions-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
}


.error-message { color: #b91c1c; margin-top: 10px; }
.success-message { color: #065f46; margin-top: 10px; }
