/* style.css : mise en page pour téléphone, inspirée de Catch Notes */

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #e9e9e9;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #444;
}
a { text-decoration: none; color: inherit; }

/* ----- Barre du haut ----- */
.barre-haut {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  height: 64px; padding: 0 12px;
  color: #fff;
  max-width: 640px; margin: 0 auto;
}
.barre-haut h1 { margin: 0 0 0 10px; font-size: 1.6rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retour { font-size: 2.4rem; line-height: 1; padding: 0 10px 4px 0; }
.logo {
  width: 40px; height: 40px; border-radius: 6px;
  background: #f26b21; border: 2px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: bold; flex: none;
}

/* ----- Contenu ----- */
.contenu { max-width: 640px; margin: 0 auto; padding: 8px 8px 130px 8px; min-height: 100vh; }
.vide { text-align: center; color: #888; margin-top: 40px; }
.erreur { background: #fde8e8; color: #a33; padding: 10px; border-radius: 4px; }

/* ----- Liste des espaces ----- */
.espace {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 84px; padding: 0 18px; margin: 0 -8px;
  color: #fff;
}
.espace-nom { font-size: 1.7rem; }
.espace-nb  { font-size: 1.7rem; }
.espace-gris { background: #9a9a9a; }

.nouvel-espace { display: flex; gap: 8px; margin: 16px 0; }
.nouvel-espace input { flex: 1; }

/* ----- Liste des notes ----- */
.note-ligne {
  display: flex; background: #fff; margin: 6px 0;
  min-height: 100px; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.note-vignette { width: 100px; height: 100px; flex: none; background: #ddd; }
.note-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-texte { display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; min-width: 0; }
.note-titre { font-size: 1.3rem; font-weight: bold; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-date  { font-size: 1rem; color: #888; text-transform: uppercase; }

/* ----- Fiche d'une note ----- */
.note-entete {
  display: flex; justify-content: space-between; align-items: center;
  background: #dcdcdc; margin: 0 -8px; padding: 14px 16px; font-size: 1.3rem;
}
.note-lieu { color: #1a62c8; }
.cadre-photo { display: block; background: #fff; padding: 10px; margin: 16px 8px; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.cadre-photo img { width: 100%; display: block; }
.carte-texte { background: #fff; padding: 16px; margin: 8px 0; font-size: 1.3rem; }
.liens-carte { text-align: center; color: #1a62c8; line-height: 1.8; }
.liens-carte small { color: #888; }

/* ----- Formulaires ----- */
.formulaire label { display: block; margin: 16px 0 4px; font-size: .95rem; color: #666; }
input[type=text], input[type=search], input[type=password], select, textarea {
  width: 100%; padding: 12px; font-size: 1.15rem;
  border: 1px solid #ccc; border-radius: 4px; background: #fff; font-family: inherit;
}
input[type=file] { font-size: 1rem; width: 100%; }
.cache { display: none; }
.apercu { display: none; max-width: 100%; margin-top: 10px; border: 6px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.position { color: #666; font-size: .95rem; margin: 14px 0 0; }
.bouton, .nouvel-espace button, .recherche button {
  margin-top: 18px; padding: 14px 22px; font-size: 1.15rem;
  background: #E5A444; color: #fff; border: 0; border-radius: 4px;
}
.nouvel-espace button, .recherche button { margin-top: 0; }
.bouton { width: 100%; }
.recherche { display: flex; gap: 8px; margin: 10px 0; }
.recherche input { flex: 1; }

/* ----- Barre du bas ----- */
.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; height: 66px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 640px; margin: 0 auto; padding: 0 14px;
}
.b-icone {
  background: none; border: 0; color: #fff; font-size: 1.8rem; padding: 8px 12px;
  filter: grayscale(1) brightness(3);
}
.b-gauche, .b-droite { display: flex; align-items: center; }
.b-form { margin: 0; }
.b-plus {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 92px; height: 92px; border-radius: 50%;
  background: #6f6f6f; color: #fff; font-size: 3rem;
  display: flex; align-items: center; justify-content: center;
  border: 8px solid rgba(255,255,255,.35);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ----- Envoi vers le serveur ----- */
.synchro-lien { text-align: center; margin: 22px 0; }
.synchro-lien a { color: #1a62c8; font-size: 1.1rem; }
.synchro-etat { font-size: 1.2rem; }
.synchro-ok { background: #e6f4ea; color: #256029; padding: 10px; border-radius: 4px; margin: 6px 0; }

/* ----- Réglages d'un espace ----- */
.barre-haut h1 { flex: 1; min-width: 0; }
.reglages { margin-left: auto; font-size: 2rem; padding: 0 8px; color: #fff; }
.pastilles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pastille input { display: none; }
.pastille span { display: block; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #aaa; }
.pastille input:checked + span { box-shadow: 0 0 0 4px #444; }
.titre-danger { margin: 36px 0 0; font-size: 1.2rem; color: #a33; border-top: 1px solid #ccc; padding-top: 18px; }
.bouton-danger { background: #c9453f; }
