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

/* ═══════════════════════════════════════════════════════════════
   MOONFORM - Fine (investment simulator)
   Brand: ink #191919 on white, soft pastel tints, 10px radii,
   Abhaya Libre serif headlines + Neutrall sans UI.
   ═══════════════════════════════════════════════════════════════ */

@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;
}

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

/* ═══ THEME ═════════════════════════════════════════════════════ */
  .moonform {
    --ink: #191919;
    --ink-soft: #3a3a3a;
    --white: #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-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 + HEADER ════════════════════════════════════════ */
  .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; }
  .moonform .form-header { padding: 18px 30px 16px; border-bottom: 1px solid var(--border); }
  .moonform .header-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--ink); }
  .moonform .brand-logo { height: 22px; width: auto; color: var(--ink); display: block; }
  .moonform .brand-tag { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 10px; }
  .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 .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-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); }

/* ═══ CHOICE CARDS (router) ═════════════════════════════════════ */
  .moonform .choices { display: flex; flex-direction: column; 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: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; }

/* ═══ SIMULATOR - INPUT PANELS ══════════════════════════════════ */
  .moonform .sim-panel { display: none; }
  .moonform .sim-panel.active { display: block; }
  .moonform .sim-field { margin-bottom: 20px; }
  .moonform .sim-field-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
  .moonform .sim-field-top label { font-size: 13.5px; color: var(--text); font-weight: 400; }
  .moonform .sim-val { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); white-space: nowrap; }
  .moonform .sim-pill-label { font-size: 13.5px; color: var(--text); display: block; margin-bottom: 10px; }

  /* range slider */
  .moonform .sim-range {
    -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
    border-radius: 99px; background: var(--border); outline: none; cursor: pointer;
  }
  .moonform .sim-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(25,25,25,0.35); cursor: pointer;
    transition: transform var(--transition);
  }
  .moonform .sim-range::-webkit-slider-thumb:hover { transform: scale(1.12); }
  .moonform .sim-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(25,25,25,0.35); cursor: pointer; }

  /* pills (TMI / profil) */
  .moonform .sim-pills { display: flex; gap: 8px; flex-wrap: wrap; }
  .moonform .sim-pill {
    flex: 1; min-width: 64px; padding: 11px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--white); font-family: var(--sans); font-size: 14px; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition); text-align: center;
  }
  .moonform .sim-pill:hover { border-color: var(--border-strong); color: var(--text); }
  .moonform .sim-pill.selected { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ═══ INPUTS (contact) ══════════════════════════════════════════ */
  .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-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; }
  .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; }
  .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: 22px; 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: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
  .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; }
  .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); } }
  .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%; }

/* ═══ RESULT ════════════════════════════════════════════════════ */
  .moonform #step-result { padding-top: 4px; }
  .moonform .sim-result-head { text-align: center; padding: 8px 0 18px; }
  .moonform .sim-result-label { display: block; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
  .moonform .sim-result-figure { font-family: var(--serif); font-size: 46px; font-weight: 600; color: var(--ink); line-height: 1; letter-spacing: -0.5px; }

  /* comparison bars */
  .moonform .sim-bars { background: var(--tint-sel); border-radius: var(--radius); padding: 18px 18px 14px; margin-bottom: 18px; }
  .moonform .sim-bar-row { margin-bottom: 14px; }
  .moonform .sim-bar-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
  .moonform .sim-bar-track { background: #e3e3df; border-radius: 99px; height: 30px; overflow: hidden; }
  .moonform .sim-bar-fill { height: 100%; border-radius: 99px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; font-size: 13px; font-weight: 400; white-space: nowrap; min-width: 64px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
  .moonform .sim-bar-fill.fine { background: var(--ink); color: #fff; }
  .moonform .sim-bar-fill.base { background: #c9c9c2; color: var(--ink); }
  .moonform .sim-ecart { text-align: center; font-size: 13.5px; color: var(--text); padding-top: 4px; }
  .moonform .sim-ecart strong { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink); margin-left: 4px; }

  /* chart */
  .moonform .sim-chart-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 12px; margin-bottom: 18px; }
  .moonform .sim-chart-title { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
  .moonform .sim-chart svg { display: block; width: 100%; height: auto; }
  .moonform .sim-chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
  .moonform .sim-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
  .moonform .sim-legend-swatch { width: 14px; height: 3px; border-radius: 2px; }

  /* chips */
  .moonform .sim-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
  .moonform .sim-chip { flex: 1; min-width: 130px; background: var(--cream); border-radius: var(--radius-sm); padding: 11px 13px; }
  .moonform .sim-chip-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; line-height: 1.3; }
  .moonform .sim-chip-value { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }

  .moonform .sim-disclaimer { font-size: 10.5px; color: #9a9a9a; line-height: 1.5; margin-bottom: 16px; }
  .moonform .sim-cta-row { display: flex; justify-content: center; }
  .moonform .sim-cta-row .btn-submit { width: 100%; justify-content: center; padding: 14px; }
  .moonform .sim-emailed { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; }
  .moonform .cal-inline-mount { width: 100%; min-height: 580px; margin-top: 16px; overflow: auto; -webkit-overflow-scrolling: touch; }
  @media (max-width: 599px) { .moonform .cal-inline-mount { min-height: 70vh; } }

/* ═══ MOBILE - app-like full-screen (form-as-hero) ══════════════ */
/* Mirrors the live wikiehpad_flow_v2: the form fills the viewport
   (100dvh), sticky header, body is the scroll container, each step
   centers when it fits / scrolls from the top when it overflows.
   Paired with scrollToFormTopOnMobile() in form.js. */
  @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 .input-field { font-size: 16px; }
    .moonform .sim-result-figure { font-size: 38px; }
    .moonform .sim-chip { min-width: calc(50% - 4px); }
    .moonform .form-nav .btn-next, .moonform .form-nav .btn-submit { flex: 1; justify-content: center; }
  }
