/* ── Funecap Candidature – Styles formulaires ──────────────────────────────── */
/* Variables surchargeables depuis le thème ou Elementor */
:root {
  --fca-primary:        #1a1a1a;
  --fca-accent:         #c8a96e;      /* or/bronze Funecap — à adapter */
  --fca-border:         #d8d8d8;
  --fca-bg:             #ffffff;
  --fca-bg-hover:       #f5f5f5;
  --fca-text:           #1a1a1a;
  --fca-text-muted:     #6b6b6b;
  --fca-error:          #c0392b;
  --fca-success:        #27ae60;
  --fca-radius:         6px;
  --fca-gap:            1rem;
  --fca-font:           inherit;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.fca-form-wrapper {
  max-width: 680px;
  font-family: var(--fca-font);
  color: var(--fca-text);
}

/* ── Grille ──────────────────────────────────────────────────────────────── */
.fca-row {
  display: grid;
  gap: var(--fca-gap);
  margin-bottom: var(--fca-gap);
}
.fca-row--2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 560px) {
  .fca-row--2 { grid-template-columns: 1fr; }
}

/* ── Champs texte / email / tel ──────────────────────────────────────────── */
.fca-input,
.fca-select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--fca-border);
  border-radius: var(--fca-radius);
  background: var(--fca-bg);
  color: var(--fca-text);
  font-size: 0.9375rem;
  font-family: var(--fca-font);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.fca-input::placeholder { color: var(--fca-text-muted); }

.fca-input:focus,
.fca-select:focus {
  outline: none;
  border-color: var(--fca-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fca-accent) 20%, transparent);
}

.fca-input.fca-invalid,
.fca-select.fca-invalid {
  border-color: var(--fca-error);
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.fca-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select[multiple].fca-select {
  background-image: none;
  padding-right: 1rem;
  min-height: 120px;
}

.fca-multi-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--fca-text-muted);
  margin-top: 4px;
}

/* Wraps individuels pour select (pour l'espacement) */
.fca-select { margin-bottom: var(--fca-gap); }
.fca-row .fca-select { margin-bottom: 0; }

/* ── Dropzone ────────────────────────────────────────────────────────────── */
.fca-dropzone {
  position: relative;
  border: 2px dashed var(--fca-border);
  border-radius: var(--fca-radius);
  background: var(--fca-bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: var(--fca-gap);
}

.fca-dropzone:hover,
.fca-dropzone.fca-drag-over {
  border-color: var(--fca-accent);
  background: var(--fca-bg-hover);
}

.fca-dropzone.fca-has-file {
  border-color: var(--fca-success);
  border-style: solid;
}

.fca-dropzone.fca-invalid {
  border-color: var(--fca-error);
}

.fca-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.fca-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  gap: 0.35rem;
  pointer-events: none;
  text-align: center;
}

.fca-dropzone-inner svg {
  width: 32px;
  height: 32px;
  color: var(--fca-text-muted);
  flex-shrink: 0;
}

.fca-dropzone.fca-has-file .fca-dropzone-inner svg {
  color: var(--fca-success);
}

.fca-dropzone-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fca-text);
}

.fca-dropzone-hint {
  font-size: 0.8125rem;
  color: var(--fca-text-muted);
}

.fca-dropzone-filename {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fca-success);
}

/* ── Checkbox cooptation ─────────────────────────────────────────────────── */
.fca-checkbox-wrap {
  margin-bottom: var(--fca-gap);
}

.fca-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
}

.fca-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--fca-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.fca-cooptation-fields {
  margin-bottom: var(--fca-gap);
  animation: fca-fade-in 0.2s ease;
}

.fca-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--fca-font);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.fca-cooptation-fields[hidden] { display: none; }

@keyframes fca-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mention légale ──────────────────────────────────────────────────────── */
.fca-legal {
  font-size: 0.8125rem;
  color: var(--fca-text-muted);
  line-height: 1.5;
  margin-bottom: var(--fca-gap);
}

.fca-legal a {
  color: var(--fca-accent);
  text-decoration: underline;
}

.fca-required-note {
  display: block;
  margin-top: 0.25rem;
}

/* ── Bouton submit ───────────────────────────────────────────────────────── */
.fca-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--fca-accent);
  color: #fff;
  border: none;
  border-radius: var(--fca-radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--fca-font);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.fca-btn:hover  { opacity: 0.88; }
.fca-btn:active { transform: scale(0.98); }

.fca-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.fca-spinner {
  width: 18px;
  height: 18px;
  animation: fca-spin 0.8s linear infinite;
}

.fca-spinner circle {
  stroke-dasharray: 40;
  stroke-dashoffset: 10;
}

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

/* ── Messages feedback ───────────────────────────────────────────────────── */
.fca-messages { margin-bottom: var(--fca-gap); }

.fca-msg {
  padding: 0.875rem 1rem;
  border-radius: var(--fca-radius);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.fca-msg--success {
  background: color-mix(in srgb, var(--fca-success) 12%, white);
  border: 1px solid var(--fca-success);
  color: #1a5e36;
}

.fca-msg--error {
  background: color-mix(in srgb, var(--fca-error) 10%, white);
  border: 1px solid var(--fca-error);
  color: #7b1a13;
}

/* ── Etat succès : masquer le formulaire ─────────────────────────────────── */
.fca-form-wrapper.fca-submitted .fca-form {
  display: none;
}

/* ── Questions dynamiques ────────────────────────────────────────────────── */
.fca-questions-container {
  margin-bottom: var(--fca-gap);
}

.fca-questions-loading {
  font-size: 0.875rem;
  color: var(--fca-text-muted);
  margin-bottom: var(--fca-gap);
}

.fca-question-wrap {
  margin-bottom: var(--fca-gap);
}

.fca-question-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fca-text);
  margin-bottom: 0.4rem;
  margin-top: 0;
}
