/* ============================================================
   Components — buttons, cards, badges, forms
   ============================================================ */

/* ============== BOUTONS ============== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-body-small);
  font-weight: var(--fw-medium);
  letter-spacing: 0.01em;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--t-base) var(--ease-out);
  position: relative;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn .icon-arrow { width: 14px; height: 14px; transition: transform var(--t-base) var(--ease-out); }
.btn:hover .icon-arrow { transform: translateX(3px); }

/* Primary — vert étude */
.btn--primary {
  background: var(--sn-etude);
  color: var(--sn-paper);
  border-color: var(--sn-etude);
}
.btn--primary:hover {
  background: var(--sn-etude-deep);
  border-color: var(--sn-etude-deep);
  color: var(--sn-paper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

/* Outline — fil noir */
.btn--outline {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--sn-ink);
}
.btn--outline:hover {
  background: var(--sn-ink);
  color: var(--sn-paper);
}

/* Ghost — pour liens secondaires */
.btn--ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn--ghost::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0.5px;
  background: var(--sn-line);
  transition: background var(--t-base) var(--ease-out);
}
.btn--ghost:hover { color: var(--accent); }
.btn--ghost:hover::after { background: var(--accent); }

/* Seal — utilisation rare */
.btn--seal {
  background: var(--sn-seal);
  color: var(--sn-paper);
  border-color: var(--sn-seal);
}
.btn--seal:hover {
  background: var(--sn-seal-deep);
  border-color: var(--sn-seal-deep);
}

/* On dark surface */
.section--ink .btn--outline {
  color: var(--sn-paper);
  border-color: var(--sn-paper);
}
.section--ink .btn--outline:hover {
  background: var(--sn-paper);
  color: var(--sn-ink);
}
.section--ink .btn--ghost { color: var(--sn-paper); }
.section--ink .btn--ghost::after { background: rgba(245, 239, 226, 0.25); }

.btn--small { padding: 0.625rem 1.125rem; font-size: 0.8125rem; }
.btn--large { padding: 1.125rem 2rem; font-size: 1rem; }
.btn--full  { width: 100%; }

/* ============== CARTES ============== */

.card {
  background: var(--bg-alt);
  border: 0.5px solid var(--sn-line);
  border-radius: var(--radius-card);
  padding: var(--space-7);
  transition: all var(--t-base) var(--ease-out);
}
.card--lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--sn-line-soft);
}

/* Card avec numéro */
.card--numbered {
  position: relative;
  padding-top: var(--space-8);
}
.card--numbered .card__num {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--decor);
  font-feature-settings: 'lnum';
  letter-spacing: -0.04em;
}

/* Card éditoriale — séparateur or en haut */
.card--editorial {
  background: transparent;
  border: 0;
  padding-left: 0;
  padding-right: 0;
  border-top: 0.5px solid var(--sn-gold);
}

/* ============== BADGES ============== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.625rem;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 2px;
  background: rgba(31, 75, 63, 0.08);
  color: var(--sn-etude);
  border: 0.5px solid rgba(31, 75, 63, 0.18);
}
.badge--gold {
  background: rgba(184, 153, 104, 0.12);
  color: var(--sn-gold-deep);
  border-color: rgba(184, 153, 104, 0.3);
}
.badge--seal {
  background: rgba(122, 31, 42, 0.08);
  color: var(--sn-seal);
  border-color: rgba(122, 31, 42, 0.2);
}
.badge--ink {
  background: var(--sn-ink);
  color: var(--sn-paper);
  border-color: var(--sn-ink);
}

/* ============== TAGS PRIX ============== */

.price-tag {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  background: var(--bg);
  border: 0.5px solid var(--sn-gold);
  border-radius: var(--radius-card);
  position: relative;
}
.price-tag__label {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.price-tag__value {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: var(--fw-regular);
  letter-spacing: -0.025em;
  color: var(--text-strong);
  font-feature-settings: 'tnum', 'lnum';
}
.price-tag__suffix {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ============== FORMS ============== */

.form { display: flex; flex-direction: column; gap: var(--space-5); }

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field__label {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}
.field__label .req { color: var(--sn-seal); margin-left: 2px; }

.field__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-alt);
  border: 0.5px solid var(--sn-line);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-strong);
  line-height: 1.5;
  transition: all var(--t-base) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--sn-smoke-soft); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--sn-paper);
  box-shadow: 0 0 0 3px rgba(31, 75, 63, 0.08);
}

.textarea { min-height: 140px; resize: vertical; font-family: var(--font-body); }

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F4B3F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Form messages */
.form-error {
  padding: 0.75rem 1rem;
  background: rgba(122, 31, 42, 0.06);
  border-left: 2px solid var(--sn-seal);
  font-size: var(--fs-body-small);
  color: var(--sn-seal-deep);
  border-radius: 2px;
}
.form-error.hidden { display: none; }

.form-success {
  padding: var(--space-7);
  background: var(--bg-alt);
  border: 0.5px solid var(--sn-gold);
  border-radius: var(--radius-card);
  text-align: center;
}
.form-success.hidden { display: none; }
.form-success h3 { color: var(--accent); margin-bottom: var(--space-4); }

/* Checkbox / radio (custom) */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--fs-body-small);
  line-height: 1.5;
}
.check input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--sn-line);
  border-radius: 2px;
  background: var(--bg-alt);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--t-fast);
}
.check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23F5EFE2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

/* ============== TABLES ============== */

.editorial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-small);
}
.editorial-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--sn-ink);
}
.editorial-table tbody td {
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  border-bottom: 0.5px solid var(--sn-line);
  vertical-align: top;
}
.editorial-table tbody tr:last-child td { border-bottom: 0; }
.editorial-table .num { font-family: var(--font-mono); font-feature-settings: 'tnum'; text-align: right; }
.editorial-table .total td { font-weight: var(--fw-semibold); border-top: 1px solid var(--sn-ink); border-bottom: 0; padding-top: var(--space-5); }

/* ============== LIST WITH MARKERS ============== */

.list-checked {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.list-checked li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--fs-body);
  line-height: 1.55;
}
.list-checked li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231F4B3F' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

.list-numbered {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: ln;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.list-numbered > li {
  counter-increment: ln;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-5);
  align-items: baseline;
  padding-bottom: var(--space-6);
  border-bottom: 0.5px solid var(--sn-line);
}
.list-numbered > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-numbered > li::before {
  content: counter(ln, upper-roman) ".";
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--decor);
  font-variation-settings: 'opsz' 144;
}

/* ============== DETAILS / ACCORDION (FAQ) ============== */

.qa {
  border-bottom: 0.5px solid var(--sn-line);
}
.qa[open] { background: rgba(184, 153, 104, 0.04); }

.qa summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: var(--fw-regular);
  color: var(--text-strong);
  transition: color var(--t-base) var(--ease-out);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent); }

.qa summary::after {
  content: '+';
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--fw-light);
  color: var(--decor);
  transition: transform var(--t-base) var(--ease-out);
}
.qa[open] summary::after {
  content: '−';
  color: var(--accent);
}

.qa__body {
  padding: 0 0 var(--space-6);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  max-width: 64ch;
}

/* ============== TIMELINE ============== */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  padding-left: var(--space-7);
  border-left: 0.5px solid var(--sn-gold);
}
.timeline__item {
  position: relative;
}
.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-7) - 4px);
  top: 0.45em;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1.5px solid var(--sn-gold);
  border-radius: 50%;
}
.timeline__phase {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--decor);
  margin-bottom: var(--space-2);
}
.timeline__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

/* ============== CITATION FOOTER (signature feel) ============== */

.signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-strong);
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  margin-bottom: var(--space-2);
}
.signature--sub {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ============== FOCUS RING UNIVERSEL ============== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
