/* ─────────────────────────────────────────────────────────────────────────
 *  Capitalys, Next-Course Survey
 *
 *  Encart de fin de formation. S'aligne sur le design system existant
 *  (Fraunces serif, Sora sans, palette gold/green/navy).
 * ──────────────────────────────────────────────────────────────────────── */

.survey-card {
  margin: 56px auto 32px;
  padding: 36px 40px 32px;
  max-width: 760px;
  background: linear-gradient(135deg, rgba(139, 115, 64, .04) 0%, rgba(61, 122, 95, .03) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  font-family: var(--sans);
  clear: both;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.survey-header {
  margin-bottom: 24px;
}

.survey-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 10px;
}

.survey-heading {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 12px;
}

.survey-intro {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  opacity: .82;
  margin: 0;
}

/* ── Topic options (custom checkboxes) ────────────────────────────────── */
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.survey-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}

.survey-option:hover {
  border-color: rgba(139, 115, 64, .5);
  background: rgba(139, 115, 64, .02);
}

.survey-option.selected {
  border-color: var(--gold);
  background: rgba(139, 115, 64, .06);
}

.survey-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.survey-option-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border2);
  background: #FFFFFF;
  position: relative;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
}

.survey-option.selected .survey-option-mark {
  background: var(--gold);
  border-color: var(--gold);
}

.survey-option.selected .survey-option-mark::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(45deg);
}

.survey-option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.survey-option-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.survey-option-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  opacity: .65;
  line-height: 1.45;
}

/* ── Counter ───────────────────────────────────────────────────────────── */
.survey-counter {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text);
  opacity: .6;
  margin-bottom: 22px;
  text-align: right;
  transition: color .15s;
}

.survey-counter-full {
  color: var(--gold);
  opacity: 1;
  font-weight: 600;
}

/* ── Free-text fields ─────────────────────────────────────────────────── */
.survey-text-label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 8px;
  opacity: .82;
}

.survey-text-input {
  width: 100%;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}

.survey-text-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139, 115, 64, .12);
}

.survey-text-input::placeholder {
  color: var(--text);
  opacity: .35;
}

.survey-textarea {
  resize: vertical;
  min-height: 72px;
  font-family: var(--sans);
}

/* ── Submit button ────────────────────────────────────────────────────── */
.survey-submit {
  margin-top: 24px;
  padding: 13px 28px;
  background: var(--text);
  color: #FAF9F5;
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
}

.survey-submit:hover {
  background: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 115, 64, .22);
}

.survey-submit:active {
  transform: translateY(0);
}

/* ── Error message ────────────────────────────────────────────────────── */
.survey-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(177, 74, 63, .08);
  border-left: 3px solid #B14A3F;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: #B14A3F;
}

/* ── Thanks state (post-submit) ───────────────────────────────────────── */
.survey-thanks {
  text-align: center;
  padding: 16px 0;
}

.survey-thanks-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  background: rgba(61, 122, 95, .12);
  color: var(--green);
  border-radius: 50%;
  font-size: 28px;
  font-weight: 600;
}

.survey-thanks-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.survey-thanks-desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  opacity: .75;
  max-width: 480px;
  margin: 0 auto 22px;
}

.survey-edit-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.survey-edit-btn:hover {
  border-color: var(--gold);
  background: rgba(139, 115, 64, .05);
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media(max-width:720px) {
  .survey-card {
    margin: 36px 0 24px;
    padding: 28px 22px 24px;
    border-radius: 12px;
  }
  .survey-heading {
    font-size: 24px;
  }
  .survey-option {
    padding: 12px 14px;
    gap: 12px;
  }
  .survey-option-title {
    font-size: 14.5px;
  }
  .survey-option-desc {
    font-size: 12.5px;
  }
  .survey-submit {
    width: 100%;
    padding: 14px 20px;
  }
}

/* ─────────────── COMPLETION PAGE — page dédiée affichée après "Terminer la formation" ─────────────── */
.completion-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.completion-hero {
  text-align: center;
  margin-bottom: 32px;
}

.completion-diploma {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-bottom: 24px;
  background: rgba(139, 115, 64, .1);
  color: var(--gold);
  border-radius: 50%;
}

.completion-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 16px;
}

.completion-sub {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  opacity: .75;
  max-width: 580px;
  margin: 0 auto;
}

/* Slight margin tweak: the survey card already has its own top margin,
   we don't need extra spacing here. */
.completion-page .survey-card {
  margin-top: 8px;
}

/* Bottom actions: download + home, side by side */
.completion-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.completion-dl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  transition: border-color .15s, background .15s;
}

.completion-dl:hover {
  border-color: var(--gold);
  background: rgba(139, 115, 64, .04);
}

.completion-home {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: .7;
  text-decoration: none;
  transition: opacity .15s, color .15s;
}

.completion-home:hover {
  opacity: 1;
  color: var(--gold);
}

@media(max-width:720px) {
  .completion-page {
    padding: 40px 18px 60px;
  }
  .completion-title {
    font-size: 30px;
  }
  .completion-sub {
    font-size: 15px;
  }
  .completion-diploma {
    width: 80px;
    height: 80px;
  }
  .completion-actions {
    flex-direction: column;
    gap: 14px;
  }
  .completion-dl {
    width: 100%;
    justify-content: center;
  }
}
