:root{
  color-scheme:light dark;
  --bg:#f4f6f9;
  --card:#fff;
  --text:#202a35;
  --muted:#526070;
  --border:#d5dce5;
  --primary:#174b7a;
  --focus:#e8f3ff;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,sans-serif;
}

main{
  max-width:760px;
  margin:auto;
  padding:16px 14px 45px;
}

header{
  padding:16px 4px;
}

.brand{
  font-size:1.65rem;
  font-weight:800;
  color:var(--primary);
}

.brand span{
  font-size:1.12rem;
  font-weight:600;
}

.sub,
small,
.saved p{
  color:var(--muted);
}

.notice{
  background:#fff0cb;
  color:#5b4100;
  border-radius:10px;
  padding:12px;
  margin:6px 0 18px;
}

fieldset,
.saved{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
  padding:17px;
  margin:0 0 18px;
}

legend{
  font-size:1.2rem;
  font-weight:750;
  padding:0 7px;
}

legend small{
  display:block;
  font-size:.8rem;
  font-weight:400;
}

label{
  display:block;
  font-weight:650;
  margin:14px 0 6px;
}

label b{
  color:#b33131;
}

input,
select,
textarea,
button{
  font:inherit;
}

input[type=number],
input[type=text],
select,
textarea{
  width:100%;
  min-width:0;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--card);
  color:var(--text);
  padding:11px;
  min-height:46px;
}

textarea{
  resize:vertical;
}

.inline{
  display:flex;
  gap:8px;
  align-items:stretch;
}

.inline select{
  flex:1;
}

.inline button{
  flex:0 0 auto;
}

.secondary,
.danger{
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  border-radius:9px;
  padding:10px;
  cursor:pointer;
}

.danger{
  color:#b33131;
}

.question{
  padding:10px 0 18px;
  border-bottom:1px solid var(--border);
}

.question:last-child{
  border:0;
}

.options{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}

.choice{
  display:inline-flex;
  gap:7px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:9px;
  padding:8px 11px;
  cursor:pointer;
  margin:0;
  font-weight:450;
  min-height:42px;
}

.choice input{
  accent-color:var(--primary);
  width:18px;
  height:18px;
}

.other{
  margin-top:10px;
}

.photo{
  margin-top:12px;
}

.photo input{
  width:100%;
  font-size:.92rem;
}

.photo small{
  display:block;
}

.submit{
  width:100%;
  border:0;
  border-radius:10px;
  background:var(--primary);
  color:white;
  padding:15px;
  font-weight:750;
  cursor:pointer;
}

.saved h2{
  font-size:1.1rem;
}

.saved .inline{
  flex-wrap:wrap;
}

.entry{
  padding:10px 0;
  border-top:1px solid var(--border);
}

.entry small{
  display:block;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid #68a5ef;
  outline-offset:2px;
}


/* ============================================================
   PHOTOS
   ============================================================ */

.photo-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0;
}

.photo-actions button{
  flex:1 1 170px;
  min-height:44px;
}

.photo-input{
  display:none;
}

.photo>button{
  margin:8px 0;
}

.photo>small{
  margin:5px 0;
}


/* ============================================================
   ACTIVATION DU TÉLÉPHONE
   ============================================================ */

.activation-preview{
  border:2px dashed var(--border);
  border-radius:14px;
  background:var(--card);
  padding:16px;
  margin:0 0 18px;
}

.activation-preview h2{
  margin:0;
  font-size:1.15rem;
}

.activation-preview p{
  margin:8px 0;
}

.activation-preview input{
  max-width:230px;
}

.activation-status{
  display:flex;
  align-items:center;
  gap:8px;
  margin:9px 0;
  font-weight:700;
  color:var(--muted);
}

/* Pastille d'état */
.activation-dot{
  display:inline-block;
  flex:0 0 11px;
  width:11px;
  height:11px;
  border-radius:50%;
  background:#c23b3b;
}

/* Téléphone activé */
.activation-dot.active{
  background:#238636;
}

/* Le texte devient vert lorsque la pastille est active */
.activation-status:has(.activation-dot.active){
  color:#238636;
}


/* ============================================================
   MODE SOMBRE
   ============================================================ */

@media(prefers-color-scheme:dark){

  :root{
    --bg:#111820;
    --card:#1d2732;
    --text:#f2f5f8;
    --muted:#b5c2d0;
    --border:#425160;
    --primary:#8dc9ff;
    --focus:#263b52;
  }

  .notice{
    background:#483916;
    color:#ffe2a0;
  }

  .submit{
    background:#80c2fa;
    color:#0b2138;
  }

  .danger{
    color:#ff9d9d;
  }

  .activation-dot{
    background:#ff7777;
  }

  .activation-dot.active{
    background:#58d26a;
  }

  .activation-status:has(.activation-dot.active){
    color:#58d26a;
  }
}


/* ============================================================
   PETITS ÉCRANS
   ============================================================ */

@media(max-width:420px){

  .brand span{
    display:block;
  }

  .inline button{
    padding:8px;
  }
}
