/* ============================================================
   Qiyama Service — Formulaire Pré-inscription Hajj
   Design: bleu nuit #1b3a5c + or #c9a24b, Google Fonts Libre Baskerville
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Inter:wght@400;500;600&display=swap');

/* ---------- Variables & reset ---------- */
#qs-hajj {
  --main:   #1b3a5c;
  --accent: #c9a24b;
  --bg:     #f8f6f1;
  --card:   #ffffff;
  --text:   #1c2633;
  --muted:  #6b7a8a;
  --border: #ddd9cf;
  --err:    #9b1c1c;
  --ok:     #155e3a;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(27,58,92,.07), 0 8px 32px rgba(27,58,92,.09);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding: 32px 16px 48px;
  box-sizing: border-box;
}
#qs-hajj *, #qs-hajj *::before, #qs-hajj *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
}

/* ---------- Layout ---------- */
#qs-hajj .qs-card {
  max-width: 660px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- En-tête ---------- */
#qs-hajj .qs-head {
  background: var(--main);
  padding: 36px 40px 32px;
  text-align: center;
  position: relative;
}
#qs-hajj .qs-head::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  position: absolute;
  bottom: 0; left: 0; right: 0;
}
#qs-hajj .qs-head img {
  max-height: 110px;
  max-width: 240px;
  width: auto;
  object-fit: contain;
  margin-bottom: 18px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
#qs-hajj h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
}
#qs-hajj .qs-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- Corps du formulaire ---------- */
#qs-hajj .qs-body {
  padding: 36px 40px 40px;
}
@media (max-width: 540px) {
  #qs-hajj .qs-head { padding: 28px 20px 24px; }
  #qs-hajj .qs-body { padding: 24px 20px 28px; }
  #qs-hajj h2 { font-size: 1.2rem; }
}

/* ---------- Séparateur de section ---------- */
#qs-hajj .qs-section {
  margin-bottom: 32px;
}
#qs-hajj .qs-section-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Champs texte ---------- */
#qs-hajj .qs-fld {
  margin-bottom: 20px;
}
#qs-hajj label.qs-lbl,
#qs-hajj legend {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--main);
  margin-bottom: 8px;
  line-height: 1.4;
}
#qs-hajj .req { color: var(--accent); margin-left: 2px; }

#qs-hajj input[type=text],
#qs-hajj input[type=email],
#qs-hajj input[type=tel],
#qs-hajj textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .95rem;
  color: var(--text);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
#qs-hajj input:focus,
#qs-hajj textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,162,75,.15);
}
#qs-hajj textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}
#qs-hajj fieldset {
  border: 0;
  margin-bottom: 20px;
}

/* ---------- Options (radio / checkbox) ---------- */
#qs-hajj .qs-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#qs-hajj .qs-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--card);
  transition: border-color .15s, background .15s;
  font-size: .92rem;
  color: var(--text);
  font-weight: 400;
}
#qs-hajj .qs-opt:hover {
  border-color: var(--accent);
  background: #fdf9f0;
}
#qs-hajj .qs-opt input[type=radio],
#qs-hajj .qs-opt input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--main);
  flex-shrink: 0;
  cursor: pointer;
}
#qs-hajj .qs-opt:has(input:checked) {
  border-color: var(--main);
  background: #eef4fb;
  font-weight: 500;
}

/* ---------- Fichier ---------- */
#qs-hajj .qs-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: .9rem;
  color: var(--muted);
}
#qs-hajj .qs-file:hover {
  border-color: var(--accent);
  background: #fdf9f0;
}
#qs-hajj .qs-file-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}
#qs-hajj .qs-file small {
  font-size: .78rem;
  color: var(--muted);
}
#qs-hajj .qs-fname {
  margin-top: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--main);
  word-break: break-all;
  text-align: center;
}

/* ---------- Signature ---------- */
#qs-hajj .qs-sig-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
#qs-hajj .qs-sig-wrap canvas {
  width: 100%;
  height: 150px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
#qs-hajj .qs-sig-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
#qs-hajj .qs-sig-hint {
  font-size: .78rem;
  color: var(--muted);
}
#qs-hajj .qs-link {
  background: none;
  border: 0;
  color: var(--main);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---------- Mentions légales ---------- */
#qs-hajj .qs-legal {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* ---------- Bouton ---------- */
#qs-hajj .qs-btn {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--main);
  color: #fff;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
#qs-hajj .qs-btn:hover { background: #142c46; }
#qs-hajj .qs-btn:active { transform: scale(.99); }
#qs-hajj .qs-btn:disabled { opacity: .55; cursor: wait; }

/* ---------- Messages ---------- */
#qs-hajj .qs-msg {
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  line-height: 1.5;
}
#qs-hajj .qs-err {
  background: #fdecea;
  color: var(--err);
  border: 1px solid #f5c0bc;
}
#qs-hajj .qs-ok {
  background: #e6f5ec;
  color: var(--ok);
  border: 1px solid #b2dfc5;
}

/* ---------- Succès ---------- */
#qs-hajj .qs-done {
  text-align: center;
  padding: 48px 32px;
}
#qs-hajj .qs-done-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
#qs-hajj .qs-done h3 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.5rem;
  color: var(--main);
  margin-bottom: 10px;
}
#qs-hajj .qs-done p {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
  margin-bottom: 6px;
}
#qs-hajj .qs-ref-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  background: var(--main);
  color: #fff;
  border-radius: 100px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .05em;
}

/* ---------- Utilitaires ---------- */
#qs-hajj .qs-hide { display: none !important; }
#qs-hajj .qs-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
