@import url('https://fonts.googleapis.com/css2?family=Abhaya+Libre:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   MOONFORM - Fine (lead generation)
   Brand: ink #191919 on white, soft pastel tints, 10px radii,
   Abhaya Libre serif headlines + Neutrall sans UI.
   All rules scoped under .moonform.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Neutrall';
  src: url('https://cdn.prod.website-files.com/67eaa2ceb9c22ddf8ccfe64d/68276e12dbb31119d6683ffe_NeutralL-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Neutrall';
  src: url('https://cdn.prod.website-files.com/67eaa2ceb9c22ddf8ccfe64d/68276e1231061b2f0c21f560_NeutralL-RegularItalic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}

  .moonform *, .moonform *::before, .moonform *::after { box-sizing: border-box; margin: 0; padding: 0; line-height: 1; }
  .moonform button, .moonform input, .moonform .autocomplete-item { touch-action: manipulation; }

/* ═══ THEME ═════════════════════════════════════════════════════ */
  .moonform {
    --ink: #191919;
    --ink-soft: #3a3a3a;
    --white: #ffffff;
    --bg: #ffffff;
    --blue: #eef7fd;
    --green: #ebf9f1;
    --cream: #fff6e5;
    --tint-sel: #f6f6f3;
    --text: #191919;
    --text-muted: #6b6b6b;
    --border: #e7e7e7;
    --border-strong: #cfcfcf;
    --error: #b3261e;
    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(25,25,25,0.08);
    --shadow-lg: 0 2px 4px rgba(25,25,25,0.04), 0 14px 50px rgba(25,25,25,0.10);
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
    --serif: 'Abhaya Libre', Georgia, 'Times New Roman', serif;
    --sans: 'Neutrall', Arial, sans-serif;
    font-family: var(--sans);
    color: var(--text);
  }

/* ═══ CONTAINER ═════════════════════════════════════════════════ */
  .moonform .form-wrapper { width: 100%; position: relative; }
  .moonform .form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }

/* ═══ HEADER ════════════════════════════════════════════════════ */
  .moonform .form-header { padding: 18px 30px 16px; border-bottom: 1px solid var(--border); }
  .moonform .header-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--ink); }
  .moonform .brand-logo { height: 22px; width: auto; color: var(--ink); display: block; }
  .moonform .header-label { display: none; }
  .moonform .header-title {
    font-family: var(--serif); font-size: 26px; font-weight: 500;
    color: var(--ink); line-height: 1.18; letter-spacing: -0.2px;
  }
  .moonform .progress-bar-wrap { background: var(--border); border-radius: 99px; height: 3px; margin-top: 16px; }
  .moonform .progress-bar-fill { height: 100%; border-radius: 99px; background: var(--ink); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); width: 0%; }
  .moonform .progress-label { display: none; }

/* ═══ BODY ══════════════════════════════════════════════════════ */
  .moonform .form-body { padding: 22px 30px 24px; }

/* ═══ STEPS ═════════════════════════════════════════════════════ */
  .moonform .step { display: none; animation: moonformFade 0.32s ease forwards; }
  .moonform .step.active { display: block; }
  @keyframes moonformFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  .moonform .step-question { display: none; }
  .moonform .step-hint { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
  .moonform .step-hint strong { color: var(--text); font-weight: 400; border-bottom: 1.5px solid var(--cream); }
  .moonform .field-block { margin-bottom: 18px; }
  .moonform .label-optional { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ═══ CHOICE CARDS ══════════════════════════════════════════════ */
  .moonform .choices { display: flex; flex-direction: column; gap: 8px; }
  .moonform .choices-inline { flex-direction: row; }
  .moonform .choices-inline .choice-card { flex: 1; justify-content: center; text-align: center; }
  .moonform .choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  .moonform .choice-card {
    display: flex; align-items: center; gap: 13px; padding: 13px 15px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all var(--transition);
    background: var(--white); text-align: left; width: 100%; font-family: var(--sans); color: var(--text);
  }
  .moonform .choice-card.compact { padding: 14px 16px; }
  .moonform .choice-card:hover { border-color: var(--border-strong); background: #fafafa; }
  .moonform .choice-card.selected { border-color: var(--ink); background: var(--tint-sel); box-shadow: 0 0 0 1px var(--ink); }

  .moonform .choice-icon { flex-shrink: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: color var(--transition); }
  .moonform .choice-card:hover .choice-icon, .moonform .choice-card.selected .choice-icon { color: var(--ink); }

  .moonform .choice-text { flex: 1; }
  .moonform .choice-label { font-size: 15px; font-weight: 400; color: var(--text); display: block; line-height: 1.25; }
  .moonform .choice-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; display: block; line-height: 1.3; }

  .moonform .choice-check {
    width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); color: transparent;
  }
  .moonform .choice-card.selected .choice-check { background: var(--ink); border-color: var(--ink); color: #fff; }

  /* inline (horizon / creneau) - center label+desc, hide check */
  .moonform .choices-inline .choice-card { flex-direction: column; gap: 3px; padding: 12px 8px; }
  .moonform .choices-inline .choice-check, .moonform .choices-inline .choice-icon { display: none; }
  .moonform .choices-inline .choice-desc { margin-top: 2px; }
  .moonform .choices-inline.soft .choice-card { padding: 10px 8px; }

  /* grid (situation) - check pinned top-right */
  .moonform .choices-grid .choice-card { padding: 13px 12px; }
  .moonform .choices-grid .choice-check { width: 17px; height: 17px; }

/* ═══ INPUTS ════════════════════════════════════════════════════ */
  .moonform .input-group { margin-bottom: 10px; }
  .moonform .input-label {
    font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--text-muted);
    letter-spacing: 0.6px; text-transform: uppercase; display: block; margin-bottom: 7px;
  }
  .moonform .input-field {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-family: var(--sans);
    font-size: 15px; color: var(--text); background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none; -webkit-appearance: none;
  }
  .moonform .input-field:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25,25,25,0.08); }
  .moonform .input-field::placeholder { color: #b6b6b6; }
  .moonform .input-field.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(179,38,30,0.10); }
  .moonform .input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  @media (max-width: 440px) { .moonform .input-row { grid-template-columns: 1fr; } }
  .moonform .error-msg { font-size: 11px; color: var(--error); margin-top: 5px; display: none; }
  .moonform .error-msg.visible { display: block; }

/* ═══ CONSENT ═══════════════════════════════════════════════════ */
  .moonform .consent-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 12px; color: var(--text-muted); line-height: 1.45; cursor: pointer; }
  .moonform .consent-row input { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; accent-color: var(--ink); cursor: pointer; }
  .moonform .consent-row a { color: var(--ink); text-decoration: underline; }

/* ═══ CONFIDENTIALITY ═══════════════════════════════════════════ */
  .moonform .confidentiality-note {
    display: flex; align-items: flex-start; gap: 8px; background: var(--blue);
    border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 16px;
    font-size: 12px; color: var(--ink-soft); line-height: 1.45;
  }
  .moonform .confidentiality-note svg { flex-shrink: 0; margin-top: 1px; color: var(--ink); }

/* ═══ NAVIGATION ════════════════════════════════════════════════ */
  .moonform .form-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); gap: 12px; }
  .moonform .btn-back { font-family: var(--sans); font-size: 13px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 8px 4px; display: flex; align-items: center; gap: 6px; transition: color var(--transition); flex-shrink: 0; }
  .moonform .btn-back:hover { color: var(--text); }
  .moonform .btn-back:hover svg { transform: translateX(-3px); }
  .moonform .btn-back svg { transition: transform var(--transition); }

  .moonform .btn-next, .moonform .btn-submit {
    font-family: var(--sans); font-size: 14px; font-weight: 400;
    color: #fff; background: var(--ink); border: none; border-radius: var(--radius-sm);
    padding: 12px 26px; cursor: pointer; transition: all var(--transition);
    display: flex; align-items: center; gap: 8px;
  }
  .moonform .btn-next:hover, .moonform .btn-submit:hover { background: #000; }
  .moonform .btn-next:hover:not(:disabled) svg, .moonform .btn-submit:hover:not(:disabled) svg { transform: translateX(3px); }
  .moonform .btn-next svg, .moonform .btn-submit svg { transition: transform var(--transition); }
  .moonform .btn-next:disabled, .moonform .btn-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══ THANK YOU ═════════════════════════════════════════════════ */
  .moonform #step-thankyou { text-align: center; padding: 24px 0 12px; }
  .moonform .ty-icon { width: 60px; height: 60px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--ink); }
  .moonform .ty-title { font-family: var(--serif); font-size: 25px; font-weight: 500; color: var(--ink); margin-bottom: 10px; letter-spacing: -0.2px; }
  .moonform .ty-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 380px; margin: 0 auto 20px; }
  .moonform .ty-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; text-decoration: none; font-family: var(--sans); font-size: 14px; padding: 12px 24px; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); }

  /* Cal.com inline calendar mount (booking step) */
  .moonform .cal-inline-mount { width: 100%; min-height: 580px; overflow: auto; -webkit-overflow-scrolling: touch; }
  @media (max-width: 599px) { .moonform .cal-inline-mount { min-height: 70vh; } }
  .moonform .ty-cta:hover { background: #000; }
  .moonform .ty-cta:hover svg { transform: translateX(3px); }
  .moonform .ty-cta svg { transition: transform var(--transition); }

/* ═══ SPINNER ═══════════════════════════════════════════════════ */
  .moonform .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: moonformSpin 0.7s linear infinite; }
  @keyframes moonformSpin { to { transform: rotate(360deg); } }

/* ═══ TEST BTN ══════════════════════════════════════════════════ */
  .moonform .btn-test { display: none; margin-top: 10px; padding: 5px 12px; font-size: 11px; font-family: monospace; background: #f5f5f5; border: 1px dashed #aaa; border-radius: 6px; color: #888; cursor: pointer; width: 100%; }

/* ═══ MOBILE - app-like full-screen (form-as-hero) ══════════════ */
/* Mirrors the live wikiehpad_flow_v2 behaviour: on a phone the form
   fills the viewport (100dvh), the header is sticky, the body is the
   scroll container, and each step is vertically centered when it fits
   (margin-block:auto) / scrolls from the top when it overflows. Paired
   with scrollToFormTopOnMobile() in form.js. Desktop is unchanged. */
  @media (max-width: 599px) {
    .moonform .form-wrapper { height: 100%; }
    .moonform .form-card {
      min-height: 100dvh; min-height: 100vh;
      display: flex; flex-direction: column;
      border-radius: 0; border-left: none; border-right: none; box-shadow: none;
    }
    .moonform .form-header {
      position: sticky; top: 0; z-index: 5; background: var(--white);
      padding: 14px 20px 12px;
      padding-top: calc(14px + env(safe-area-inset-top));
    }
    .moonform .header-title { font-size: 21px; }
    .moonform .form-body {
      flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
      display: flex; flex-direction: column;
      padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    }
    .moonform .step.active { margin-block: auto; }
    .moonform .choices-grid { grid-template-columns: 1fr; }
    .moonform .choice-label { font-size: 14px; }
    .moonform .input-field { font-size: 16px; }
    /* full-width stacked CTA at the foot of the step */
    .moonform .form-nav { gap: 14px; }
    .moonform .form-nav .btn-next, .moonform .form-nav .btn-submit { flex: 1; justify-content: center; }
  }
