/* polls.css — styles CSVE organisés par responsabilité. */

/* Pass D — polls */

/* ===== pollPreviewStyle ===== */

.poll-preview {
  margin: .8rem 0;
  padding: 1rem;
  border: 1px solid var(--surface-content-border);
  border-radius: 16px;
  background-color: var(--surface-content);
  background-image: var(--surface-content-image);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.poll-preview button,
.poll-preview input,
.poll-preview textarea {
  font-family: var(--font-ui);
}

.poll-preview .title {
  align-items: center;
}

.poll-preview h2 {
  font-size: 1rem;
}

.poll-preview p {
  margin: .25rem 0;
  color: var(--muted);
  font-size: .84rem;
}

.poll-preview-form {
  display: grid;
  gap: .45rem;
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
}

.poll-preview-form input {
  min-height: 38px;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .72rem;
}

.poll-preview-form .poll-add-choice {
  background: var(--surface-content-soft);
  color: var(--green);
  font-size: .72rem;
}

.poll-preview-form small {
  color: var(--muted);
}

.poll-compose-modal {
  position: fixed;
  z-index: 1450;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, .64);
}

.poll-compose-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}

.poll-compose-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 32rem);
  max-height: min(90dvh, 42rem);
  overflow: auto;
}

.poll-compose-dialog .poll-preview-form {
  margin-top: .9rem;
  padding-top: .9rem;
}

.poll-compose-dialog .poll-preview-form input {
  min-height: 44px;
  font-size: .9rem;
}

.poll-compose-dialog .poll-preview-form button {
  min-height: 44px;
}

/* ===== pollDisplayStyle ===== */

.poll-preview {
  margin: .35rem 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  container-type: inline-size;
}

.poll-preview h2 {
  font-size: .92rem;
}

.poll-preview p {
  font-size: .77rem;
}

.poll-preview .title {
  align-items: center;
  padding: .1rem 0;
  margin-bottom: .35rem;
}

.poll-preview > .title > .eyebrow {
  margin: 0;
}

.poll-active {
  --poll-surface: #3e5056;
  --poll-surface-image: linear-gradient(110deg, #36494f, #3e5056);
  --poll-ink: #f1f6f2;
  --poll-muted: #c7d4d8;
  --poll-control-surface: rgba(33, 46, 52, .9);
  --poll-border: rgba(202, 220, 222, .24);
  --poll-accent: #8fd6ac;
  --poll-selected: rgba(34, 75, 61, .94);
  --ink: var(--poll-ink);
  --muted: var(--poll-muted);
  --green: var(--poll-accent);
  --red: #a53630;
  --redsoft: #f1d3cf;
  --soft: var(--poll-selected);
  --surface-content-soft: var(--poll-control-surface);
  --surface-content-border: var(--poll-border);
  position: relative;
  margin: .35rem 0;
  padding: .65rem .6rem;
  border: 1px solid var(--poll-border);
  border-radius: 16px;
  background-color: var(--poll-surface);
  background-image: var(--poll-surface-image);
  background-size: 100% 100%;
  background-position: top center;
  background-repeat: no-repeat;
  color: var(--poll-ink);
  box-shadow: var(--surface-content-shadow);
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .poll-active { background-image: none; --poll-control-surface: #212e34; --poll-selected: #224b3d; }
}
.poll-active:first-of-type {
  margin-top: .35rem;
}

.poll-active:last-of-type {
  margin-bottom: 0;
}

.poll-active-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: .35rem;
  min-height: 28px;
}

.poll-active .coach-card-menu {
  position: static;
  flex: 0 0 auto;
}

.poll-active .coach-card-menu-trigger {
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
}

.poll-active .coach-card-menu-trigger:hover,
.poll-active .coach-card-menu-trigger[aria-expanded="true"] {
  border-color: transparent;
  background: transparent;
}

.poll-delete {
  align-self: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--red);
  font-size: 1.05rem;
  line-height: 1;
}

.poll-active-toggle {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: .35rem;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: var(--ink) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.18;
  text-align: left;
  cursor: pointer;
}

.poll-active-toggle:hover, .poll-active-toggle:focus {
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.poll-active-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 6px;
}

.poll-active-heading {
  display: grid;
  min-width: 0;
  gap: .12rem;
}

.poll-active-title {
  min-width: 0;
  color: var(--ink) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

.poll-active-date {
  color: var(--muted) !important;
  font-size: .62rem;
  font-weight: 600;
  line-height: 1.1;
}

.poll-response-status {
  align-self: center;
  padding: .25rem .6rem;
  border: 1px solid var(--surface-content-border);
  border-radius: 999px;
  background: rgba(8, 20, 17, .66);
  color: var(--ink);
  font-size: .65rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.poll-response-status.is-answered {
  border-color: color-mix(in srgb, var(--green) 48%, transparent);
  color: var(--green);
  background: rgba(8, 20, 17, .66);
}

.poll-response-status.is-pending {
  border-color: rgba(234, 214, 158, .32);
}

.poll-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem;
  margin-top: .25rem;
}

.poll-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-width: 0;
  min-height: 44px;
  padding: .4rem .6rem;
  border: 1px solid var(--surface-content-border);
  border-radius: 6px;
  background: var(--surface-content-soft);
  color: var(--ink);
  font-size: .71rem;
  line-height: 1.2;
  text-align: left;
}

.poll-options button.selected {
  border-color: var(--green);
  background: var(--soft);
  box-shadow: inset 3px 0 0 var(--green);
}

.poll-options button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.poll-options button:not(.selected) {
  border-color: var(--surface-content-border);
  background: var(--surface-content-soft);
  box-shadow: none;
  color: var(--ink);
}

.poll-options button span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.poll-options button small {
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  min-width: 5.1rem;
  padding: 0;
  color: var(--muted);
  font-size: .57rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 520px) {
  .poll-active-date {
    font-size: .6rem;
  }
  .poll-response-status {
    font-size: .62rem;
  }
}

/* CSVE · Sondages et composition du sondage */
.poll-preview-form .poll-add-choice {
  justify-self: start;
  min-height: 34px !important;
  border: 1px dashed color-mix(in srgb, var(--green) 52%, transparent) !important;
  background: var(--surface-content-soft) !important;
  color: var(--green) !important;
  font-size: .72rem !important;
}
