/* Formulaire d'inscription en modale — partagé par les propositions.
   Chaque page le thème via les variables --sheet-*. */

.sheet {
  --sheet-bg: #fff;
  --sheet-ink: #14171f;
  --sheet-muted: #4d5568;
  --sheet-line: #c2c8d5;
  --sheet-field: #f7f8fa;
  --sheet-focus: #4f4996;
  --sheet-error: #c62839;
  --sheet-btn: linear-gradient(90deg, #4f4996 0%, #c92d7c 100%);

  width: min(100%, 480px);
  max-height: min(92dvh, 760px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--sheet-bg);
  color: var(--sheet-muted);
  box-shadow: 0 40px 80px -20px rgb(0 0 0 / .45);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .28s cubic-bezier(.2, .9, .3, 1); }
.sheet::backdrop { background: rgb(8 9 14 / .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

.sheet__head { position: relative; padding: 24px 24px 4px; }
.sheet__grip { display: none; }
.sheet__title { margin: 0; padding-right: 44px; font: 600 1.45rem/1.2 "Poppins", system-ui, sans-serif; color: var(--sheet-ink); letter-spacing: -0.02em; }
.sheet__recap { margin: 8px 0 0; font-size: .88rem; }
.sheet__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--sheet-field); color: var(--sheet-ink);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.sheet__body { padding: 16px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }

.sheet .field { margin-bottom: 12px; }
.sheet label { display: block; margin-bottom: 5px; font: 500 .85rem/1.3 "Inter", system-ui, sans-serif; color: var(--sheet-ink); }
.sheet input[type="text"], .sheet input[type="tel"], .sheet input[type="email"] {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--sheet-line); border-radius: 12px;
  background: var(--sheet-field); color: var(--sheet-ink);
  font: 400 16px/1.3 "Inter", system-ui, sans-serif; /* 16px : évite le zoom auto sur iOS */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sheet input::placeholder { color: color-mix(in srgb, var(--sheet-muted) 60%, transparent); }
.sheet input:focus { outline: 0; border-color: var(--sheet-focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sheet-focus) 22%, transparent); }
.sheet .is-invalid input { border-color: var(--sheet-error); }
.sheet .field__error { margin: 0; font-size: .78rem; color: var(--sheet-error); }
.sheet .field__error:not(:empty) { margin-top: 4px; }
.sheet .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sheet .field--check { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin: 4px 0 16px; }
.sheet .field--check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sheet-focus); }
.sheet .field--check label { margin: 0; font-size: .76rem; line-height: 1.45; font-weight: 400; color: var(--sheet-muted); }
.sheet .field--check a { color: inherit; }
.sheet .field--check .field__error { grid-column: 2; }
.sheet .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sheet__submit {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px; border: 0; border-radius: 14px;
  background: var(--sheet-btn); color: #fff;
  font: 600 1.05rem/1.2 "Poppins", system-ui, sans-serif; cursor: pointer;
}
.sheet__submit[disabled] { opacity: .8; cursor: progress; }
.sheet__spinner { display: none; width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .sheet__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet__status { margin: 10px 0 0; font-size: .85rem; text-align: center; color: var(--sheet-error); }
.sheet__status:empty { display: none; }
.sheet__note { margin: 10px 0 0; font-size: .75rem; text-align: center; }

/* Mobile : feuille qui monte du bas */
@media (max-width: 600px) {
  .sheet {
    width: 100%; max-width: none; max-height: 94dvh;
    margin: auto 0 0; border-radius: 22px 22px 0 0;
  }
  .sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1); }
  .sheet__grip { display: block; width: 40px; height: 4px; margin: -12px auto 14px; border-radius: 4px; background: var(--sheet-line); }
  .sheet__head { padding: 22px 20px 0; }
  .sheet__body { padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); }
  .sheet .field-row { grid-template-columns: 1fr; gap: 0; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

html.sheet-lock, html.sheet-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sheet[open], .sheet::backdrop { animation: none; }
}
