/* ============================================================
   style.css — Formulaire Place du Lavoir · Autouillet
   Design : Nature & Patrimoine village · RGPD-ready, sans cookie
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --green-dark:  #1a4a3a;
  --green-mid:   #2d7a5e;
  --green-light: #4aaa84;
  --green-pale:  #e8f5f0;
  --stone:       #f5f0e8;
  --stone-dark:  #e2dbd0;
  --text:        #1a2a22;
  --text-soft:   #5a7060;
  --white:       #ffffff;
  --shadow-card: 0 4px 24px rgba(26,74,58,.10);
  --radius:      16px;
  --radius-sm:   10px;
  --transition:  .3s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--stone);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(45,122,94,.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(26,74,58,.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='.7' fill='%232d7a5e' opacity='.07'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-light) 100%);
  padding: 64px 24px 80px; text-align: center; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 60px; background: var(--stone);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25); color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 7px 18px; border-radius: 50px;
  margin-bottom: 20px; animation: fadeInDown .6s both;
}
.hero-badge .dot { width: 7px; height: 7px; background: #7de8b8; border-radius: 50%; animation: pulse 2s infinite; }
.hero h1 {
  font-family: 'Playfair Display', serif; color: #fff;
  font-size: clamp(26px, 5vw, 42px); font-weight: 700;
  line-height: 1.2; margin-bottom: 16px; animation: fadeInDown .7s .1s both;
}
.hero h1 span { display: block; color: #a8e8cc; }
.hero-sub {
  color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.7;
  max-width: 560px; margin: 0 auto; animation: fadeInDown .7s .2s both;
}
.hero-meta {
  display: flex; justify-content: center; gap: 24px;
  margin-top: 28px; flex-wrap: wrap; animation: fadeInDown .7s .3s both;
}
.hero-meta-item {
  display: flex; align-items: center; gap: 7px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 500;
}

/* ── Container ───────────────────────────────────────────── */
.container { position: relative; z-index: 1; max-width: 950px; margin: 0 auto; padding: 0 20px 60px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 36px 40px; box-shadow: var(--shadow-card);
  margin-bottom: 20px; border: 1px solid rgba(45,122,94,.07);
  animation: fadeInUp .6s both;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: 0 10px 36px rgba(26,74,58,.13); transform: translateY(-2px); }
.card:nth-child(2) { animation-delay: .1s; }
.card:nth-child(3) { animation-delay: .2s; }
.card:nth-child(4) { animation-delay: .3s; }
.card:nth-child(5) { animation-delay: .4s; }
.card-icon {
  width: 44px; height: 44px; background: var(--green-pale);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; margin-bottom: 20px;
}
.card-title { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--green-dark); margin-bottom: 4px; }
.card-desc  { font-size: 13px; color: var(--text-soft); margin-bottom: 24px; line-height: 1.6; }

/* ── RGPD card ───────────────────────────────────────────── */
.rgpd-global-card { border-color: rgba(45,74,122,.14); background: #fafbff; }
.rgpd-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.rgpd-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: #f2f5fb; border-radius: 8px; padding: 14px 16px;
}
.rgpd-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.rgpd-item strong { font-size: 13px; color: #1a2a4a; display: block; margin-bottom: 3px; }
.rgpd-item p  { font-size: 12px; color: #5a6a7a; line-height: 1.55; margin: 0; }
.rgpd-item a  { color: #2d4a7a; }

/* ── Consentement checkbox RGPD ──────────────────────────── */
.rgpd-consent-box {
  background: #eef3fc; border: 1.5px solid #b8ccee; border-radius: var(--radius-sm);
  padding: 18px 20px; margin-top: 16px;
  transition: background var(--transition), border-color var(--transition);
  animation: fadeInUp .4s both;
}
.rgpd-checkbox-label { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; user-select: none; }
.rgpd-checkbox-label input[type="checkbox"] { display: none; }
.rgpd-checkmark {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid #90a8c8; border-radius: 6px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.rgpd-checkbox-label input[type="checkbox"]:checked ~ .rgpd-checkmark {
  background: #2d4a7a; border-color: #2d4a7a;
}
.rgpd-checkbox-label input[type="checkbox"]:checked ~ .rgpd-checkmark::after {
  content: '';
  display: block; width: 5px; height: 9px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(1px,-1px);
}
.rgpd-text  { font-size: 13px; color: #2a3a5a; line-height: 1.6; }
.rgpd-text strong { color: #1a2a4a; }
.rgpd-text a { color: #2d4a7a; }
.rgpd-law-ref {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 11px; color: #7a8aaa; line-height: 1.5;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #c8d8ee;
}
.rgpd-law-ref a { color: #2d4a7a; }

/* ── Form elements ───────────────────────────────────────── */
.form-group { margin-bottom: 22px; }
.form-group:last-child { margin-bottom: 0; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--green-dark); margin-bottom: 8px; }
label .required { color: var(--green-light); margin-left: 3px; }
label .optional { font-size: 12px; font-weight: 400; color: var(--text-soft); margin-left: 5px; }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; padding: 13px 16px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text);
  background: var(--stone); border: 2px solid var(--stone-dark);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
input:focus, textarea:focus {
  border-color: var(--green-mid); background: var(--white);
  box-shadow: 0 0 0 4px rgba(45,122,94,.12);
}
input::placeholder, textarea::placeholder { color: #aab5b0; }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Radio custom ────────────────────────────────────────── */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-btn { flex: 1; min-width: 120px; }
.radio-btn input[type="radio"] { display: none; }
.radio-btn label {
  display: flex; align-items: center; height: 100%; justify-content: center; gap: 8px;
  padding: 13px 20px; background: var(--stone); border: 2px solid var(--stone-dark);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
  font-weight: 500; color: var(--text-soft); transition: all var(--transition);
  text-align: center; user-select: none;
}
.radio-btn input[type="radio"]:checked + label {
  background: var(--green-pale); border-color: var(--green-mid);
  color: var(--green-dark); font-weight: 600;
  box-shadow: 0 2px 8px rgba(45,122,94,.15);
}
.radio-btn label:hover { border-color: var(--green-light); color: var(--green-dark); }
.radio-btn label .emoji { font-size: 18px; }

/* ── Char counter ────────────────────────────────────────── */
.textarea-wrap { position: relative; }
.char-count { position: absolute; bottom: 10px; right: 12px; font-size: 11px; color: #aab5b0; pointer-events: none; }

/* ── Progress bar ────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--stone-dark); border-radius: 50px;
  height: 6px; margin-bottom: 36px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green-light));
  border-radius: 50px; transition: width .5s cubic-bezier(.4,0,.2,1); width: 0%;
}

/* ── Submit ──────────────────────────────────────────────── */
.btn-submit {
  width: 100%; padding: 17px 32px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: #fff; font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  overflow: hidden; position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-submit::before {
  content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  background: rgba(255,255,255,.15); border-radius: 50%;
  transform: translate(-50%,-50%); transition: width .6s, height .6s;
}
.btn-submit:hover::before { width: 600px; height: 600px; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,74,58,.35); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  background: linear-gradient(135deg,#fff8e8,#fff3d0); border: 1px solid #e8d59a;
  border-radius: var(--radius-sm); padding: 16px 20px; font-size: 13px;
  color: #7a6020; line-height: 1.6; display: flex; gap: 12px; align-items: flex-start;
}
.notice .notice-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ── Errors ──────────────────────────────────────────────── */
.input-error { border-color: #d64040 !important; background: #fff8f8 !important; }

/* ── Footer ──────────────────────────────────────────────── */
.form-footer { text-align: center; margin-top: 12px; font-size: 12px; color: var(--text-soft); line-height: 1.7; }
.form-footer a { color: var(--green-mid); text-decoration: none; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInDown { from { opacity:0; transform:translateY(-20px);} to { opacity:1; transform:translateY(0);} }
@keyframes fadeInUp   { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0);} }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.4);opacity:.6;} }
@keyframes spin  { to { transform:rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 24px 20px; }
  .row-2 { grid-template-columns: 1fr; padding-bottom: 30px; gap: 0px;}
  .hero { padding: 44px 16px 70px; }
  .hero-meta { flex-direction: column; align-items: center; gap: 10px; }
}


.input-error {
  border: 2px solid #e74c3c !important;
  background: #fff5f5;
}

.radio-error {
  outline: 2px solid #e74c3c;
  border-radius: 10px;
  padding: 8px;
}

.checkbox-error {
  outline: 2px solid #e74c3c;
  border-radius: 10px;
  padding: 10px;
}

.error-text {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
}