/*
 * AlloSasha — pages app (connexion OAuth, profil, recharge) et pages légales.
 * Chargée APRÈS site.css : reprend ses polices, couleurs, boutons et pied de page ;
 * ne définit ici que ce qui est propre à ces pages.
 */

.page-app, .page-legale { min-height: 100vh; display: flex; flex-direction: column; }
.page-app main, .page-legale main { flex: 1; }

/* --- Carte centrale des pages app ----------------------------------------------- */
.app { padding-top: 24px; padding-bottom: 80px; display: flex; justify-content: center; }
.carte-app {
  width: 100%; max-width: 520px; background: var(--carte); border: 2px solid var(--bord);
  border-radius: 32px; padding: clamp(26px, 5vw, 40px); box-shadow: 12px 12px 0 var(--bleu);
}
.carte-app.large { max-width: 760px; }
.carte-app section { display: flex; flex-direction: column; }

.surtitre-app {
  margin: 0 0 14px; font-weight: 700; font-size: 14px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--lime);
}
.app-titre { font-size: clamp(28px, 5vw, 40px); line-height: 1.05; letter-spacing: -0.035em; }
.app-texte { margin: 16px 0 0; color: var(--doux); font-size: 17px; }
.app-texte strong { color: var(--blanc); }
.petit { font-size: 15px; color: var(--doux-2); }
.petit a { color: var(--doux); }

/* Chargement */
.chargement { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--doux); }

/* Formulaires */
.champs { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.champs label { font-weight: 700; font-size: 16px; }
.champs label .petit { font-weight: 400; }
.champs input {
  width: 100%; min-height: 58px; background: var(--carte-2); border: 2px solid var(--bord);
  border-radius: 999px; padding: 0 24px; color: var(--blanc); font-family: inherit; font-size: 18px;
  margin-bottom: 8px;
}
.champs input::placeholder { color: #7A7A88; }
.champs input:focus { outline: 3px solid var(--lime); outline-offset: 2px; }
.champs input#code { letter-spacing: 0.3em; font-family: var(--titre); font-weight: 800; font-size: 22px; text-align: center; }
.champs .bouton, .boutons .bouton { width: 100%; }
.champs .bouton { margin-top: 8px; }
.bouton[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.boutons { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.lien-bouton {
  align-self: flex-start; margin-top: 16px; padding: 6px 0; background: none; border: 0; cursor: pointer;
  color: var(--doux); font-family: inherit; font-size: 16px; text-decoration: underline; text-underline-offset: 3px;
}
.lien-bouton:hover { color: var(--lime); }

/* Messages */
.alerte {
  margin: 0 0 22px; background: rgba(255, 61, 139, 0.12); border: 2px solid var(--rose);
  color: #FFB3D1; border-radius: 18px; padding: 14px 18px; font-size: 16px;
}
.succes {
  margin: 0 0 24px; background: var(--lime); color: var(--noir); border-radius: 20px;
  padding: 16px 20px; font-weight: 700; box-shadow: 6px 6px 0 var(--bleu);
}

/* Consentement OAuth */
.application {
  display: inline-block; background: var(--lime); color: var(--noir); padding: 0.02em 0.25em 0.06em;
  border-radius: 0.2em; transform: rotate(-2deg); box-shadow: 0.08em 0.08em 0 var(--blanc);
}
.droits { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.droits li { display: flex; gap: 12px; align-items: flex-start; color: var(--texte-2); font-size: 17px; }
.droits svg { flex: none; margin-top: 3px; }
.rassurance {
  margin: 22px 0 0; background: var(--carte-2); border: 1.5px dashed var(--bord-2); border-radius: 18px;
  padding: 14px 18px; font-size: 15px; color: var(--texte-2);
}

/* Profil : solde */
.solde-boite {
  margin-top: 26px; background: var(--noir); border: 2px solid var(--bord); border-radius: 22px;
  padding: 18px 22px; display: flex; align-items: center; gap: 16px;
}
.solde-boite strong { font-family: var(--titre); font-weight: 900; font-size: 40px; line-height: 1; color: var(--lime); }
.solde-boite span { color: var(--texte-2); }

/* Recharge : cartes de packs (reprend .tarif de la landing) */
.packs { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
a.tarif { color: var(--blanc); text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease; }
a.tarif:hover { border-color: var(--lime); transform: translate(-2px, -2px); }
a.tarif.tarif-vedette { color: var(--noir); }
a.tarif.tarif-vedette:hover { transform: rotate(-1.5deg) translate(-2px, -2px); }
a.tarif .prix { font-size: 44px; }
a.tarif .bouton { margin-top: 14px; pointer-events: none; }
.garanties { margin: 30px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.garanties li { display: flex; gap: 12px; align-items: flex-start; color: var(--doux); font-size: 16px; }
.garanties svg { flex: none; margin-top: 3px; }
.garanties strong { color: var(--blanc); }
.mentions-achat { margin: 24px 0 0; }

/* --- Pages légales ---------------------------------------------------------------- */
.legal { padding-top: 30px; padding-bottom: 90px; max-width: 860px; }
.legal .surtitre-app { margin-bottom: 16px; }
.legal h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1; }
.legal .maj { margin: 18px 0 40px; color: var(--doux-2); font-size: 15px; }
.legal h2 {
  margin: 48px 0 14px; font-family: var(--titre); font-weight: 800; font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.02em; line-height: 1.2;
}
.legal h3 { margin: 26px 0 8px; font-family: var(--titre); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--texte-3); font-size: 17px; }
.legal p { margin: 0 0 16px; }
.legal ul { margin: 0 0 18px; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--lime); }
.legal strong { color: var(--blanc); }
.legal a { color: var(--lime); }
.legal a:hover { color: var(--blanc); }
.table-defile { max-width: 100%; overflow-x: auto; margin: 12px 0 20px; border: 2px solid var(--bord); border-radius: 20px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--ligne); overflow-wrap: break-word; }
.legal td:last-child, .legal th:last-child { min-width: 120px; }
.legal tr:last-child td { border-bottom: 0; }
.legal th { background: var(--carte-2); color: var(--lime); font-weight: 700; }
.legal td { color: var(--texte-3); }
.a-completer { background: var(--jaune); color: var(--noir); padding: 0 6px; border-radius: 6px; font-weight: 500; }

@media (max-width: 520px) {
  .carte-app { box-shadow: 8px 8px 0 var(--bleu); border-radius: 26px; }
  .entete .pastille { font-size: 13px; padding: 6px 12px; }
}

/* Profil : parrainage (reprend le bloc rose de la landing) */
.parrainage-app {
  margin-top: 34px; background: var(--rose); color: var(--noir); border-radius: 26px;
  padding: clamp(22px, 4vw, 30px); box-shadow: 8px 8px 0 var(--lime);
}
.parrainage-app .surtitre-app { color: var(--noir); margin-bottom: 8px; }
.parrainage-app h2 { font-size: clamp(22px, 4vw, 28px); line-height: 1.1; letter-spacing: -0.03em; }
.parrainage-app p { margin: 14px 0 0; font-size: 16px; }
.lien-copie { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.lien-copie input {
  flex: 1 1 200px; min-width: 0; min-height: 48px; border: 2px solid var(--noir); border-radius: 999px;
  padding: 0 18px; background: var(--blanc); color: var(--noir); font-family: inherit; font-size: 15px;
}
.lien-copie .bouton { flex: none; }
#partager-lien { margin-top: 12px; width: 100%; }
.compteur-parrainage { font-weight: 700; }
.parrainage-app .petit-noir { margin-top: 6px; font-size: 14px; }

/* --- Tableau de bord admin -------------------------------------------------------- */
.admin { padding-top: 16px; padding-bottom: 80px; }
.connexion-admin { margin: 0 auto; }
.admin-entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-titre { margin: 44px 0 16px; font-family: var(--titre); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.soldes, .kpis { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.solde, .kpi, .graphe-carte, .table-carte {
  background: var(--carte); border: 2px solid var(--bord); border-radius: 22px; padding: 20px;
}
.solde { display: flex; flex-direction: column; gap: 6px; border-width: 3px; }
.solde p, .kpi p { margin: 0; }
.solde-nom, .kpi-titre { font-weight: 700; font-size: 15px; color: var(--texte-2); }
.solde-valeur, .kpi-valeur { font-family: var(--titre); font-weight: 900; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.solde-nature, .solde-detail, .kpi-sous { font-size: 14px; color: var(--doux-2); }
.solde-etat { align-self: flex-start; margin-top: 4px !important; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--noir); background: var(--doux); }
.solde-lien { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--doux); }
.etat-ok { border-color: var(--lime); }
.etat-ok .solde-etat { background: var(--lime); }
.etat-attention { border-color: var(--jaune); box-shadow: 6px 6px 0 var(--jaune); }
.etat-attention .solde-etat { background: var(--jaune); }
.etat-critique { border-color: var(--rose); box-shadow: 6px 6px 0 var(--rose); }
.etat-critique .solde-etat { background: var(--rose); }
.etat-critique .solde-valeur { color: var(--rose); }
.etat-inconnu .solde-etat, .etat-non_configure .solde-etat { background: var(--bord-2); color: var(--blanc); }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--doux); }
.pastille-couleur { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.pastille-couleur.missions, .barre.missions { background: var(--lavande); }
.pastille-couleur.factures, .barre.factures { background: var(--lime); }
.graphe { margin-top: 18px; height: 180px; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; }
.colonne { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.barres { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.barre { width: 45%; min-height: 2px; border-radius: 4px 4px 0 0; }
.jour { font-size: 11px; color: var(--doux-2); white-space: nowrap; }
.tables { margin-top: 18px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.table-carte .admin-titre { margin-top: 0; font-size: 17px; }
.table-carte table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-carte td { padding: 9px 0; border-bottom: 1px solid var(--ligne); color: var(--texte-3); }
.table-carte tr:last-child td { border-bottom: 0; }
.table-carte td.nombre { text-align: right; font-weight: 700; color: var(--blanc); }

/* Consentement : domaine de retour */
.destination { margin: 14px 0 0; font-size: 15px; color: var(--doux); }
.destination strong { color: var(--blanc); }
#application-inconnue { margin: 16px 0 0; }
