/* ══════════════════════════════════════════════════
   Fabrix — Design system partagé
   fabrix.codimpact.ca
══════════════════════════════════════════════════ */

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

/* ── Variables ───────────────────────────────── */
:root {
  --primary:       #B85A0F;
  --primary-dark:  #9e4e0d;
  --bg:            #F5F0E8;
  --surface:       #FDFAF4;
  --surface-warm:  #F5ECD8;
  --text:          #3D1F0A;
  --text-mid:      #4A3728;
  --text-light:    #6B5040;
  --text-meta:     #9A8A7A;
  --border:        rgba(184,90,15,0.2);
  --border-light:  rgba(232,169,106,0.3);
  --dark:          #1E0E05;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
  background-color: var(--bg);
  background-image: url('/assets/fond_item.png');
  background-repeat: repeat;
  background-size: auto;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══ HEADER ══════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: auto;
  padding: 12px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245,240,232,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.header-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.header-logo img { height: 72px; width: auto; }
.header-nav { display: flex; align-items: center; gap: 2px; }
.header-nav a {
  font-size: 14px; font-weight: 500;
  color: var(--text-mid); text-decoration: none;
  padding: 7px 14px; border-radius: var(--r-sm);
  transition: background .15s, color .15s; white-space: nowrap;
}
.header-nav a:hover { background: rgba(184,90,15,0.09); color: var(--primary); }
.header-nav .h-cta {
  background: var(--dark); color: #fff !important;
  font-weight: 600; margin-left: 10px; padding: 8px 20px;
  border-radius: var(--r-sm);
}
.header-nav .h-cta:hover { background: #2e1a0a !important; }

@media (max-width: 600px) {
  .site-header { padding: 0 20px; }
  .header-nav a:not(.h-cta) { display: none; }
}

/* ══ FOOTER ══════════════════════════════════════ */
.site-footer { background: var(--dark); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 56px 48px 32px; }
.footer-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 48px; margin-bottom: 48px; flex-wrap: wrap;
}
.footer-brand { max-width: 240px; }
.footer-logo  { height: 80px; width: auto; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,0.38); margin-top: 12px; line-height: 1.65; }
.footer-cols  { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,0.3); margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 14px; color: rgba(255,255,255,0.58);
  text-decoration: none; margin-bottom: 10px; transition: color .15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 24px; font-size: 13px; color: rgba(255,255,255,0.28);
}
@media (max-width: 600px) {
  .footer-inner { padding: 40px 24px 28px; }
  .footer-top   { flex-direction: column; gap: 32px; }
  .footer-cols  { gap: 28px; }
}

/* ══ COMPONENTS ═══════════════════════════════════ */

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 40px;
}
@media (max-width: 600px) { .card { padding: 24px 18px; } }

/* Divider */
.hr { border: none; border-top: 1px solid var(--border-light); margin: 28px 0; }

/* Badge */
.badge {
  display: inline-block;
  background: rgba(184,90,15,0.1); color: var(--primary);
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 100px; letter-spacing: .02em;
}

/* Section label */
.s-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--primary); margin-bottom: 14px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-family: inherit; font-size: 15px; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  padding: 13px 24px; border-radius: var(--r-md);
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: #1A1A1A; color: #fff; }
.btn-dark:hover { background: #2e2e2e; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: rgba(184,90,15,0.07); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Spinner inside button */
.btn-spinner {
  width: 16px; height: 16px; flex-shrink: 0; display: none;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerts */
.alert { display: none; padding: 14px 18px; border-radius: var(--r-md); font-size: 14px; line-height: 1.6; margin-top: 16px; }
.alert-ok  { background: rgba(39,174,96,.1); border: 1px solid rgba(39,174,96,.3); color: #1a6e3c; }
.alert-err { background: #FEE2E2; border: 1px solid #FCA5A5; color: #B91C1C; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
label .req { color: var(--primary); margin-left: 2px; }
label .opt { font-weight: 400; color: var(--text-meta); font-size: 12px; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid rgba(184,90,15,0.25);
  border-radius: var(--r-sm); background: #fff;
  color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,90,15,0.1);
}
textarea { resize: vertical; min-height: 110px; }
input.err { border-color: #B91C1C; }
.cf-turnstile { margin: 4px 0; }

/* ══ PAGE LAYOUT ═══════════════════════════════════ */

/* Content pages (legal, support, etc.) */
.page-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 52px 48px 44px;
}
.page-hero-inner { max-width: 720px; margin: 0 auto; }
.page-hero .s-label { margin-bottom: 12px; }
.page-hero h1 { font-size: 30px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 10px; }
.page-hero p  { font-size: 15px; color: var(--text-mid); line-height: 1.7; max-width: 540px; }

.page-body {
  padding: 40px 48px 80px;
}
.page-body-inner { max-width: 720px; margin: 0 auto; }
.page-section { margin-bottom: 20px; }

@media (max-width: 600px) {
  .page-hero { padding: 32px 20px 28px; }
  .page-body { padding: 28px 20px 60px; }
}

/* ══ LEGAL CONTENT ════════════════════════════════ */
.legal-section { margin-bottom: 32px; }
.legal-section h2 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.legal-section p, .legal-section ul {
  font-size: 14px; line-height: 1.8; color: var(--text-mid);
}
.legal-section ul { padding-left: 20px; }
.legal-section ul li { margin-bottom: 4px; }
.legal-section p + p { margin-top: 10px; }
.legal-meta { font-size: 13px; color: var(--text-meta); margin-top: 4px; }
a.text-link { color: var(--primary); font-weight: 600; text-decoration: none; }
a.text-link:hover { text-decoration: underline; }
strong { color: var(--text); }
