/* =========================================================================
   NOVA · Composants réutilisables
   Boutons, panneaux, listes, étiquettes, formulaire, accordéon, curseur.
   ========================================================================= */

/* --- Boutons ------------------------------------------------------------ */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 48px;
  padding: .95rem 1.5rem;
  border: 1px solid rgb(140 190 255 / .35);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  color: white;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgb(49 87 213 / .35);
  /* "scale" (propriété séparée) se combine avec l'effet magnétique piloté par le script */
  transition: scale var(--dur-fast) var(--ease-out), box-shadow 300ms ease, background-color 300ms ease, border-color 300ms ease;
}

.button:active { scale: .97; }

.button-ghost {
  background: rgb(255 255 255 / .04);
  border-color: var(--line-strong);
  box-shadow: none;
}

.button-small { min-height: 42px; padding: .6rem 1.1rem; font-size: .92rem; }

.icon-arrow {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-base) var(--ease-out);
}

/* --- Panneaux (verre dépoli) -------------------------------------------- */
.panel,
.plan,
.contact-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  isolation: isolate;
}

/* Lueur qui suit la souris (attribut data-glow) */
[data-glow] { --mx: 50%; --my: 50%; overflow: hidden; }

[data-glow]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgb(85 199 255 / .16), transparent 60%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

/* --- Listes et étiquettes ----------------------------------------------- */
.checklist {
  display: grid;
  gap: .55rem;
  list-style: none;
  padding: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: .9rem;
  height: .5rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  background: rgb(255 255 255 / .04);
}

.tag-accent { border-color: transparent; background: var(--accent); color: var(--bg); }

/* --- Formulaire --------------------------------------------------------- */
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.field { display: grid; gap: .5rem; min-width: 0; }
.field-full, .form-actions { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field label span { color: var(--accent); }

input, textarea, select {
  width: 100%;
  min-height: 48px;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgb(255 255 255 / .04);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, background-color var(--dur-base) ease;
}

select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: calc(100% - 1.25rem) 55%, calc(100% - .9rem) 55%;
  background-size: .38rem .38rem;
  background-repeat: no-repeat;
}

select option { background: var(--bg-2); color: var(--text); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: rgb(85 199 255 / .06);
  box-shadow: 0 0 0 4px rgb(85 199 255 / .14);
}

textarea { resize: vertical; min-height: 8rem; }

[aria-invalid="true"] { border-color: var(--error); }

.field-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: .8rem;
}

.field-check input {
  width: 1.3rem;
  min-height: 0;
  height: 1.3rem;
  margin-top: .15rem;
  padding: 0;
  accent-color: var(--primary-bright);
}

.field-check label {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  letter-spacing: 0;
  text-transform: none;
}

.field-error {
  font-size: .85rem;
  color: var(--error);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.form-note { flex: 1 1 16rem; font-size: var(--fs-small); color: var(--muted); }
.form-note[data-tone="error"] { color: var(--error); }
.form-note[data-tone="success"] { color: var(--success); }

.shake { animation: shake 320ms var(--ease-out); }

/* Bouton d'envoi à trois états superposés */
.submit { display: inline-grid; }

.submit-layer {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.submit[data-state="idle"] [data-for="idle"],
.submit[data-state="sending"] [data-for="sending"],
.submit[data-state="done"] [data-for="done"] { opacity: 1; transform: none; }

.submit[data-state="done"] { background: var(--success); border-color: transparent; }
.submit[data-state="sending"] { cursor: progress; }

.spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .35);
  border-top-color: white;
  animation: spin 700ms linear infinite;
}

.check {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 350ms var(--ease-out) 120ms;
}

.submit[data-state="done"] .check { stroke-dashoffset: 0; }

/* --- Accordéon (FAQ) ---------------------------------------------------- */
.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 1.1rem 3rem 1.1rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before,
.faq-item summary::after {
  content: "";
  position: absolute;
  right: .5rem;
  top: 50%;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 300ms var(--ease-out);
}

.faq-item summary::after { transform: rotate(90deg); }
.faq-item[open] summary::after { transform: rotate(0deg); }

.faq-answer { overflow: hidden; }
.faq-answer p { padding-bottom: 1.4rem; max-width: 62ch; color: var(--muted); }

/* --- Curseur personnalisé ----------------------------------------------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor summary, .has-cursor label { cursor: none; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  border-radius: 50%;
  pointer-events: none;
}

.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: white; }
.cursor-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; }

.cursor-ring span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgb(200 230 255 / .55);
  transition: transform 300ms var(--ease-out), background-color 300ms ease, border-color 300ms ease, opacity 200ms ease;
}

.cursor.is-hover .cursor-ring span { transform: scale(1.7); background: rgb(85 199 255 / .12); border-color: var(--accent); }
.cursor.is-text .cursor-ring span { opacity: 0; }
.cursor.is-hidden { opacity: 0; }

/* --- Maquette de navigateur (réalisations) ------------------------------ */
.mockup {
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--p-bg);
  box-shadow: 0 30px 60px rgb(0 0 0 / .35);
}

.mockup-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgb(0 0 0 / .18);
}

.mockup-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--p-ink); opacity: .3; }

.mockup-screen {
  display: grid;
  gap: 10px;
  aspect-ratio: 16 / 10.5;
  padding: 16px 18px 20px;
  align-content: start;
}

.mockup-screen i, .mockup-screen div { display: block; }
.m-nav { display: flex !important; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.m-nav i { width: 26px; height: 5px; border-radius: 3px; background: var(--p-ink); opacity: .35; }
.m-title { height: 14px; width: 72%; border-radius: 4px; background: var(--p-ink); }
.m-title.short { width: 46%; opacity: .55; }
.m-title.big { height: 22px; width: 80%; }
.m-text { height: 6px; width: 90%; border-radius: 3px; background: var(--p-ink); opacity: .3; margin-top: 8px; }
.m-btn { height: 18px; width: 30%; border-radius: 9px; background: var(--p-accent); margin-top: 8px; }
.m-btn.wide { width: 42%; height: 22px; border-radius: 11px; }
.m-row { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.m-img { aspect-ratio: 4 / 3; border-radius: 6px; background: linear-gradient(135deg, var(--p-accent), color-mix(in srgb, var(--p-accent) 40%, var(--p-bg))); opacity: .85; }
.m-img.tall { aspect-ratio: auto; height: 100%; min-height: 110px; }
.m-split { display: grid !important; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.m-stat { height: 34px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--p-ink) 25%, transparent); }

/* --- Animations de base ------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
