/* ═══════════════════════════════════════════════════════════════════
   CalculateurMB — Design System "Afro-Fintech Minimaliste"
   Palette : drapeau gabonais (vert forêt, jaune soleil, bleu océan)
   Typographie : Plus Jakarta Sans (géométrique, fintech moderne)
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   0. BASE RESET
   ═══════════════════════════════════════ */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════ */
:root {
    --c-vert:        #009A44;
    --c-vert-fonce:  #007A35;
    --c-vert-pale:   rgba(0, 154, 68, 0.08);
    --c-jaune:       #FCD116;
    --c-jaune-pale:  #FFF8E1;
    --c-bleu:        #003F87;
    --c-blanc:       #FFFFFF;
    --c-surface:     #F8F9FA;
    --c-texte:       #1A1A1A;
    --c-gris:        #6B7280;
    --c-gris-clair:  #9CA3AF;
    --c-bordure:     #E5E7EB;
    --c-whatsapp:    #25D366;
    --c-erreur:      #DC2626;
    --c-erreur-pale: #FEF2F2;

    --r-card:   16px;
    --r-btn:    12px;
    --r-input:  12px;
    --r-chip:   8px;
    --ombre:    0 4px 24px rgba(0, 0, 0, 0.08);
    --ombre-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --font: 'Plus Jakarta Sans', sans-serif;

    --t-fast:   150ms ease;
    --t-normal: 200ms ease;
}

/* ═══════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    font-weight: 400;
    background: var(--c-surface);
    color: var(--c-texte);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

button, input { font-family: var(--font); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════
   3. LAYOUT
   ═══════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-blanc);
    border-bottom: 1px solid var(--c-bordure);
    padding: 12px 20px;
    height: 60px;
    display: flex;
    align-items: center;
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.app-logo { width: 32px; height: 32px; display: block; border-radius: 6px; }

.app-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--c-texte);
    line-height: 1.2;
}

.app-subtitle {
    font-size: 0.7rem;
    color: var(--c-gris);
    font-weight: 500;
    line-height: 1;
}

.app-version-label {
    margin-left: auto;
    font-size: 0.6rem;
    color: var(--c-gris-clair);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    user-select: none;
}

#app-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 88px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* ═══════════════════════════════════════
   4. ÉTAPES — Transitions
   ═══════════════════════════════════════ */
.step-section { display: none; }

.step-section.active {
    display: block;
    animation: fadeSlideIn var(--t-normal);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--c-texte);
    margin-bottom: 20px;
    line-height: 1.3;
}

/* ═══════════════════════════════════════
   5. CARD
   ═══════════════════════════════════════ */
.step-card {
    background: var(--c-blanc);
    border-radius: var(--r-card);
    padding: 24px 20px;
    box-shadow: var(--ombre);
}

/* ═══════════════════════════════════════
   6. RACCOURCIS RÉCENTS
   ═══════════════════════════════════════ */
.shortcuts-recents {
    margin-bottom: 16px;
}

.shortcuts-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--c-gris-clair);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.shortcut-btn--recent {
    background: var(--c-vert-pale);
    border-color: rgba(0, 154, 68, 0.2);
    color: var(--c-vert-fonce);
}

/* ═══════════════════════════════════════
   7. SAISIE MONTANT
   ═══════════════════════════════════════ */
.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-gris);
    margin-bottom: 8px;
}

.amount-input-wrapper {
    position: relative;
    margin-bottom: 4px;
}

.amount-input {
    width: 100%;
    border: 2px solid var(--c-bordure);
    border-radius: var(--r-input);
    padding: 14px 72px 14px 16px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-texte);
    background: var(--c-blanc);
    outline: none;
    transition: border-color var(--t-normal), box-shadow var(--t-normal);
}

.amount-input:focus {
    border-color: var(--c-vert);
    box-shadow: 0 0 0 4px var(--c-vert-pale);
}

.amount-input::placeholder {
    color: var(--c-gris-clair);
    font-weight: 400;
    font-size: 1rem;
}

.amount-currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-gris);
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--c-gris-clair);
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════
   8. RACCOURCIS MONTANTS
   ═══════════════════════════════════════ */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.shortcut-btn {
    border: 1.5px solid var(--c-bordure);
    border-radius: var(--r-chip);
    background: transparent;
    padding: 10px 4px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--c-texte);
    transition: all var(--t-fast);
    text-align: center;
    cursor: pointer;
}

.shortcut-btn:hover { border-color: var(--c-vert); color: var(--c-vert); }
.shortcut-btn.active { border-color: var(--c-vert); background: var(--c-vert); color: var(--c-blanc); }

/* ═══════════════════════════════════════
   8b. TOGGLE SENS DU CALCUL
   ═══════════════════════════════════════ */
.mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--c-surface);
    border: 1px solid var(--c-bordure);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
}

.mode-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--c-gris);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}

.mode-toggle-btn:hover:not(.active) {
    color: var(--c-texte);
    background: rgba(0, 0, 0, 0.04);
}

.mode-toggle-btn.active {
    background: var(--c-vert);
    color: var(--c-blanc);
    box-shadow: 0 2px 8px rgba(0, 154, 68, 0.25);
}

.mode-pro-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--c-jaune);
    color: #1a1a1a;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
}

.mode-toggle-btn.active .mode-pro-badge {
    background: rgba(255, 255, 255, 0.25);
    color: var(--c-blanc);
}

/* ═══════════════════════════════════════
   9. SÉPARATEUR MONTANT / OPÉRATION
   ═══════════════════════════════════════ */
.calcul-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.calcul-separator::before,
.calcul-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-bordure);
}

.calcul-separator-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-gris);
    white-space: nowrap;
}

/* ═══════════════════════════════════════
   10. CARTES D'OPÉRATION
   ═══════════════════════════════════════ */
.operation-fieldset { border: none; margin-bottom: 20px; }

.operation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.operation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid var(--c-bordure);
    border-radius: var(--r-card);
    padding: 16px 10px;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
    background: var(--c-blanc);
}

.operation-card:hover { border-color: var(--c-vert); }

.operation-card:has(input:checked) {
    border-color: var(--c-vert);
    background: var(--c-vert-pale);
    box-shadow: 0 0 0 1px var(--c-vert);
}

.operation-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.op-icon { font-size: 1.5rem; line-height: 1; }
.op-label { font-weight: 700; font-size: 0.875rem; color: var(--c-texte); }
.op-desc  { font-size: 0.7rem; color: var(--c-gris); }

.op-gratuit-badge {
    background: var(--c-vert);
    color: var(--c-blanc);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   11. BOUTONS PRINCIPAUX
   ═══════════════════════════════════════ */
.btn-primary {
    width: 100%;
    padding: 15px 20px;
    background: var(--c-vert);
    color: var(--c-blanc);
    border: none;
    border-radius: var(--r-btn);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--t-normal), transform var(--t-fast), box-shadow var(--t-normal);
}

.btn-primary:not(:disabled):hover {
    background: var(--c-vert-fonce);
    box-shadow: 0 4px 16px rgba(0, 154, 68, 0.3);
}

.btn-primary:not(:disabled):active { transform: scale(0.98); }

.btn-primary:disabled {
    background: var(--c-bordure);
    color: var(--c-gris-clair);
    cursor: not-allowed;
}

/* ═══════════════════════════════════════
   12. BARRE DE RÉCAPITULATIF (résultats)
   ═══════════════════════════════════════ */
.recap-bar {
    width: 100%;
    background: var(--c-blanc);
    border: 1.5px solid var(--c-bordure);
    border-radius: var(--r-btn);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
    text-align: left;
}

.recap-bar:hover {
    border-color: var(--c-vert);
    background: var(--c-vert-pale);
}

.recap-montant { font-weight: 700; color: var(--c-texte); font-size: 1rem; }
.recap-separateur { color: var(--c-gris-clair); font-size: 0.9rem; }
.recap-operation { color: var(--c-gris); font-size: 0.9rem; flex: 1; }
.recap-edit { margin-left: auto; font-size: 1rem; }

/* ═══════════════════════════════════════
   13. SKELETON LOADERS
   ═══════════════════════════════════════ */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 6px;
}

.skeleton-ticket {
    background: var(--c-blanc);
    border-radius: var(--r-card);
    box-shadow: var(--ombre);
    overflow: hidden;
}

.skeleton-ticket-header {
    height: 56px;
    background: linear-gradient(90deg, #d4ead8 25%, #c8e4cc 50%, #d4ead8 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
}

.skeleton-ticket-perf {
    height: 16px;
    background: var(--c-surface);
}

.skeleton-ticket-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 60%; }
.skeleton-line--long   { width: 80%; }

/* ═══════════════════════════════════════
   14. TICKETS DE CAISSE
   ═══════════════════════════════════════ */
.tickets-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.ticket {
    background: var(--c-blanc);
    border-radius: var(--r-card);
    box-shadow: var(--ombre);
    overflow: hidden;
    transition: box-shadow var(--t-normal);
}

.ticket-header {
    background: var(--c-vert);
    color: var(--c-blanc);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-header-left { display: flex; flex-direction: column; gap: 2px; }

.ticket-operateur-nom {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.ticket-ussd { font-size: 0.75rem; opacity: 0.85; }

/* Bord perforé */
.ticket-perf {
    height: 16px;
    background: var(--c-surface);
    position: relative;
    overflow: hidden;
}

.ticket-perf::before {
    content: '';
    position: absolute;
    left: -8px; right: -8px;
    top: 50%;
    height: 20px;
    transform: translateY(-50%);
    background: repeating-radial-gradient(
        circle at center,
        var(--c-blanc) 0px,
        var(--c-blanc) 7px,
        var(--c-surface) 7px,
        var(--c-surface) 16px
    );
    background-size: 18px 18px;
    background-position: 0 center;
}

.ticket-body { padding: 12px 20px; background: var(--c-blanc); }

.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--c-bordure);
    font-size: 0.9rem;
    color: var(--c-gris);
}

/* Zone héro — frais en évidence */
.ticket-hero {
    text-align: center;
    padding: 16px 0 14px;
    border-bottom: 1px dashed var(--c-bordure);
    margin-bottom: 4px;
}

.ticket-hero-label {
    font-size: 0.72rem;
    color: var(--c-gris);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.ticket-hero-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--c-texte);
    line-height: 1.1;
}

.ticket-hero-value--gratuit {
    color: var(--c-vert);
}

.ticket-hero--gratuit {
    background: var(--c-vert-pale);
    border-radius: 10px;
    padding: 16px 0 14px;
}

.ticket-hero--destinataire {
    background: rgba(0, 63, 135, 0.06);
    border-radius: 10px;
    padding: 16px 0 14px;
}

.ticket-hero--destinataire .ticket-hero-label { color: var(--c-bleu); }
.ticket-hero--destinataire .ticket-hero-value { color: var(--c-bleu); }

.ticket-hero-taux {
    display: inline-block;
    background: rgba(107, 114, 128, 0.1);
    color: var(--c-gris);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 6px;
}

.ticket-row:last-child { border-bottom: none; }
.ticket-row--net   { color: var(--c-vert); }
.ticket-row--total { color: var(--c-texte); font-weight: 600; }

/* ═══════════════════════════════════════
   14b. TICKET FLOW — Flux de transaction
   ═══════════════════════════════════════ */
.ticket-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 4px;
}

.ticket-flow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
}

.ticket-flow-item--debit {
    background: rgba(26, 26, 26, 0.04);
    border: 1px solid rgba(26, 26, 26, 0.07);
}

.ticket-flow-item--credit {
    background: var(--c-vert-pale);
    border: 1px solid rgba(0, 154, 68, 0.18);
}

.ticket-flow-item--frais {
    background: rgba(0, 63, 135, 0.04);
    border: 1px solid rgba(0, 63, 135, 0.12);
}

.ticket-flow-item--frais .ticket-flow-icon { color: var(--c-bleu); opacity: 0.7; }
.ticket-flow-item--frais .ticket-flow-label { color: var(--c-bleu); opacity: 0.8; }
.ticket-flow-item--frais .ticket-flow-value { color: var(--c-bleu); font-size: 1rem; font-weight: 600; }

.ticket-flow-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--c-gris);
    line-height: 1;
}

.ticket-flow-item--credit .ticket-flow-icon { color: var(--c-vert); }

.ticket-flow-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ticket-flow-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--c-gris);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-flow-item--credit .ticket-flow-label { color: var(--c-vert-fonce); }

.ticket-flow-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c-texte);
    line-height: 1.15;
}

.ticket-flow-item--credit .ticket-flow-value {
    color: var(--c-vert);
    font-size: 1.35rem;
}

.ticket-row-label { font-weight: 500; }

.ticket-value {
    font-weight: 700;
    font-size: 1rem;
    color: inherit;
}

.ticket-row--total .ticket-value { font-size: 1.1rem; }

.ticket-footer {
    background: var(--c-blanc);
    border-top: 1px solid var(--c-bordure);
}

.ticket-toggle-grille {
    width: 100%;
    background: none;
    border: none;
    color: var(--c-vert);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 12px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background var(--t-fast);
}

.ticket-toggle-grille:hover { background: var(--c-vert-pale); }

.ticket-toggle-grille-arrow {
    transition: transform var(--t-normal);
    display: inline-block;
}

.ticket-toggle-grille[aria-expanded="true"] .ticket-toggle-grille-arrow {
    transform: rotate(180deg);
}

.ticket-grille {
    padding: 8px 20px 12px;
    font-size: 0.75rem;
    color: var(--c-gris);
    animation: fadeSlideIn var(--t-normal);
    /* Grille scrollable horizontalement sur petits écrans */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ticket-grille table {
    width: 100%;
    border-collapse: collapse;
    min-width: 200px;
}

.ticket-grille th,
.ticket-grille td {
    padding: 5px 6px;
    text-align: left;
    border-bottom: 1px solid var(--c-bordure);
    white-space: nowrap;
}

.ticket-grille th {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-gris-clair);
}

.ticket-source {
    font-size: 0.7rem;
    color: var(--c-gris-clair);
    padding: 4px 20px 4px;
    line-height: 1.4;
}

.ticket-lien-officiel {
    display: block;
    font-size: 0.72rem;
    color: var(--c-vert);
    font-weight: 600;
    padding: 2px 20px 12px;
    text-decoration: none;
    transition: color var(--t-fast);
}

.ticket-lien-officiel:hover {
    color: var(--c-vert-fonce);
    text-decoration: underline;
}

/* ═══════════════════════════════════════
   15. BANNER ANOMALIE
   ═══════════════════════════════════════ */
.anomalie-banner {
    background: var(--c-jaune-pale);
    border: 2px solid var(--c-jaune);
    border-radius: var(--r-card);
    padding: 16px 20px;
    margin-bottom: 16px;
    animation: fadeSlideIn var(--t-normal);
}

.anomalie-title {
    font-weight: 700;
    font-size: 1rem;
    color: #92400E;
    margin-bottom: 8px;
}

.anomalie-desc {
    font-size: 0.875rem;
    color: #78350F;
    line-height: 1.5;
    margin-bottom: 12px;
}

.btn-anomalie {
    width: 100%;
    padding: 12px 16px;
    background: var(--c-jaune);
    color: var(--c-texte);
    border: none;
    border-radius: var(--r-chip);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity var(--t-fast), transform var(--t-fast);
}

.btn-anomalie:hover { opacity: 0.9; }
.btn-anomalie:active { transform: scale(0.98); }

/* ═══════════════════════════════════════
   16. BANNER ERREUR
   ═══════════════════════════════════════ */
.erreur-banner {
    background: var(--c-erreur-pale);
    border: 2px solid var(--c-erreur);
    border-radius: var(--r-card);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.erreur-titre { font-weight: 700; color: var(--c-erreur); margin-bottom: 8px; }
.erreur-desc  { font-size: 0.875rem; color: #7F1D1D; margin-bottom: 12px; }

/* ═══════════════════════════════════════
   17. PARTAGE
   ═══════════════════════════════════════ */
.share-section {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.btn-share {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border: none;
    border-radius: var(--r-btn);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity var(--t-fast), transform var(--t-fast);
}

.btn-share:hover   { opacity: 0.9; }
.btn-share:active  { transform: scale(0.97); }
.btn-share:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-whatsapp { background: var(--c-whatsapp); color: var(--c-blanc); }
.btn-copier   { background: var(--c-bleu);      color: var(--c-blanc); }

.copy-feedback {
    text-align: center;
    color: var(--c-vert);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 0;
    animation: fadeSlideIn var(--t-normal);
}

.nouveau-calcul-section {
    text-align: center;
    margin: 4px 0 8px;
}

.btn-nouveau-calcul {
    background: none;
    border: 1.5px solid var(--c-bordure);
    border-radius: var(--r-btn);
    color: var(--c-gris);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 28px;
    cursor: pointer;
    transition: border-color var(--t-fast), color var(--t-fast);
}

.btn-nouveau-calcul:hover {
    border-color: var(--c-vert);
    color: var(--c-vert);
}

/* ═══════════════════════════════════════
   18. DISCLAIMER
   ═══════════════════════════════════════ */
.disclaimer {
    font-size: 0.7rem;
    color: var(--c-gris-clair);
    text-align: center;
    line-height: 1.6;
    padding: 16px 8px 8px;
    border-top: 1px solid var(--c-bordure);
    margin-top: 16px;
}

/* ═══════════════════════════════════════
   19. NAVIGATION INFÉRIEURE
   ═══════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--c-blanc);
    border-top: 1px solid var(--c-bordure);
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--c-gris-clair);
    font-size: 0.65rem;
    font-weight: 500;
    transition: color var(--t-fast);
    padding: 8px 4px;
    cursor: pointer;
}

.nav-item.active { color: var(--c-vert); }
.nav-item:hover:not(.active) { color: var(--c-gris); }
.nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-label { font-size: 0.65rem; }

/* ═══════════════════════════════════════
   20. TOAST
   ═══════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.toast {
    background: rgba(26,26,26,0.9);
    color: var(--c-blanc);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    animation: toastIn 200ms ease forwards, toastOut 200ms ease 1800ms forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-4px) scale(0.95); }
}

/* ═══════════════════════════════════════
   21. RESPONSIVE
   ═══════════════════════════════════════ */
@media (min-width: 640px) {
    #app-main { padding: 28px 24px 96px; }
    .shortcuts-grid { grid-template-columns: repeat(6, 1fr); }
    .tickets-container { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 1024px) {
    .app-header { padding: 12px 24px; }
    #app-main { max-width: 600px; padding: 32px 0 96px; }
}

/* ═══════════════════════════════════════
   22. ACCESSIBILITÉ — Réduction des animations
       WCAG 2.1 AA — critère 2.3.3
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible — accessibilité clavier */
:focus-visible {
    outline: 2px solid var(--c-vert);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════
   23. MODAL D'AUTHENTIFICATION GCP
   ═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: var(--c-blanc);
    border-radius: 20px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    animation: modalEntree 0.2s ease-out;
}

@keyframes modalEntree {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--c-gris);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--c-gris-clair);
    color: var(--c-noir);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-noir);
    margin: 0 0 6px;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--c-gris);
    margin: 0 0 20px;
}

/* Bouton Google */
.btn-google-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: #fff;
    border: 1.5px solid #dadce0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.btn-google-signin:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Séparateur "ou par email" */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--c-gris);
    font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-gris-clair);
}

/* Champs de formulaire */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--c-noir);
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--c-gris-clair);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--c-noir);
    background: var(--c-blanc);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--c-vert);
    outline: none;
}

/* Message d'erreur */
.auth-error {
    font-size: 0.82rem;
    color: #d32f2f;
    background: #ffeaea;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
}

/* Lien bas de modal */
.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: var(--c-gris);
    margin: 16px 0 0;
}

.link-btn {
    background: none;
    border: none;
    color: var(--c-vert);
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-btn:hover {
    color: var(--c-vert-fonce, #006d30);
}

/* ═══════════════════════════════════════
   24. PANNEAU COMPTE
   ═══════════════════════════════════════ */
.compte-plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--c-vert-pale);
    color: var(--c-vert-fonce);
    margin-bottom: 24px;
}

.compte-plan-badge.badge-essai {
    background: #fef9c3;
    color: #a16207;
}

.compte-plan-badge.badge-pro {
    background: #ede9fe;
    color: #6d28d9;
}

.btn-essai-pro {
    width: 100%;
    padding: 13px 20px;
    background: #ede9fe;
    color: #6d28d9;
    border: 1.5px solid #c4b5fd;
    border-radius: var(--r-btn);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background var(--t-fast), border-color var(--t-fast);
}

.btn-essai-pro:hover {
    background: #ddd6fe;
    border-color: #7c3aed;
}

.btn-essai-pro:active { transform: scale(0.98); }

.btn-deconnexion {
    width: 100%;
    padding: 13px 20px;
    background: var(--c-erreur-pale);
    color: var(--c-erreur);
    border: 1.5px solid transparent;
    border-radius: var(--r-btn);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}

.btn-deconnexion:hover {
    background: #fee2e2;
    border-color: var(--c-erreur);
}

.btn-deconnexion:active { transform: scale(0.98); }

.compte-version {
    font-size: 0.65rem;
    color: var(--c-gris-clair);
    text-align: center;
    margin-top: 12px;
    user-select: text;
}

.pro-gate-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 8px;
}

.pro-gate-ctas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ═══════════════════════════════════════
   25. NAV — ÉTAT CONNECTÉ
   ═══════════════════════════════════════ */
.nav-item--connected .nav-icon::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--c-vert);
    border-radius: 50%;
    margin-left: 3px;
    vertical-align: middle;
}

/* ═══════════════════════════════════════
   26. OPTION RETRAIT INCLUS (PRO)
   ═══════════════════════════════════════ */
.option-pro {
    background: rgba(0, 63, 135, 0.04);
    border: 1px solid rgba(0, 63, 135, 0.14);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.option-toggle-input {
    width: 18px;
    height: 18px;
    accent-color: var(--c-bleu, #003F87);
    cursor: pointer;
    flex-shrink: 0;
}

.option-toggle-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-bleu, #003F87);
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-hint {
    font-size: 0.73rem;
    color: var(--c-gris-clair);
    margin: 6px 0 0 28px;
    line-height: 1.4;
}

/* ═══════════════════════════════════════
   27. TICKET CASCADE (RETRAIT INCLUS)
   ═══════════════════════════════════════ */
.ticket-badge-retrait {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.88);
    color: var(--c-vert-fonce, #005a2a);
    border-radius: 4px;
    padding: 2px 6px;
}

.ticket-hero--retrait-inclus {
    background: var(--c-vert-pale);
    border-radius: 10px;
    padding: 16px 0 14px;
    text-align: center;
    margin-bottom: 4px;
}

.ticket-hero--retrait-inclus .ticket-hero-label {
    font-size: 0.72rem;
    color: var(--c-vert-fonce, #005a2a);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.ticket-hero--retrait-inclus .ticket-hero-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--c-vert);
}

/* Hero "émetteur" pour le mode retrait inclus — affiche ce que l'émetteur doit envoyer */
.ticket-hero--retrait-sender {
    background: rgba(26, 26, 26, 0.04);
    border: 1px solid rgba(26, 26, 26, 0.07);
    border-bottom: 1px solid rgba(26, 26, 26, 0.07);
    border-radius: 10px;
    padding: 16px 0 14px;
    text-align: center;
    margin-bottom: 4px;
}

.ticket-hero--retrait-sender .ticket-hero-label { color: var(--c-gris); }
.ticket-hero--retrait-sender .ticket-hero-value  { color: var(--c-texte); }

/* Ligne de détail des frais (frais transfert + retrait) */
.ticket-frais-detail {
    font-size: 0.7rem;
    color: var(--c-gris-clair);
    text-align: center;
    margin-top: 2px;
    padding: 0 8px 6px;
}

.ticket-flow--cascade {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ticket-flow--cascade .ticket-flow-item {
    border-radius: 8px;
}

.ticket-flow-cascade-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px;
}

.cascade-fleche {
    font-size: 0.75rem;
    color: var(--c-gris-clair);
    flex-shrink: 0;
}

.cascade-frais {
    font-size: 0.72rem;
    color: var(--c-gris);
    font-style: italic;
}

.ticket-flow-item--transfert {
    background: rgba(0, 63, 135, 0.04);
    border: 1px solid rgba(0, 63, 135, 0.12);
}

.ticket-flow-item--transfert .ticket-flow-icon { color: var(--c-bleu, #003F87); opacity: 0.7; }
.ticket-flow-item--transfert .ticket-flow-label { color: var(--c-bleu, #003F87); opacity: 0.8; }
.ticket-flow-item--transfert .ticket-flow-value { color: var(--c-bleu, #003F87); font-size: 1rem; font-weight: 600; }

.ticket-taux-global {
    font-size: 0.75rem;
    color: var(--c-gris);
    text-align: center;
    margin-top: 10px;
    padding: 6px 0 2px;
    border-top: 1px solid var(--c-bordure);
}
