/* Pingr - Feuille de style principale
 * Approche mobile-first / responsive : le site est utilisé sur smartphone
 * (scan du QR code par le client, consultation rapide par le personnel),
 * tablette (comptoir, réception) et ordinateur (gestion par le propriétaire).
 * Les grilles (auto-fit/auto-fill) s'adaptent déjà en continu ; les media
 * queries en bas de fichier affinent la navigation, les formulaires et les
 * tableaux aux largeurs tablette et mobile.
 */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #d97706;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #f9fafb;
    --color-card: #ffffff;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* L'attribut HTML [hidden] doit rester prioritaire même sur des éléments dont
   on fixe par ailleurs le display (label, .client-status...), sans quoi le
   display défini plus bas dans la feuille de style l'emporterait et
   l'élément resterait visible malgré [hidden]. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    overflow-x: hidden;
}

img, svg, canvas { max-width: 100%; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }

.muted { color: var(--color-muted); }

/* --- Boutons ---------------------------------------------------- */
.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-border);
    color: var(--color-text);
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--ghost { background: transparent; border-color: var(--color-border); }
.btn--danger { background: #fee2e2; color: var(--color-danger); }
.btn--sm { padding: 6px 12px; font-size: 13px; }

/* --- Formulaires -------------------------------------------------- */
label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}
.required-mark { color: var(--color-danger); margin-left: 2px; }
.form-required-note { font-size: 13px; margin: -6px 0 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="time"], input[type="tel"], select, textarea {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-weight: 400;
}
textarea { resize: vertical; }
.contact-hint { margin: -6px 0 14px; font-size: 13px; }
.horaires-form .table input[type="time"] { padding: 6px 8px; font-size: 14px; }
.horaires-form .table input[type="checkbox"] { width: 18px; height: 18px; }
.horaires-hint { margin: 14px 0; }
.horaires-table-compact { width: 100%; border-collapse: collapse; margin: 16px 0; table-layout: fixed; }
.horaires-table-compact tr { border-bottom: 1px solid var(--color-border); }
.horaires-table-compact tr:last-child { border-bottom: none; }
.horaires-table-compact th, .horaires-table-compact td {
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}
.horaires-table-compact th { font-weight: 600; width: 42%; }
.horaires-table-compact td { text-align: right; }
.client-contact-btn { display: block; width: 100%; text-align: center; margin-top: 8px; }
.inline-form { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 1; min-width: 220px; }
.form-grid { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 24px; }
.form-grid label { margin-bottom: 0; }

.settings-form { display: flex; flex-direction: column; gap: 12px; max-width: 480px; margin-bottom: 24px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox-field input { margin: 0; }

/* Destructive/irreversible actions block (admin/archives.php: bulk delete
   by date range). */
.danger-zone { margin-top: 32px; padding: 20px; border: 1px solid #fecaca; border-radius: var(--radius); background: #fef2f2; }
.danger-zone h2 { margin-top: 0; color: var(--color-danger); font-size: 16px; }
.danger-zone .form-grid { margin-bottom: 0; margin-top: 12px; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input[type="search"] { min-width: 220px; flex: 1 1 220px; }
.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; }
.inline { display: inline-block; margin: 0 4px 0 0; }
.inline-edit { display: flex; gap: 8px; align-items: center; flex: 1; }

/* --- Messages flash ------------------------------------------------ */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.flash--success { background: #dcfce7; color: #166534; }
.flash--error { background: #fee2e2; color: #991b1b; }
.flash--info { background: #dbeafe; color: #1e40af; }
/* Bandeau de rappel "confirmez votre email" (includes/header_admin.php) :
   texte + bouton "renvoyer" sur la même ligne, empilés sur mobile. */
.flash--with-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flash--with-action form { margin: 0; }

/* --- Badges --------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-border);
    color: var(--color-text);
}
.badge--ok { background: #dcfce7; color: #166534; }
.badge--basique { background: #e5e7eb; }
.badge--silver { background: #e0e7ff; color: #3730a3; }
.badge--gold { background: #fef3c7; color: #92400e; }
.badge--statut-en_attente { background: #fef3c7; color: #92400e; }
.badge--statut-en_cours { background: #dbeafe; color: #1e40af; }
.badge--statut-termine { background: #dcfce7; color: #166534; }
.badge--statut-annule { background: #fee2e2; color: #991b1b; }
.badge--superadmin { background: #1e1b2e; color: #fff; }

/* --- Page publique / landing ---------------------------------------- */
.landing-header, .admin-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: relative;
}
.admin-topbar__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.landing-header__brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; color: var(--color-primary); }
.brand-logo { height: 30px; width: auto; display: block; flex-shrink: 0; border-radius: 6px; }
.landing-header nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* --- Zone super-admin : accent visuel distinct pour ne jamais confondre
   avec le tableau de bord d'un établissement. Placé après la règle
   .admin-topbar ci-dessus (même spécificité) afin que le fond sombre ne
   soit pas réécrit par elle. --------------------------------------------- */
.admin-topbar--superadmin {
    background: #1e1b2e;
    border-bottom: 3px solid #7c3aed;
}
.admin-topbar--superadmin a,
.admin-topbar--superadmin .admin-topbar__user span,
.admin-topbar--superadmin .admin-topbar__brand { color: #f5f3ff; }
.admin-topbar--superadmin .admin-topbar__nav a { color: #d8b4fe; }

/* --- Sélecteur de langue / devise (menu déroulant façon versamorph.com) */
.lang-switcher, .currency-switcher { display: inline-flex; flex-wrap: nowrap; flex-shrink: 0; gap: 6px; align-items: center; margin: 0; }
.lang-switcher__select, .currency-switcher__select {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 6px 30px 6px 12px;
    min-height: 36px;
    cursor: pointer;
    white-space: nowrap;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 7px;
}
.lang-switcher__select:hover, .currency-switcher__select:hover { border-color: var(--color-primary); }
.lang-switcher__select:focus, .currency-switcher__select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.page-lang-switcher { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px 20px 0; }
.switchers-group { display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; gap: 10px; }
.switchers-group::after { content: ''; display: inline-block; width: 1px; height: 14px; background: var(--color-border); margin: 0 2px; flex-shrink: 0; }
.switchers-group:last-child::after { display: none; }

/* Bannière illustrée (une image par langue) au-dessus du hero. Cachée sur
   mobile car le texte qu'elle contient devient illisible en dessous de sa
   largeur d'origine : le vrai titre/texte (accessible, indexable) prend le
   relais via .hero__intro sur petit écran. */
.hero-banner { line-height: 0; }
.hero-banner__img { display: block; width: 100%; height: auto; }

.hero { text-align: center; padding: 64px 24px; max-width: 720px; margin: 0 auto; }
.hero p { font-size: 18px; color: var(--color-muted); margin-bottom: 24px; }

/* Repli texte de la bannière : masqué visuellement mais présent pour le
   SEO/l'accessibilité tant que la bannière image est affichée (tablette/PC) */
.hero__intro {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; white-space: nowrap; clip: rect(0, 0, 0, 0); border: 0;
}

.how-it-works { padding: 48px 24px; max-width: 960px; margin: 0 auto; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 32px; }
.step { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.step__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--color-primary); color: #fff; font-weight: 700; margin-bottom: 12px;
}

.plans { padding: 48px 24px; max-width: 1100px; margin: 0 auto; text-align: center; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 24px; text-align: left; }
.plan-card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.plan-card--actif { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
/* Keeps the cycle toggle + CTA button (wrapped in .plan-card__footer)
   pinned to the bottom of the card, so the 3 "Choisir" buttons/badges
   stay on the same horizontal line even when plans have a different
   number of feature lines above - used on both index.php and
   admin/abonnement.php. */
.plans-grid .plan-card { display: flex; flex-direction: column; }
.plan-card__footer { margin-top: auto; }
.plan-card__prix { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.plan-card__prix-annuel { font-size: 13px; margin: 0 0 12px; }
.plan-card__cycle { display: flex; gap: 14px; margin-bottom: 10px; font-size: 13px; }
.plan-card__cycle label { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 0; font-weight: 400; }
/* Landing page price toggle (assets/js/pricing-toggle.js): highlights the
   price matching the mensuel/annuel radio currently selected, without
   hiding the other one (avoids awkward standalone wording of plan_par_an,
   whose text is written to follow the monthly price). */
.plan-card__prix--muted { font-size: 13px; font-weight: 400; color: var(--color-muted); margin-bottom: 0; }
.plan-card__prix-annuel--active { font-size: 20px; font-weight: 700; color: inherit; margin: 0 0 2px; }
.plan-card ul { padding-left: 18px; margin-bottom: 16px; color: var(--color-muted); font-size: 14px; }
.plan-card li { margin-bottom: 6px; }
/* Choix obligatoire de l'abonnement à l'inscription (auth/inscription.php) :
   chaque .plan-card est ici un <label> enveloppant un radio, cliquable sur
   toute sa surface - :has() met en évidence la carte cochée sans JS.
   Sélecteur ".plans-grid .plan-card--selectable" (et non juste
   ".plan-card--selectable") pour l'emporter sur ".plans-grid .plan-card"
   (même spécificité, 2 classes) qui met sinon la carte en flex-column et
   étire le radio sur toute la largeur de la carte. */
.plans-grid .plan-card--selectable { display: block; cursor: pointer; }
.plan-card--selectable .plan-card__radio { width: auto; margin-right: 8px; vertical-align: middle; }
.plan-card--selectable strong { vertical-align: middle; }
.plan-card--selectable .plan-card__prix { margin-top: 10px; }
.plan-card--selectable:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

.landing-footer { text-align: center; padding: 24px; color: var(--color-muted); font-size: 13px; }
.landing-footer__links { margin-top: 6px; }
.landing-footer__links a { margin: 0 6px; }

/* --- Legal pages (privacy policy...) ----------------------------------- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; }
.legal-page__inner h1 { margin-bottom: 4px; }
.legal-page__inner h2 { margin-top: 32px; margin-bottom: 8px; font-size: 18px; }
.legal-page__inner p, .legal-page__inner li { line-height: 1.6; color: var(--color-text); }
.legal-page__inner ul { padding-left: 20px; margin: 8px 0; }
.legal-page__inner li { margin-bottom: 8px; }

/* --- Auth ------------------------------------------------------------ */
.auth-page { max-width: 420px; margin: 60px auto; padding: 0 20px; }
/* Inscription (auth/inscription.php) : formulaire plus long que connexion/mot
   de passe oublié (coordonnées + choix d'abonnement), élargi sur écran
   standard pour que les 3 tuiles d'abonnement tiennent sur une seule ligne
   plutôt que de s'empiler inutilement dans une colonne étroite. En dessous de
   720px, .plans-grid repasse déjà à 1 colonne (voir media query ci-dessous),
   donc cet élargissement n'a d'effet que sur les écrans qui ont la place. */
.auth-page--inscription { max-width: 900px; }
.auth-page__logo { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 24px; color: var(--color-primary); margin-bottom: 24px; }
.auth-card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 32px; }
.auth-card form { margin-top: 20px; }
.auth-card button { width: 100%; }
.auth-card form.inline { margin-top: 0; }
.auth-card form.inline button { width: auto; }

/* --- Profil (propriétaire / personnel) --------------------------------- */
.profil-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.profil-grid .auth-card { padding: 24px; }
.profil-grid h2 { margin-top: 0; font-size: 17px; }

/* Sections repliables (propriétaire : établissement / compte / mot de passe /
   abonnement), avec <details>/<summary> natifs pour l'expand/collapse. */
.profil-accordion { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.profil-section {
    background: var(--color-card); border: 1px solid var(--color-border);
    border-radius: var(--radius); overflow: hidden;
}
.profil-section summary {
    cursor: pointer; padding: 18px 24px; font-weight: 700; font-size: 16px;
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
}
.profil-section summary::-webkit-details-marker { display: none; }
.profil-section summary::after {
    content: '+'; font-size: 20px; font-weight: 400; color: var(--color-muted);
    flex-shrink: 0; margin-left: 12px;
}
.profil-section[open] summary::after { content: '\2212'; }
.profil-section[open] summary { border-bottom: 1px solid var(--color-border); }
.profil-section__body { padding: 20px 24px 24px; }
.profil-section__body form { margin: 0; }
.profil-section__body label:last-of-type { margin-bottom: 18px; }

/* --- Admin ------------------------------------------------------------ */
.admin-topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--color-primary); flex-shrink: 0; }
.admin-topbar__nav {
    display: flex; gap: 20px; font-size: 14px; font-weight: 600;
    flex: 1 1 auto; min-width: 0;
}
.admin-topbar__nav a { white-space: nowrap; }
.admin-topbar__user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--color-muted); flex-wrap: wrap; justify-content: flex-end; }
.admin-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-card);
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.admin-topbar--superadmin .admin-topbar__toggle { background: transparent; border-color: #7c3aed; color: #f5f3ff; }

/* --- Ad slots (AdSense, Basic plan only) -------------------------------- */
.ad-slot {
    max-width: 728px;
    margin: 16px auto;
    padding: 6px 0;
    text-align: center;
    overflow: hidden;
}
.ad-slot__label {
    margin: 0 0 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
}
/* Compact slot (service call page): narrowing the container is the
   AdSense-approved way to shrink a responsive ad (as opposed to
   hiding/clipping the ad via CSS, which is against their policy). */
.ad-slot--compact { max-width: 320px; margin: 10px auto; padding: 2px 0; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.admin-footer { text-align: center; padding: 24px; color: var(--color-muted); font-size: 13px; }
.page-head { margin-bottom: 24px; }

/* Tableaux scrollables horizontalement sur petit écran plutôt que débordement */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive .table { min-width: 480px; }
.table td.table-message { max-width: 360px; white-space: pre-wrap; word-break: break-word; }

/* --- Appels (dashboard) ------------------------------------------------ */
.appels-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.appel-card {
    background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.appel-card--en_attente { border-left: 4px solid var(--color-warning); }
.appel-card--en_cours { border-left: 4px solid var(--color-primary); }
.appel-card--termine { border-left: 4px solid var(--color-success); opacity: .7; }
.appel-card--annule { border-left: 4px solid var(--color-danger); opacity: .6; }
.appel-card header { display: flex; justify-content: space-between; align-items: center; }
.appel-card__point { font-weight: 700; font-size: 16px; }
.appel-card__bouton { font-weight: 600; margin: 0; }
.appel-card__meta { font-size: 13px; color: var(--color-muted); margin: 0; }
.appel-card__reponse { font-size: 14px; margin: 0; }
.appel-card__form { display: flex; flex-direction: column; gap: 8px; flex: 1 1 100%; }
.appel-card__form input { width: 100%; }
.appel-card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.appel-card__actions > .btn { flex: 0 0 auto; }
.appel-card__assign select { width: 100%; }
.appel-card__form--locked input:disabled { background: var(--color-border); color: var(--color-muted); cursor: not-allowed; }
.locked-feature {
    font-size: 12px; color: var(--color-warning); background: #fef3c7;
    border-radius: var(--radius); padding: 6px 10px; margin: 0;
}
.locked-feature a { color: var(--color-warning); font-weight: 600; text-decoration: underline; }

/* --- Points de service / QR ------------------------------------------- */
.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.point-card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; text-align: center; }
.point-card--inactif { opacity: .5; }
.point-card__qr { display: flex; justify-content: center; margin: 12px 0; }
.point-card__url { font-size: 11px; word-break: break-all; }
.point-card__option {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
    font-size: 13px; font-weight: 400; color: var(--color-muted); margin: 8px 0 0;
}
.point-card__option input { margin: 0; }
.point-card__actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* Encadré fin autour d'Imprimer / Télécharger / Inclure le titre, pour les
   distinguer visuellement des actions de gestion (Désactiver, Supprimer). */
.point-card__export {
    border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 10px 12px; margin-top: 10px;
}
.point-card__export .point-card__actions { margin-top: 0; }
.point-card__export .point-card__option { margin-top: 8px; }

/* --- Boutons d'appel ---------------------------------------------------- */
.boutons-list { display: flex; flex-direction: column; gap: 10px; }
.bouton-row { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px 16px; }
.bouton-row--inactif { opacity: .5; }
.bouton-row__label { font-weight: 600; flex: 1; }
.bouton-row__main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bouton-row__traductions { margin-top: 10px; }
.bouton-row__traductions summary { cursor: pointer; font-size: 13px; color: var(--color-muted); }
.bouton-row__traductions-body { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.bouton-row__traductions-body label { font-size: 13px; font-weight: 600; flex: 1 1 160px; margin-bottom: 0; }

/* --- Tableaux --------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.table th { background: var(--color-bg); font-weight: 700; }
.table__actions { display: flex; gap: 6px; }

/* --- Pagination (admin/archives.php...) -------------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pagination__link { padding: 6px 14px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-card); color: var(--color-text); text-decoration: none; font-size: 14px; }
.pagination__link:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination__link--disabled { color: var(--color-muted); cursor: not-allowed; opacity: .5; }
.pagination__link--disabled:hover { border-color: var(--color-border); color: var(--color-muted); }
.pagination__status { font-size: 14px; color: var(--color-muted); }

/* --- Page client (scan QR) --------------------------------------------- */
.client-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh; /* évite que la barre d'adresse mobile masque le contenu */
    padding: 24px;
}
/* Variant used when the page has extra siblings above/below .client-page
   (language switcher, ad slots on public/appel.php): the body itself
   becomes the full-height flex column, and .client-page just fills the
   remaining space and centers the card within it - avoids stacking two
   independent 100vh boxes, which pushed the card down and forced a scroll
   for no reason. */
.client-body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.client-body .client-page { flex: 1 1 auto; min-height: 0; }
.client-card { background: var(--color-card); border-radius: 16px; padding: 32px 24px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.client-card__etablissement { color: var(--color-muted); font-weight: 600; margin: 0 0 4px; }
.client-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.client-btn {
    padding: 18px; font-size: 17px; font-weight: 700; border-radius: 14px;
    border: none; background: var(--color-primary); color: #fff; cursor: pointer;
}
.client-btn:active { background: var(--color-primary-dark); }
.client-btn:disabled { opacity: .6; }
.client-status { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.client-status__titre { font-weight: 700; font-size: 17px; margin: 0; }
.client-status__detail { margin: 0; }
.spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 4px solid var(--color-border); border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive ---------------------------------------------------------
 * Trois paliers : tablette (≤1024px), mobile (≤720px), petit mobile (≤380px).
 * Approche : conteneurs qui passent en colonne, boutons pleine largeur,
 * cibles tactiles agrandies, navigation en bandeau défilant plutôt que
 * tronquée ou superposée.
 * ------------------------------------------------------------------------- */

/* Tablette : resserre les marges, passe certaines grilles à 2 colonnes,
   et bascule le menu admin en bouton hamburger (le nombre de liens ne
   tient plus sur une seule ligne sans provoquer de débordement/scrollbar) */
@media (max-width: 1024px) {
    .admin-main { padding: 24px 18px; }
    .hero { padding: 48px 20px; }
    .how-it-works, .plans { padding: 40px 20px; }
    .points-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

    .admin-topbar__toggle { display: inline-flex; }
    .admin-topbar__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 2px;
        background: var(--color-card);
        border: 1px solid var(--color-border);
        border-top: none;
        padding: 8px;
        box-shadow: 0 12px 20px rgba(0, 0, 0, .12);
        z-index: 30;
        max-height: 70vh;
        overflow-y: auto;
    }
    .admin-topbar__nav.is-open { display: flex; }
    .admin-topbar__nav a { padding: 10px 8px; border-radius: 6px; }
    .admin-topbar__nav a:hover, .admin-topbar__nav a:focus-visible { background: var(--color-border); }
    .admin-topbar--superadmin .admin-topbar__nav { background: #1e1b2e; border-color: #7c3aed; }
    .admin-topbar--superadmin .admin-topbar__nav a:hover,
    .admin-topbar--superadmin .admin-topbar__nav a:focus-visible { background: #322a52; }
}

/* Mobile : navigation empilée / défilante, formulaires en colonne, cibles tactiles élargies */
@media (max-width: 720px) {
    body { font-size: 15px; }

    .landing-header, .admin-topbar { padding: 12px 16px; }
    .admin-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .admin-topbar__top { width: 100%; }
    .admin-topbar__user { justify-content: space-between; width: 100%; }

    .landing-header { flex-wrap: wrap; }
    .landing-header nav { width: 100%; justify-content: space-between; }
    .landing-header .switchers-group { flex-basis: 100%; justify-content: center; order: -1; margin-bottom: 4px; }

    /* Cibles tactiles ≥44px et font-size 16px (anti-zoom iOS) sur les menus déroulants langue/devise */
    .lang-switcher__select, .currency-switcher__select {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 32px 10px 12px;
    }

    /* La bannière image devient illisible en dessous de sa largeur d'origine :
       on la cache et on affiche le vrai titre/texte à la place */
    .hero-banner { display: none; }
    .hero__intro {
        position: static; width: auto; height: auto; margin: 0; padding: 0;
        overflow: visible; white-space: normal; clip: auto;
    }

    .hero { padding: 40px 16px; }
    .hero h1 { font-size: 26px; }
    .how-it-works h2, .plans h2 { font-size: 22px; }
    .how-it-works, .plans { padding: 32px 16px; }
    .steps { grid-template-columns: 1fr; }
    .plans-grid, .points-grid, .appels-list { grid-template-columns: 1fr; }

    .auth-page { margin: 32px auto; }
    .auth-card { padding: 24px 20px; }

    /* Formulaires empilés, boutons pleine largeur et cibles tactiles ≥44px */
    .inline-form, .form-grid { flex-direction: column; align-items: stretch; }
    .inline-form input[type="text"], .form-grid input { min-width: 0; width: 100%; }
    .inline-form .btn, .form-grid .btn { width: 100%; }
    .inline-edit { flex-direction: column; align-items: stretch; }
    .bouton-row__main { flex-wrap: wrap; }
    .bouton-row__main form.inline-edit { flex-basis: 100%; }

    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .btn--sm { min-height: 38px; }
    input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], select {
        min-height: 44px;
        font-size: 16px; /* évite le zoom automatique iOS au focus */
    }

    .appel-card__actions .btn { flex: 1 1 auto; }
    .table__actions { flex-wrap: wrap; }

    .point-card__actions .btn { flex: 1 1 auto; }

    .page-lang-switcher { padding: 12px 16px 0; flex-wrap: wrap; }
}

/* Petit mobile (téléphones étroits, ~320-380px) */
@media (max-width: 380px) {
    .client-card { padding: 24px 16px; }
    .client-btn { padding: 16px; font-size: 16px; }
    .auth-card { padding: 20px 16px; }
    .plan-card, .step, .point-card, .appel-card { padding: 16px; }
}
