/* ============================================
   AGRIDER — style.css
   Feuille de styles globale
   ============================================ */


/* ─── 1. VARIABLES ─────────────────────────────
   Toutes les couleurs et valeurs réutilisables.
   Tu modifies ici = ça change partout.
─────────────────────────────────────────────── */
:root {
  /* Couleurs principales */
  --vert:          #5C7A3A;   /* Vert terroir — boutons, accents */
  --vert-clair:    #EAF3DE;   /* Vert très pâle — badges, fonds */
  --vert-fonce:    #3B6D11;   /* Vert foncé — texte sur fond vert */
  --brun:          #8B4513;   /* Brun — boutons secondaires, titres */
  --brun-clair:    #F5F0E8;   /* Beige — fond général de l'app */
  --brun-moyen:    #C8A96E;   /* Doré — Gold, accents chaleureux */
  --texte-fonce:   #3B2E1A;   /* Texte principal */
  --texte-moyen:   #5C4A32;   /* Texte secondaire */
  --texte-clair:   #A09080;   /* Texte désactivé, placeholders */
  --bordure:       #D4C9B5;   /* Bordures des champs et cartes */
  --rouge:         #C0372A;   /* Erreurs, dislike, déconnexion */

  /* Fonds */
  --fond-app:      #F5F0E8;   /* Fond principal beige */
  --fond-carte:    #FFFFFF;   /* Fond des cartes / champs */
  --fond-gris:     #F0EDE6;   /* Fond légèrement grisé */

  /* Typographie */
  --police-titre:  Georgia, 'Times New Roman', serif;
  --police-texte:  -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Espacements */
  --rayon-btn:     14px;      /* Arrondi des boutons */
  --rayon-carte:   16px;      /* Arrondi des cartes */
  --rayon-champ:   12px;      /* Arrondi des champs de saisie */
  --rayon-mobile:  40px;      /* Arrondi du conteneur mobile */

  /* Ombres */
  --ombre-carte:   0 2px 12px rgba(0, 0, 0, 0.08);
}


/* ─── 2. RESET ──────────────────────────────────
   Remet à zéro les styles par défaut des navigateurs.
   Sans ça, chaque navigateur affiche différemment.
─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;   /* Le padding ne déborde plus */
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%; /* Évite le zoom auto sur iOS */
}

body {
  font-family: var(--police-texte);
  background-color: #E8E0D0;  /* Fond page autour du mobile */
  color: var(--texte-fonce);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--vert);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: var(--police-texte);
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--police-texte);
  font-size: 1rem;
}


/* ─── 3. CONTENEUR MOBILE ───────────────────────
   La "coque" qui simule un téléphone sur desktop.
   Sur vrai mobile, elle prend toute la largeur.
─────────────────────────────────────────────── */
.app-wrapper {
  width: 100%;
  max-width: 390px;           /* Largeur max — taille iPhone */
  min-height: 100vh;
  background-color: var(--fond-app);
  border-radius: var(--rayon-mobile);
  overflow: hidden;
  position: relative;
  box-shadow: var(--ombre-carte);
}


/* ─── 4. EN-TÊTE ────────────────────────────────
   Barre verte en haut — commune à toutes les pages.
─────────────────────────────────────────────── */
.app-header {
  background-color: var(--vert);
  padding: 24px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-logo {
  font-family: var(--police-titre);
  font-size: 20px;
  font-weight: 700;
  color: #F5F0E8;
}

.app-logo span {
  color: var(--brun-moyen);  /* "Der" en doré */
}

.app-header-title {
  font-family: var(--police-titre);
  font-size: 18px;
  font-weight: 700;
  color: #F5F0E8;
  text-align: center;
  flex: 1;
}

.btn-retour {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F5F0E8;
}


/* ─── 5. NAVIGATION BAS DE PAGE ─────────────────
   Barre fixe en bas — commune à toutes les pages
   après connexion.
─────────────────────────────────────────────── */
.app-nav {
  background-color: var(--fond-app);
  border-top: 0.5px solid var(--bordure);
  padding: 10px 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: sticky;
  bottom: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--texte-clair);
  font-size: 10px;
  text-decoration: none;
}

.nav-item.actif {
  color: var(--vert);
  font-weight: 500;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: var(--brun);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  font-weight: 700;
}


/* ─── 6. CONTENU PRINCIPAL ──────────────────────
   Zone scrollable entre le header et la nav.
─────────────────────────────────────────────── */
.app-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* ─── 7. BOUTONS ────────────────────────────────
─────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--rayon-btn);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  display: block;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  opacity: 0.8;
  transform: scale(0.99);
}

.btn-principal {
  background-color: var(--vert);
  color: var(--fond-app);
  font-family: var(--police-titre);
}

.btn-secondaire {
  background-color: var(--brun);
  color: var(--fond-app);
  font-family: var(--police-titre);
}

.btn-contour {
  background-color: transparent;
  border: 1.5px solid var(--bordure);
  color: var(--texte-moyen);
}

.btn-danger {
  background-color: transparent;
  border: 1.5px solid var(--rouge);
  color: var(--rouge);
}

.btn-social {
  background-color: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--texte-moyen);
  flex: 1;
}


/* ─── 8. CHAMPS DE FORMULAIRE ───────────────────
─────────────────────────────────────────────── */
.champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.champ label {
  font-size: 12px;
  font-weight: 500;
  color: var(--texte-moyen);
}

.champ-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--vert);
  margin-left: 4px;
}

.champ-input {
  background-color: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-champ);
  padding: 13px 14px;
  font-size: 13px;
  color: var(--texte-fonce);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.champ-input:focus {
  border-color: var(--vert);
}

.champ-input.erreur {
  border-color: var(--rouge);
}

.champ-input::placeholder {
  color: var(--texte-clair);
}

.champ-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.message-erreur {
  font-size: 11px;
  color: var(--rouge);
  margin-top: 2px;
}


/* ─── 9. CARTES ─────────────────────────────────
─────────────────────────────────────────────── */
.carte {
  background-color: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-carte);
  padding: 16px;
}

.carte-privee {
  background-color: var(--fond-gris);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-carte);
  padding: 14px 16px;
}

.carte-info {
  background-color: var(--vert-clair);
  border: 1px solid #C0DD97;
  border-radius: var(--rayon-carte);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}


/* ─── 10. BADGES ────────────────────────────────
─────────────────────────────────────────────── */
.badge {
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-verifie {
  background-color: var(--vert-clair);
  color: var(--vert-fonce);
}

.badge-tag {
  background-color: var(--fond-gris);
  color: var(--texte-moyen);
  font-size: 12px;
  padding: 4px 12px;
}

.badge-gold {
  background-color: #FFF8EC;
  color: var(--brun);
  border: 1px solid var(--brun-moyen);
}


/* ─── 11. SÉPARATEUR ────────────────────────────
─────────────────────────────────────────────── */
.separateur {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--texte-clair);
  font-size: 12px;
}

.separateur::before,
.separateur::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--bordure);
}


/* ─── 12. RESPONSIVE ────────────────────────────
   Sur vrai mobile, pas d'arrondi ni de marge.
─────────────────────────────────────────────── */
@media (max-width: 430px) {
  body {
    background-color: var(--fond-app);
    padding: 0;
    align-items: stretch;
  }

  .app-wrapper {
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
  }
}