/* =============================================================================
   styles.css — L'Esquisse / Gendron & Fils
   Refonte visuelle : alignement sur le vocabulaire visuel de gendronfils.ca.
   Archivo + IBM Plex, palette bone/charcoal/rouge, ombres dures, coins carres,
   labels en mono. Calque sur la refonte de la jumelle (Le Coup d'Oeil, dette #7).
   Convention de section : SECTION <nom> ... FIN SECTION <nom>, en commentaires.
   ============================================================================= */

/* === SECTION base === */
:root {
  /* Marque (miroir de gendronfils.ca) */
  --bone:       #EFE6D2;
  --bone-soft:  #F5EEDD;
  --bone-deep:  #E5DBC3;
  --encre:      #1A1A1A;
  --ink-mute:   #4A4640;
  --ink-soft:   #807972;
  --rouge:      #B72A1F;
  --rouge-deep: #951F18;
  --ochre:      #D4A017;
  --rule:       #B5AB8E;
  --rule-soft:  #D4C9AC;
  --surface:    #FBF7EE;

  --ff-display: 'Archivo', sans-serif;
  --ff-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-mono:    'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* Alias hérités (compat avec l'existant) */
  --beige: var(--bone-soft);
  --brun:  var(--ink-mute);
  --gris:  var(--ink-soft);
  --creme: var(--bone);
  --noir:  var(--encre);
  --blanc: var(--surface);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  background: var(--bone);
  color: var(--encre);
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
}

a {
  color: var(--rouge);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}
/* === FIN SECTION base === */

/* === SECTION esquisse-form === */

/* ---- Page wrapper ---- */
.esq-page {
  min-height: 100vh;
  background: var(--bone);
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.esq-header {
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--encre);
  background: var(--bone-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.esq-logo {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--encre);
  font-weight: 500;
  text-decoration: none;
}

.esq-logo:hover {
  text-decoration: none;
  color: var(--rouge);
}

.esq-progress-wrap {
  flex: 1;
  margin: 0 2rem;
  max-width: 280px;
}

.esq-progress {
  height: 6px;
  background: var(--bone-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.esq-progress-fill {
  height: 100%;
  background: var(--rouge);
  transition: width 0.4s ease;
  width: 0%;
}

/* ---- Main area ---- */
.esq-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.25rem 5rem;
}

/* ---- Step containers ---- */
.esq-step {
  display: none;
  width: 100%;
  max-width: 600px;
  animation: esqFadeIn 0.22s ease;
}

.esq-step.active {
  display: block;
}

@keyframes esqFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Step typography ---- */
.esq-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--rouge);
  margin-bottom: 0.6rem;
}

.esq-title {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--encre);
  line-height: 1.15;
  margin-bottom: 0.55rem;
}

.esq-subtitle {
  color: var(--ink-mute);
  font-size: 0.97rem;
  margin-bottom: 2rem;
  max-width: 46ch;
}

/* ---- Entry cards (choix initial) ---- */
.esq-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.esq-entry-card {
  background: var(--surface);
  border: 1.5px solid var(--encre);
  box-shadow: 4px 4px 0 var(--encre);
  padding: 1.6rem 1.25rem 1.4rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  user-select: none;
}

.esq-entry-card:hover {
  background: var(--bone-soft);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--encre);
}

.esq-entry-icon {
  font-size: 2rem;
  margin-bottom: 0.65rem;
}

.esq-entry-label {
  font-family: var(--ff-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--encre);
  margin-bottom: 0.3rem;
}

.esq-entry-desc {
  font-size: 0.81rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---- Inputs ---- */
.esq-field {
  margin-bottom: 1.35rem;
}

.esq-label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-mute);
  margin-bottom: 0.45rem;
}

.esq-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--rule);
  font-size: 1rem;
  font-family: var(--ff-body);
  color: var(--encre);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.esq-input:focus {
  border-color: var(--encre);
  box-shadow: 3px 3px 0 var(--rouge);
}

.esq-input::placeholder {
  color: var(--ink-soft);
}

.esq-input-hint {
  font-size: 0.79rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

textarea.esq-input {
  resize: vertical;
  min-height: 96px;
}

/* ---- Choice pills ---- */
.esq-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 0.7rem;
  margin-bottom: 2rem;
}

.esq-pill {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
  user-select: none;
}

.esq-pill:hover {
  border-color: var(--encre);
  background: var(--bone-soft);
}

.esq-pill.selected {
  border-color: var(--encre);
  background: var(--bone-soft);
  box-shadow: 3px 3px 0 var(--rouge);
}

.esq-pill-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  display: block;
}

.esq-pill-label {
  display: block;
  font-family: var(--ff-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--encre);
}

.esq-pill.selected .esq-pill-label {
  color: var(--rouge);
}

.esq-pill-desc {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  line-height: 1.3;
}

/* ---- Color pastilles ---- */
.esq-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.esq-color {
  width: 3rem;
  height: 3rem;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: visible;
}

.esq-color:hover {
  transform: scale(1.12);
}

.esq-color.selected {
  border-color: var(--encre);
  box-shadow: 2px 2px 0 var(--rouge);
}

.esq-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.esq-color-btn {
  background: var(--surface);
  border: 1.5px solid var(--rule);
  padding: 0.5rem 1rem;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.esq-color-btn:hover,
.esq-color-btn.selected {
  border-color: var(--encre);
  background: var(--bone-soft);
  color: var(--rouge);
}

/* ---- Navigation ---- */
.esq-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.esq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.65rem;
  font-family: var(--ff-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid var(--encre);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1;
}

.esq-btn-primary {
  background: var(--rouge);
  color: var(--bone-soft);
  box-shadow: 4px 4px 0 var(--encre);
}

.esq-btn-primary:hover {
  background: var(--rouge-deep);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--encre);
  text-decoration: none;
}

.esq-btn-primary:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--encre);
}

.esq-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: 4px 4px 0 var(--rule);
}

.esq-btn-back {
  background: var(--surface);
  color: var(--ink-mute);
  box-shadow: 4px 4px 0 var(--encre);
}

.esq-btn-back:hover {
  background: var(--bone-soft);
  color: var(--encre);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--encre);
  text-decoration: none;
}

.esq-btn-skip {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 0.78rem 0.5rem;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-left: auto;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.esq-btn-skip:hover { color: var(--rouge); }

/* ---- Error ---- */
.esq-error {
  background: #FBE4E1;
  border: 1.5px solid var(--rouge);
  border-left: 6px solid var(--rouge);
  padding: 0.8rem 1rem;
  color: var(--rouge-deep);
  font-size: 0.86rem;
  margin-bottom: 1rem;
  display: none;
}

.esq-error.visible { display: block; }

/* ---- Consent Loi 25 ---- */
.esq-consent-notice {
  background: var(--bone-deep);
  border: 1.5px solid var(--rule);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--ink-mute);
  line-height: 1.55;
}

.esq-consent-notice p { margin-bottom: 0.6rem; }
.esq-consent-notice p:last-child { margin-bottom: 0; }
.esq-consent-notice a { color: var(--rouge); }

.esq-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--ink-mute);
  line-height: 1.45;
}

.esq-consent-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--rouge);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* ---- Loading ---- */
.esq-loading-screen {
  text-align: center;
  padding: 2.5rem 0;
}

.esq-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bone-deep);
  border-top-color: var(--rouge);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: esqSpin 0.85s linear infinite;
}

@keyframes esqSpin { to { transform: rotate(360deg); } }

.esq-loading-title {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--encre);
  margin-bottom: 0.45rem;
}

.esq-loading-sub {
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 34ch;
  margin: 0 auto 1.5rem;
}

.esq-loading-steps {
  list-style: none;
  margin: 0 auto;
  max-width: 290px;
  text-align: left;
}

.esq-loading-steps li {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

.esq-loading-steps li::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--rule);
  flex-shrink: 0;
  transition: background 0.3s;
}

.esq-loading-steps li.active {
  color: var(--encre);
  font-weight: 500;
}

.esq-loading-steps li.active::before { background: var(--rouge); }
.esq-loading-steps li.done::before   { background: var(--encre); }
.esq-loading-steps li.done           { color: var(--ink-soft); }

/* ---- Results ---- */
.esq-mockup-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0 1.75rem;
}

.esq-mockup-card {
  background: var(--surface);
  border: 1.5px solid var(--encre);
  box-shadow: 4px 4px 0 var(--encre);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.esq-mockup-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--encre);
}

.esq-mockup-parti {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--rouge);
  margin-bottom: 0.2rem;
}

.esq-mockup-label {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--encre);
}

.esq-mockup-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}

.esq-mockup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--rouge);
  color: var(--bone-soft);
  text-decoration: none;
  padding: 0.55rem 1.05rem;
  border: 1.5px solid var(--encre);
  font-family: var(--ff-body);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}

.esq-mockup-link:hover {
  background: var(--rouge-deep);
  transform: translateY(-1px);
  text-decoration: none;
}

.esq-results-cta {
  background: var(--bone-deep);
  border: 1.5px solid var(--rule);
  padding: 1.2rem 1.25rem;
  text-align: center;
}

.esq-results-cta p {
  color: var(--ink-mute);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

/* ---- Arrivee (ecran resultats : le moment payoff sur fond charcoal) ---- */
.esq-arrivee {
  background: var(--encre);
  color: var(--bone-soft);
  padding: 1.7rem 1.6rem;
  margin-bottom: 1.75rem;
  border: 1.5px solid var(--encre);
  box-shadow: 4px 4px 0 var(--rule);
}

.esq-arrivee .esq-eyebrow {
  color: var(--ochre);
  margin-bottom: 0.6rem;
}

.esq-arrivee .esq-title {
  color: var(--bone-soft);
  margin-bottom: 0.5rem;
}

.esq-arrivee .esq-subtitle {
  color: var(--bone-deep);
  margin-bottom: 0;
}

/* ---- Footer ---- */
.esq-page-footer {
  padding: 1.6rem 1.4rem;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  color: var(--bone-deep);
  background: var(--encre);
}

.esq-page-footer a {
  color: var(--bone-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.esq-page-footer a:hover {
  color: var(--ochre);
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
  .esq-entry-grid {
    grid-template-columns: 1fr;
  }

  .esq-pills {
    grid-template-columns: 1fr 1fr;
  }

  .esq-progress-wrap {
    display: none;
  }

  .esq-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .esq-btn-skip {
    margin-left: 0;
    text-align: center;
  }
}

/* === FIN SECTION esquisse-form === */
