/* ─────────────────────────────────────────────────────────────────────────────
   Ferme les Biolles · Stages · Style principal
   Esthétique : organique / naturel / ferme
   Polices : Mulish (titres) + Inter (texte)
───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Mulish:ital,wght@0,200..1000;1,200..1000&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --green-900:  #42343a;
  --green-700:  #4d3c41;
  --green-500:  #59444a;
  --green-400:  #3d8b05;
  --green-300:  #52b524;
  --green-100:  #c1f173;
  --green-50:   #cbfaaa;
  --cream:      #9dcb53;
  --cream-dark: #7db029;
  --wheat:      #e9c46a;
  --earth:      #c8a97e;
  --soil:       #8b5e3c;
  --white:      #fcf3eb;
  --text:       #1a1a1a;
  --text-muted: #41444c;
  --border:     #d9d0be;
  --radius:     10px;
  --shadow-sm:  0 2px 8px rgba(10, 36, 22, 0.08);
  --shadow:     0 6px 24px rgba(10, 36, 22, 0.12);
  --shadow-lg:  0 16px 48px rgba(10, 36, 22, 0.16);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--cream);
  min-height: 100vh;
  /* Texture papier subtile */
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(82, 183, 136, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(233, 196, 106, 0.1) 0%, transparent 50%);
}

/* ── Page layout ─────────────────────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--green-700);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
}

.site-header .logo-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.site-header .logo-text {
  display: flex;
  flex-direction: column;
}

.site-header .logo-main {
  font-family: 'Mulish', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.site-header .logo-sub {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

.header-wheat {
  font-size: 1.5rem;
  opacity: 0.4;
}

/* ── Main content ────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page title section ──────────────────────────────────────────────────────── */
.page-title-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-title-section h1 {
  font-family: 'Mulish', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green-700);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.page-title-section p {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Progress indicator ──────────────────────────────────────────────────────── */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
  overflow-x: auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  flex: 1;
  min-width: 40px;
  max-width: 140px;
}

.progress-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.progress-step:last-child::before { display: none; }

.progress-step.completed::before { background: var(--green-300); }

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.progress-step.active   .step-circle { border-color: var(--green-500); background: var(--green-500); color: white; }
.progress-step.completed .step-circle { border-color: var(--green-300); background: var(--green-300); color: white; }
.progress-step.completed .step-circle::after { content: '✓'; }
.progress-step.completed .step-num { display: none; }

.step-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  transition: color var(--transition);
}

.progress-step.active   .step-label { color: var(--green-500); }
.progress-step.completed .step-label { color: var(--green-400); }

/* ── Form card ───────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.5rem;
  border: 1px solid rgba(217, 208, 190, 0.5);
}

/* ── Step sections ───────────────────────────────────────────────────────────── */
.form-step {
  display: none;
  animation: fadeSlide 0.3s ease;
}

.form-step.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--cream-dark);
}

.step-header h2 {
  font-family: 'Mulish', Georgia, serif;
  font-size: 1.5rem;
  color: var(--green-700);
  margin-bottom: 0.4rem;
}

.step-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 300;
}

/* ── Form elements ───────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid.single { grid-template-columns: 1fr; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--green-700);
  letter-spacing: 0.01em;
}

label .required {
  color: #e05c5c;
  margin-left: 2px;
}

label .hint {
  font-weight: 300;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

input.error,
select.error,
textarea.error {
  border-color: #e05c5c;
  box-shadow: 0 0 0 3px rgba(224, 92, 92, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field-error {
  font-size: 0.8rem;
  color: #e05c5c;
  display: none;
}

.field-error.visible { display: block; }

/* ── Checkbox custom ─────────────────────────────────────────────────────────── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--cream);
}

.checkbox-item:hover { border-color: var(--green-300); background: var(--green-50); }
.checkbox-item.checked { border-color: var(--green-400); background: var(--green-50); }

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  appearance: none;
  background: white;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 2px;
}

.checkbox-item input[type="checkbox"]:checked {
  background: var(--green-500);
  border-color: var(--green-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M4 10l4.5 4.5L16 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.checkbox-label {
  font-size: 0.93rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label strong { color: var(--green-700); }

/* ── Alert boxes ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.alert-warning {
  background: #fff9e6;
  border: 1px solid #f0c040;
  color: #7a5c00;
}

.alert-info {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Date range picker ───────────────────────────────────────────────────────── */
.date-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.date-range .arrow {
  text-align: center;
  color: var(--green-400);
  font-size: 1.25rem;
  padding-bottom: 0.75rem;
}

.duration-display {
  text-align: center;
  padding: 0.75rem;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--green-700);
  font-weight: 500;
  transition: all 0.2s;
}

.duration-display.invalid {
  background: #fff0f0;
  border-color: #ffcccc;
  color: #c0392b;
}

/* ── File upload ─────────────────────────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.file-upload-area:hover { border-color: var(--green-300); background: var(--green-50); }
.file-upload-area.has-file { border-color: var(--green-400); background: var(--green-50); }

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.file-upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }
.file-upload-text { font-size: 0.9rem; color: var(--text-muted); }
.file-upload-text strong { color: var(--green-500); }
.file-upload-name { font-weight: 500; color: var(--green-700); margin-top: 0.25rem; }
.file-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }

/* ── Navigation boutons ──────────────────────────────────────────────────────── */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cream-dark);
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--green-500);
  color: white;
}

.btn-primary:hover {
  background: var(--green-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
  background: var(--cream-dark);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-submit {
  background: var(--green-700);
  color: white;
  padding: 0.85rem 2.25rem;
  font-size: 1rem;
}

.btn-submit:hover {
  background: var(--green-900);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10, 36, 22, 0.3);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Success page ────────────────────────────────────────────────────────────── */
.success-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 3rem 1.5rem;
}

.success-icon {
  width: 90px;
  height: 90px;
  background: var(--green-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 1.5rem;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-wrapper h1 {
  font-family: 'Mulish', Georgia, serif;
  font-size: 2rem;
  color: var(--green-700);
  margin-bottom: 1rem;
}

.success-wrapper p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 0.5rem;
  font-size: 1rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.site-footer a { color: var(--green-300); text-decoration: none; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-grid    { grid-template-columns: 1fr; }
  .form-grid .form-group.full { grid-column: 1; }
  .date-range   { grid-template-columns: 1fr; }
  .date-range .arrow { display: none; }
  .form-card    { padding: 1.5rem; }
  .page-title-section h1 { font-size: 1.6rem; }
  .progress-step .step-label { display: none; }
  .site-header  { padding: 1rem; }
}
