@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900&display=swap');

/* --- DÉFINITION DES VARIABLES --- */
:root {
  --orange: #F58220;
  --beige: #F7F2EB;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.06), 0 1px 1px rgba(0,0,0,0.04);
  --shadow-2: 0 6px 16px rgba(0,0,0,0.10), 0 1px 0 rgba(0,0,0,0.06) inset;
  --shadow-3: 0 10px 24px rgba(0,0,0,0.14);
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #faf7f2 0%);
  color: #111;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: fade-in 400ms ease-out forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 30px auto 10px auto;
  padding: 0 20px;
}

.header-top img {
  height: 90px;
  width: auto;
}

.header-top h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.container {
  max-width: 900px;
  margin: 20px auto 0 auto;
  background: var(--surface);
  padding: 28px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

.app-section + .app-section {
  margin-top: 32px;
}

h2 {
  margin-top: 40px;
  font-size: 1.3rem;
  border-left: 6px solid var(--orange);
  padding-left: 10px;
  color: #000;
}

h2 span {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
  margin-left: 6px;
}

.app {
  position: relative;         /* nécessaire pour positionner ::after */
  overflow: hidden;  
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 14px;
  padding: 16px 14px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
  margin: 12px 0;
  position: relative;
  overflow: hidden;
}

.app:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-1px);
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(245,130,32,0.15), rgba(245,130,32,0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.app:hover::after {
  opacity: 1;
}

.app:last-child {
  border-bottom: none;
}

.search-empty {
  font-size: 0.95rem;
  color: #666;
  text-align: center;
  margin-top: 28px;
}

.notes {
  font-size: 0.9rem;
  color: #444;
  margin-top: 5px;
}

/* New classes to replace previous inline styles */
.intro {
  font-size: 0.9rem;
  color: #555;
}

.app-title {
  font-weight: bold;
  font-size: 1.05rem;
}

.section-separator {
  margin: 46px auto 38px auto;
  height: 12px;
  width: min(95%, 680px);
  position: relative;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245,130,32,0.1), rgba(245,130,32,0.85), rgba(245,130,32,0.1));
  box-shadow:
    0 10px 24px rgba(245,130,32,0.28),
    0 0 0 1px rgba(245,130,32,0.35);
  overflow: hidden;
}

.section-separator::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0.35), rgba(255,255,255,0));
  opacity: 0.9;
}

.section-separator::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.65), rgba(255,255,255,0) 60%);
  mix-blend-mode: screen;
  opacity: 0.45;
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 14px;
  text-align: center;
  font-weight: 600;
  background-color: var(--orange);
  background-image: linear-gradient(90deg, #000 0%, #000 100%);
  background-size: 0% 100%;
  background-position: left top;
  background-repeat: no-repeat;
  color: #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.14);
  transition: color 160ms ease, transform 120ms ease, box-shadow 180ms ease, background-size 280ms ease;
}

a.btn:hover {
  background-size: 100% 100%;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.24);
}

a.btn:hover::before {
  filter: invert(1);
}

a.btn:focus-visible {
  outline: 3px solid rgba(245,130,32,0.35);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .btn { width: 100%; margin-top: 10px; }
  .header-top { flex-direction: column; text-align: center; }
  .header-top img { margin-top: 10px; }
  .search-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-label { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; opacity: 1; }
  a.btn { transition: color 0.01s linear, transform 0.01s linear, box-shadow 0.01s linear; }
}

footer {
  text-align: center;
  color: #333;
  font-size: 0.85rem;
  margin: 40px 0 15px 0;
}


/* Toast de confirmation de téléchargement */
.toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 1000;
  font-family: inherit;
}

.toast.show {
  opacity: 1;
}

.toast-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 20px;
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  min-width: 280px;
}

.toast-text {
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.01em;
  text-align: center;
}

.toast-progress {
  width: min(320px, 100%);
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
  position: relative;
  isolation: isolate;
}

.toast-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(245,130,32,0.6), var(--orange));
  border-radius: inherit;
  transform: translateZ(0);
}

.toast-progress-bar.animate {
  animation: toast-progress-anim 5s linear forwards;
}

@keyframes toast-progress-anim {
  from { width: 0%; }
  to { width: 100%; }
}

.toast.toast--complete .toast-progress {
  display: none;
}

.toast.toast--complete .toast-text {
  color: var(--orange);
}

.app-card {
  display: grid;
  grid-template-columns: 1fr 160px; /* 1fr pour l'info, auto pour le bouton */
  gap: 14px;
  padding: 16px 50px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
  margin-bottom: 12px;
  cursor: pointer;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(245,130,32,0.15), rgba(245,130,32,0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.app:last-child {
  border-bottom: none;
}
.app-card:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-1px);
}

.app-title {
  font-weight: bold;
  font-size: 1.05rem;
  text-align: left;
}

.app-notes {
  font-size: 0.9rem;
  color: #666;
  text-align: left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  text-decoration: none;
  padding: 10px 5px;
  border-radius: 14px;
  text-align: center;
  font-weight: 600;
  border: none;

  background-color: var(--orange);
  background-image: linear-gradient(90deg, #000 0%, #000 100%);
  background-size: 0% 100%;
  background-position: left top right;
  background-repeat: no-repeat;
  color: #000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.14);
  transition: color 160ms ease, transform 120ms ease, box-shadow 180ms ease, background-size 280ms ease;
  width: 100%; 
  margin-bottom: 5px;
  margin-right: 20px;
}

/* Effets de survol unifiés pour tous les boutons (.btn) */
.btn:hover {
  background-size: 100% 100%;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.24);
}

.btn:hover::before {
  filter: invert(1);
}

.btn:focus-visible {
  outline: 3px solid rgba(245,130,32,0.35);
  outline-offset: 2px;
}

/* --- BOUTON ADMIN : POSITIONNEMENT ET ANNULATION DES RÈGLES D'ALIGNEMENT --- */
.admin-btn-container {
  position: absolute;
  top: 20px;
  right: 0px;
}

/* Annule la largeur de 100% et la marge pour le bouton Admin, 
   afin qu'il prenne sa taille naturelle et reste en haut à droite */
.admin-btn-container .btn {
  width: auto; 
  margin-bottom: 0;
}

/* Retrait de la marge sous le dernier bouton du conteneur central */
.container .btn:last-child {
  margin-bottom: 0;
}
.app-info {
    display: flex; /* Utiliser Flexbox pour aider à l'alignement */
    flex-direction: column; /* Empiler les éléments (Label, Input) verticalement */
    width: 100%; /* Occuper la largeur disponible dans la grille du app-card */
}
/* --- CORRECTION POUR TOUS LES CHAMPS DE FORMULAIRE (TEXTE et SELECTION) --- */

.app-info input[type="text"],
.app-info input[type="email"],
.app-info input[type="tel"],
/* AJOUTEZ LE SELECTEUR CI-DESSOUS */
.app-info select { 
    /* 1. Largeur et box-sizing */
    width: 100%;
    box-sizing: border-box;
    
    /* 2. Style visuel (bordures, padding, coins arrondis) */
    padding: 10px 12px;
    border: 1px solid var(--border); /* Utilisation de la variable pour la bordure */
    border-radius: var(--radius-sm); 
    margin-top: 5px; 
    
    /* 3. Héritage de la police pour que le texte dans le select soit cohérent */
    font-family: inherit; /* Utilise la même police que le corps (body) */
    font-size: 1rem; /* Assure une taille de texte lisible */
    color: #111; 
	border: 1px solid #111111;
}

select {
    width: 100%;
    padding: 8px 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    border-radius: 5px;
    border: 1.5px solid #ccc;
    transition: border-color 0.3s ease;
    margin: 5px 0 13px;
    background-color: white;
    appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23333333' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    
    /* Positionne l'image de fond à droite, centré verticalement, et ne la répète pas */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px; /* Taille de la flèche */
    
    /* Ajoute de l'espace à droite pour que le texte ne chevauche pas la flèche */
    padding-right: 35px;
	border: 1px solid #111111;
	
	-webkit-appearance: none; /* Pour Chrome, Safari, Edge */
    -moz-appearance: none;    /* <--- AJOUT IMPORTANT POUR FIREFOX ! */
    appearance: none;         /* Standard */
}

.app-card .full-span-info {
    /* S'étend de la ligne de grille 1 à la fin de la ligne de grille 2 */
    grid-column: 1 / span 2;
    /* Assure que l'élément prend la largeur complète du conteneur app-card */
    width: 100%;
}

/* Tableau recap en mode "app-card" par ligne */
#recapTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

/* On empile les lignes et on ajoute l’espace entre les cards */
#recapTable tbody {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Chaque ligne devient une card en grille 2 colonnes */
#recapTable tr {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
  position: relative;
  overflow: hidden;
}

/* Effet light overlay comme .app */
#recapTable tr::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(245,130,32,0.15), rgba(245,130,32,0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

#recapTable tr:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-1px);
}

#recapTable tr:hover::after {
  opacity: 1;
}

/* Cellules : on enlève les bordures internes et on aligne le texte */
#recapTable td:last-child {
  text-align: left;   /* ou center si tu préfères centrer */
  justify-self: start;/* optionnel, aide si le grid force la fin */
  padding-left: 12px; /* ajoute un petit espace si besoin */
}

/* Colonne libellé (gauche) */
#recapTable td:first-child {
  font-weight: 700;
  color: #333;
}

/* Colonne valeur (droite) */
#recapTable td:last-child {
  color: #111;
}

h3 {
  margin-top: 40px;
  font-size: 1.3rem;
  border-left: 6px solid var(--red);
  padding-left: 10px;
  color: red;
}

h3 span {
  font-size: 0.9rem;
  color: red;
  font-weight: normal;
  margin-left: 6px;
}