* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, serif;
  background: #f5f4f0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* == Pages avec layout plein écran == */
body.plein-ecran {
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
}

/* ==============================
   CARD
   ============================== */
.card {
  background: #fff;
  border: 1px solid #e0dfd9;
  border-radius: 6px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.card-large {
  max-width: 560px;
}

.card-produit {
  max-width: 600px;
}

/* ==============================
   TYPOGRAPHIE
   ============================== */
h1 {
  font-size: 1.4rem;
  font-weight: normal;
  margin-bottom: 0.4rem;
  color: #111;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 2rem;
}

.subtitle-vide {
  text-align: center;
  margin-top: 2rem;
}

/* ==============================
   FORMULAIRES
   ============================== */
.field {
  margin-bottom: 1.2rem;
}

.field img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #f0efeb;
}

label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: #4a7c59;
}

textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}

textarea:focus {
  border-color: #4a7c59;
}

input[type="file"] {
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  color: #555;
}

/* Formulaire inline dans la navbar (déconnexion) */
.form-inline {
  display: inline;
}

/* Toggle mot de passe (CSS only) */
.password-wrap {
  position: relative;
}

.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  padding-right: 5.5rem;
}

.toggle-label {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: #aaa;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.toggle-checkbox {
  display: none;
}

.pw-visible {
  display: none;
}

.toggle-checkbox:checked ~ .pw-visible {
  display: block;
}

.toggle-checkbox:checked ~ .pw-hidden {
  display: none;
}

.toggle-checkbox:checked + .toggle-label {
  color: #4a7c59;
}

/* Checkbox souvenir */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #555;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  accent-color: #4a7c59;
}

.checkbox-row label {
  margin: 0;
  cursor: pointer;
}

/* ==============================
   BOUTONS
   ============================== */
button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background: #2d5a3d;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
}

button[type="submit"]:hover {
  background: #4a7c59;
}

/* ==============================
   SÉPARATEUR & LIENS
   ============================== */
.divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 1.5rem 0;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.links a {
  color: #4a7c59;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

/* ==============================
   MESSAGES D'ERREUR
   ============================== */
.erreur {
  background: #fdf2f2;
  border: 1px solid #e8c4c4;
  color: #9b2c2c;
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.erreur-cachee {
  display: none;
}

/* ==============================
   NAVBAR
   ============================== */
.navbar {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e0dfd9;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-size: 1.1rem;
  color: #111;
}

.navbar-liens {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.navbar-liens a {
  color: #4a7c59;
  text-decoration: none;
}

.navbar-liens a:hover {
  text-decoration: underline;
}

.btn-nav {
  padding: 0.4rem 0.9rem;
  background: #2d5a3d;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-nav:hover {
  background: #4a7c59;
}

/* ==============================
   CONTENU PRINCIPAL
   ============================== */
.contenu {
  padding: 2rem;
  width: 100%;
}

.contenu-centre {
  display: flex;
  justify-content: center;
}

.section-entete {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==============================
   GRILLE PRODUITS (MAGASIN)
   ============================== */
.grille {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.produit-carte {
  background: #fff;
  border: 1px solid #e0dfd9;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
}

.produit-carte img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f0efeb;
}

.produit-corps {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.produit-nom {
  font-size: 0.95rem;
  color: #111;
}

.produit-prix {
  font-size: 1.1rem;
  color: #2d5a3d;
  font-weight: bold;
}

.produit-vendeur {
  font-size: 0.78rem;
  color: #888;
}

.produit-pied {
  padding: 0.75rem 1rem;
  border-top: 1px solid #eee;
}

.produit-pied .btn-nav {
  width: 100%;
}

/* ==============================
   PAGE ACHAT
   ============================== */
.achat-produit-apercu {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #f5f4f0;
  border: 1px solid #e0dfd9;
  border-radius: 4px;
  padding: 0.85rem;
  margin-bottom: 1.5rem;
}

.achat-produit-apercu img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e0dfd9;
  flex-shrink: 0;
}

.achat-produit-info {
  flex: 1;
}

.achat-produit-nom {
  font-size: 0.95rem;
  color: #111;
  margin-bottom: 0.2rem;
}

.achat-produit-prix {
  font-size: 0.85rem;
  color: #888;
}

.achat-section-titre {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 0.75rem;
  margin-top: 0.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Section livraison cachée par défaut, gérée par JS */
.section-livraison-cachee {
  display: none;
}

.recapitulatif {
  background: #f5f4f0;
  border: 1px solid #e0dfd9;
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.recapitulatif-ligne {
  display: flex;
  justify-content: space-between;
  color: #555;
}

.recapitulatif-ligne.total {
  border-top: 1px solid #e0dfd9;
  padding-top: 0.4rem;
  margin-top: 0.2rem;
  font-size: 1rem;
  color: #111;
  font-weight: bold;
}

.recapitulatif-ligne .montant {
  color: #2d5a3d;
  font-weight: bold;
}

.carte-icones {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.carte-badge {
  font-size: 0.72rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  color: #888;
  background: #fff;
}

input.carte-numero {
  letter-spacing: 0.1em;
}

/* Stripe card element */
.stripe-element {
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

/* ==============================
   HISTORIQUE
   ============================== */
.historique-table {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.historique-table th {
  background: #2d5a3d;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: normal;
}

.historique-table td {
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #555;
  border-bottom: 1px solid #e0dfd9;
}

.historique-table tr:last-child td {
  border-bottom: none;
}

.historique-table tr:hover td {
  background: #f5f4f0;
}

.historique-total {
  color: #2d5a3d;
  font-weight: bold;
}
