/* Inscription technicien (3 etapes) : styles communs.
   Telephone : une colonne, champs pleine largeur, bouton toujours visible en bas.
   Ordinateur (>= 1024px) : carte en deux parties, bandeau FixPro a gauche. */
:root {
  --ts-blue: #2563EB;
  --ts-blue-d: #1D4ED8;
  --ts-ink: #0B1B3B;
  --ts-muted: #64748B;
  --ts-soft: #EEF3FD;
  --ts-line: #E2E8F2;
  --ts-bg: #F4F7FC;
  --ts-req: #EF4444;
  --ts-ok: #16A34A;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding: 24px 0 120px; }
body.ts-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ts-ink); background: var(--ts-bg); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- Structure ---------- */
.ts-shell { min-height: 100vh; min-height: 100dvh; }
.ts-aside { display: none; }
.ts {
  max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) clamp(16px, 5vw, 24px) 0;
}
.ts-content { flex: 1 0 auto; }

/* ---------- En-tete : retour + marque ---------- */
.ts-top { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; }
.ts-back {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ts-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(11, 27, 59, .1);
}
.ts-back svg { width: 20px; height: 20px; }
.ts-brand { display: flex; align-items: center; gap: 8px; }
.ts-brand img { height: 30px; width: auto; display: block; }
.ts-brand .n { display: block; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ts-brand .n i { color: var(--ts-blue); font-style: normal; }
.ts-brand .s { display: block; font-size: .68rem; font-weight: 600; color: var(--ts-muted); margin-top: 2px; }

/* ---------- Progression ---------- */
/* Telephone : cercles numerotes 1 2 3 relies par un trait (comme la premiere version). */
.ts-steps { display: flex; margin-top: 18px; }
.ts-step { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.ts-step .num {
  width: clamp(32px, 9vw, 40px); height: clamp(32px, 9vw, 40px); border-radius: 50%; background: #E7ECF4; color: #94A3B8;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(.85rem, 3.6vw, 1rem);
  position: relative; z-index: 2;
}
.ts-step.on .num { background: var(--ts-blue); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .35); }
.ts-step.done .num { background: #DBEAFE; color: var(--ts-blue); }
.ts-step .lbl { margin-top: 6px; font-size: clamp(.68rem, 2.9vw, .8rem); font-weight: 700; color: var(--ts-muted); text-align: center; line-height: 1.15; }
.ts-step.on .lbl { color: var(--ts-blue); }
.ts-step::before { content: ""; position: absolute; top: clamp(15px, 4.5vw, 19px); right: 50%; width: 100%; height: 3px; background: #E1E7F0; z-index: 1; }
.ts-step.on::before, .ts-step.done::before { background: #BFD3FB; }
.ts-step:first-child::before { display: none; }
.ts-progress { display: none; margin-top: 18px; }
.ts-progress .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--ts-muted); }
.ts-progress .lbl b { color: var(--ts-blue); }
.ts-progress .bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ts-progress .bar i { height: 6px; border-radius: 999px; background: #DCE4F0; }
.ts-progress .bar i.on { background: var(--ts-blue); }

/* ---------- Titre ---------- */
.ts-title { margin-top: 20px; }
.ts-title h1 { margin: 0; font-size: clamp(1.45rem, 6.2vw, 2rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.ts-title h1 span { color: var(--ts-blue); }
.ts-title p { margin: 6px 0 0; font-size: clamp(.88rem, 3.7vw, 1rem); line-height: 1.45; color: var(--ts-muted); }

/* ---------- Champs ---------- */
.ts-form { margin-top: 20px; display: grid; gap: 14px; }
.ts-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 480px) { .ts-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ts-field { min-width: 0; scroll-margin: 24px 0 120px; }

/* ---------- Photo de profil (facultative, etape 1) ----------
   Telephone : a droite du titre, cercle puis « Ajouter une photo (facultatif) » dessous.
   Ordinateur (>= 1024px) : carte sur toute la largeur sous le titre. */
.ts-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ts-head .ts-title { min-width: 0; flex: 1; }
.ts-photo { flex-shrink: 0; width: 104px; margin-top: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ts-photo .av {
  position: relative; flex-shrink: 0; width: clamp(72px, 20vw, 88px); height: clamp(72px, 20vw, 88px); padding: 0; border: 0;
  border-radius: 50%; cursor: pointer; background: #E5EBF4; color: #AEBBD0; display: flex; align-items: center; justify-content: center;
}
.ts-photo .av > svg { width: 56%; height: 56%; }
.ts-photo .av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ts-photo .av .cam {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ts-blue); color: #fff; border: 3px solid var(--ts-bg); display: flex; align-items: center; justify-content: center;
}
.ts-photo .av .cam svg { width: 14px; height: 14px; }
.ts-photo .tx { min-width: 0; }
.ts-photo .t1 { display: flex; flex-direction: column; align-items: center; margin-top: 6px; gap: 1px; }
.ts-photo .t1 button { padding: 0; border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 700; line-height: 1.25; color: var(--ts-ink); cursor: pointer; }
.ts-photo .t1 .rm { margin-top: 3px; color: #B91C1C; font-size: .75rem; }
.ts-photo .t1 small { font-size: .75rem; color: var(--ts-muted); }
.ts-photo .t1 small::before { content: "("; } .ts-photo .t1 small::after { content: ")"; }
.ts-photo .t2 { display: none; margin: 4px 0 0; font-size: .72rem; line-height: 1.3; }
.ts-photo .t2.err { display: block; color: var(--ts-req); font-weight: 600; }
.ts-field > label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: 6px; }
.ts-field > label b { color: var(--ts-req); }
.ts-field > label small { font-weight: 500; color: var(--ts-muted); }
.ts-input {
  display: flex; align-items: stretch; min-height: 52px; background: #fff;
  border: 1.5px solid var(--ts-line); border-radius: 14px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ts-input:focus-within { border-color: var(--ts-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.ts-input.err { border-color: var(--ts-req); }
.ts-input .ic { flex-shrink: 0; width: 46px; display: flex; align-items: center; justify-content: center; color: #7C8DA8; }
.ts-input .ic svg { width: 20px; height: 20px; }
.ts-input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 0 14px 0 0; font-size: 1rem; color: var(--ts-ink);
}
.ts-input input::placeholder { color: #A0ACBF; }
.ts-input .eye {
  flex-shrink: 0; width: 48px; border: 0; background: transparent; color: var(--ts-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ts-input .eye svg { width: 21px; height: 21px; }
.ts-cc {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 0 12px;
  border-right: 1.5px solid var(--ts-line); font-weight: 700; font-size: .95rem; background: #F8FAFD;
}
.ts-cc .flag {
  width: 20px; height: 14px; border-radius: 3px; flex-shrink: 0; display: block;
  background: linear-gradient(90deg, #CE1126 0 33.33%, #FCD116 33.33% 66.66%, #009460 66.66%);
}
.ts-cc + input { padding-left: 12px; }
.ts-err { margin: 6px 0 0; font-size: .82rem; color: var(--ts-req); font-weight: 600; }
.ts-hint { margin: 6px 0 0; font-size: .78rem; color: var(--ts-muted); }
.ts-opt { font-weight: 500; color: var(--ts-muted); }

/* ---------- Barre d'action (toujours visible en bas sur telephone) ---------- */
.ts-actions {
  position: sticky; bottom: 0; z-index: 5; margin: 20px calc(-1 * clamp(16px, 5vw, 24px)) 0;
  padding: 14px clamp(16px, 5vw, 24px) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 247, 252, 0) 0, var(--ts-bg) 22px);
}
.ts-submit {
  width: 100%; min-height: 54px; border: 0; border-radius: 16px; padding: 0 24px;
  background: linear-gradient(180deg, #3B76F5, var(--ts-blue)); color: #fff;
  font-size: 1.04rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .3); transition: opacity .15s, filter .15s;
}
.ts-submit svg { width: 21px; height: 21px; flex-shrink: 0; }
.ts-submit:active { transform: translateY(1px); }
.ts-submit:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(.3); box-shadow: none; transform: none; }
.ts-secure {
  margin: 10px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: .78rem; color: var(--ts-muted); text-align: center;
}
.ts-secure svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- Lien connexion (ordinateur) ---------- */
.ts-login { display: none; }

/* ---------- Ordinateur : vraie mise en page plein ecran ----------
   Panneau photo FixPro a gauche (toute la hauteur), formulaire a droite
   centre dans l'espace restant, barre du haut avec Retour / Se connecter. */
@media (min-width: 1024px) {
  body.ts-body { background: #fff; }
  .ts-shell { display: grid; grid-template-columns: minmax(400px, 42%) minmax(0, 1fr); min-height: 100vh; }

  /* Le panneau suit toute la hauteur de la page (jamais de bande blanche dessous).
     La photo est cadree sur le technicien (l'epingle du decor reste hors champ) et
     le texte repose sur un fond bleu plein, sans chevaucher le logo du maillot. */
  .ts-aside {
    position: relative; min-height: 100vh; display: flex; flex-direction: column;
    padding: 40px clamp(36px, 3.6vw, 64px) 44px; color: #fff; overflow: hidden;
    background-color: #0A2C8C;
    background-image:
      linear-gradient(180deg, rgba(9, 36, 120, .6) 0%, rgba(9, 36, 120, 0) 22%, rgba(9, 36, 120, 0) 34%,
                      rgba(10, 44, 140, .92) 50%, #0A2C8C 58%),
      url('../img/technician-hero-v2-hd.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%, 170% auto;
    background-position: 0 0, 78% 0;
  }
  .ts-aside .brand { display: flex; align-items: center; gap: 10px; }
  .ts-aside .brand img { height: 40px; width: auto; display: block; }
  .ts-aside .brand .n { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
  .ts-aside .brand .s { display: block; font-size: .78rem; font-weight: 600; opacity: .85; margin-top: 3px; }
  .ts-aside .bottom { margin-top: auto; }
  .ts-aside h2 { margin: 0; font-size: clamp(1.9rem, 2.4vw, 2.6rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; }
  .ts-aside .bottom > p { margin: 12px 0 0; max-width: 34em; font-size: 1.02rem; line-height: 1.55; opacity: .9; }
  .ts-aside .perks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ts-aside .perks li { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-size: .84rem; line-height: 1.4; }
  .ts-aside .perks b { display: block; font-size: 1.05rem; margin-bottom: 2px; }
  .ts-aside .perks b em { font-style: normal; color: #FFD84D; }

  /* Colonne formulaire */
  .ts { max-width: none; min-height: 100vh; margin: 0; padding: 0 clamp(40px, 5vw, 96px) 36px; background: #fff; }
  .ts > .ts-progress, .ts-content, .ts-actions { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .ts-top { justify-content: space-between; min-height: 0; padding: 28px 0; }
  .ts-top .ts-brand { display: none; }
  .ts-back { position: static; transform: none; width: auto; height: 42px; padding: 0 16px 0 12px; gap: 6px; border-radius: 999px;
    background: var(--ts-bg); box-shadow: none; font-size: .92rem; font-weight: 700; }
  .ts-back::after { content: "Retour"; }
  .ts-login { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; color: var(--ts-muted); }
  .ts-login b { color: var(--ts-blue); }
  .ts > .ts-progress { margin-top: auto; }
  .ts-steps { display: none; }
  .ts-progress { display: block; }
  .ts-title { margin-top: 26px; }
  .ts-title h1 { font-size: 2.4rem; }
  .ts-title p { font-size: 1.05rem; }
  .ts-content { flex: 0 0 auto; }

  /* Champs en deux colonnes : Prenom | Nom, Telephone | E-mail, Mot de passe sur toute la largeur */
  .ts-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 20px; margin-top: 28px; }
  .ts-pair { display: contents; }
  .ts-wide { grid-column: 1 / -1; }
  .ts-head { display: block; }
  .ts-photo {
    width: auto; margin-top: 28px; flex-direction: row; gap: 14px; text-align: left; padding: 12px 14px;
    background: #fff; border: 1.5px dashed #C9D5EA; border-radius: 18px;
  }
  .ts-photo.has { border-style: solid; border-color: var(--ts-line); }
  .ts-photo .av { width: 68px; height: 68px; }
  .ts-photo .av .cam { width: 26px; height: 26px; border-color: #fff; }
  .ts-photo .av .cam svg { width: 13px; height: 13px; }
  .ts-photo .tx { flex: 1; }
  .ts-photo .t1 { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 0; }
  .ts-photo .t1 button { font-size: .95rem; color: var(--ts-blue); }
  .ts-photo .t1 .rm { margin-top: 0; font-size: .85rem; color: #B91C1C; }
  .ts-photo .t1 small { font-size: .8rem; font-weight: 600; }
  .ts-photo .t1 small::before, .ts-photo .t1 small::after { content: none; }
  .ts-photo .t2 { display: block; margin-top: 3px; font-size: .8rem; line-height: 1.4; color: var(--ts-muted); }
  .ts-photo .t2.err { color: var(--ts-req); }
  .ts-head + .ts-form { margin-top: 20px; }
  .ts-input { min-height: 54px; }

  .ts-actions { position: static; margin-top: 30px; margin-bottom: auto; padding: 0; background: none;
    display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 20px; }
  .ts-submit { width: auto; min-width: 260px; }
  .ts-secure { margin: 0; }
}

/* Grands ecrans : texte et formulaire un peu plus grands pour remplir l'espace. */
@media (min-width: 1600px) and (min-height: 1000px) {
  html { font-size: 18px; }
  .ts > .ts-progress, .ts-content, .ts-actions { max-width: 860px; }
}
