*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Poppins','Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(135deg,#e8f0e3 0%,#f5f1e8 50%,#e3e8df 100%);min-height:100vh;overflow-x:hidden;overflow-y:auto}
html{font-size:100%}
body{line-height:1.5}
h1,h2,h3{line-height:1.2}
.text-lg{font-size:clamp(1.125rem,1.2rem+0.5vw,1.375rem)}
.text-xl{font-size:clamp(1.25rem,1.1rem+1.2vw,1.75rem)}
.text-2xl{font-size:clamp(1.75rem,1.4rem+2.2vw,2.75rem)}
.text-3xl{font-size:clamp(2rem,1.5rem+3vw,3.25rem)}
.container{position:relative;width:100%;min-height:100svh;height:auto;background:linear-gradient(135deg,rgba(143,168,130,0.05)0%,rgba(245,241,232,0.3)50%,rgba(143,168,130,0.08)100%)}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #8fa882;
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 24px;
    color: white;
}

.logo-text {
    font-weight: 300;
}

.logo-text-bold {
    font-weight: 600;
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.connect-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-icon {
    font-size: 16px;
}

/* Menu section */
.menu-section {
    position: absolute;
    left: 54px; /* Centered between left edge (0px) and vertical line (108px) */
    top: 120px;
    z-index: 3;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    color: #2c2c2c;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: #2c2c2c;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-text {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-btn:hover .hamburger span {
    background-color: #8fa882;
}

.menu-btn:hover .menu-text {
    color: #8fa882;
}

/* Contenu principal */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100svh - 200px);
    padding: 0 24px;
    position: relative;
    overflow: hidden;
}

.main-action-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #a8b89a;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    color: #2c2c2c;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 520px;
    justify-content: center;
}

.main-action-btn:hover {
    background-color: #9aab8c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.arrow {
    font-size: 24px;
    color: #2c2c2c;
}

/* Icône des livres */
.books-icon {
    display: flex;
    gap: 3px;
    align-items: flex-end;
}

.book {
    width: 12px;
    height: 16px;
    background-color: #2c2c2c;
    border-radius: 1px;
    position: relative;
}

.book:nth-child(1) {
    height: 14px;
    background-color: #6b7a5e;
}

.book:nth-child(2) {
    height: 18px;
    background-color: #2c2c2c;
}

.book:nth-child(3) {
    height: 16px;
    background-color: #5a6b4d;
}

/* Responsive */
@media (max-width: 768px) {
    .vertical-line {
        /* On mobile/tablette: transform the vertical divider into a horizontal rule above bottom nav */
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        height: 2px;
        bottom: calc(64px + 8px); /* just above the bottom nav (64px high) */
        background-color: #2c2c2c;
        z-index: 2;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .menu-section {
        left: 10px;
        top: 88px;
    }
}

@media (max-width: 480px) {
    .main-action-btn {
        font-size: 14px;
        padding: 15px 25px;
        flex-direction: column;
        gap: 10px;
    }
    
    .menu-section {
        position: relative;
        left: 0;
        top: 0;
        padding: 20px;
    }
}

/* ==========================
   Auth page components
   ========================== */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    border: none;
    cursor: pointer;
    color: #1f241d;
    background-color: #a8b89a;
    padding: 18px 28px;
    border-radius: 24px;
    font-size: 20px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-btn .icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
}

.auth-btn.primary {
    border-radius: 28px;
    padding: 20px 34px;
    background-color: #9db08f; /* légèrement plus foncé pour le bouton principal */
    box-shadow: 0 8px 22px rgba(0,0,0,0.14);
}

.auth-btn.secondary {
    border-radius: 28px;
    padding: 14px 26px;
    background-color: #a8b89a;
    box-shadow: 0 10px 0 rgba(0,0,0,0.12);
}

.auth-btn:hover {
    transform: translateY(-2px);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 768px) {
    .auth-btn {
        font-size: 18px;
        padding: 16px 24px;
    }
    .auth-btn.primary {
        padding: 18px 28px;
    }
}

@media (max-width: 480px) {
    .auth-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================
   Auth Card + Forms
   ========================== */
.auth-card {
    background: #9db08f;
    padding: 36px 42px;
    border-radius: 26px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
    min-width: 360px;
}

.auth-title {
    font-size: 34px;
    font-weight: 600;
    color: #10140f;
    margin-bottom: 18px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 4px;
    border: 2px solid #6c7568;
    background: #d9d9d9;
    color: #1d221a;
    outline: none;
}

.input-group.password .toggle-password {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}

.btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 6px;
    border: 2px solid #2c2c2c;
    background: #d9d9d9;
    color: #1f241d;
    font-weight: 600;
    cursor: pointer;
    align-self: center;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    padding: 8px;
}

.auth-text {
    color: #2c2c2c;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 8px;
    border-radius: 3px;
    text-shadow: none;
    margin-right: 8px;
    display: inline;
}

/* Style des liens défini plus bas dans le fichier */

.hidden { display: none; }

.form-error {
    color: #5b0a0a;
    background: rgba(255,0,0,0.08);
    border: 1px solid rgba(255,0,0,0.25);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .auth-card { width: 100%; min-width: unset; margin: 0 16px; padding: 26px; }
    .auth-title { font-size: 28px; }
}

/* ==========================
   Dashboard: Left rail & Drawer
   ========================== */
.left-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 108px; /* align with vertical-line */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 90px; /* below header */
    padding-bottom: 20px;
    gap: 22px;
    z-index: 3;
}

.left-rail .menu-btn {
    background: none;
}

.rail-icons {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 10px;
}

.rail-icon, .rail-avatar {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 12px;
}

.rail-avatar {
    margin-top: auto;
    margin-bottom: 16px;
}

.rail-icon:hover, .rail-avatar:hover {
    background: rgba(0,0,0,0.05);
}

/* Convert left rail to a bottom navigation bar on small screens */
@media (max-width: 768px) {
    .left-rail {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        top: auto;
        width: 100%;
        height: 64px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 8px 12px;
        background: rgba(255,255,255,0.9);
        backdrop-filter: saturate(160%) blur(8px);
        -webkit-backdrop-filter: saturate(160%) blur(8px);
        border-top: 1px solid rgba(0,0,0,0.08);
    }
    .left-rail .menu-btn { display: none; }
    .rail-icons { flex-direction: row; gap: 12px; margin-top: 0; }
    .rail-icon, .rail-avatar { width: 48px; height: 48px; }
    .rail-avatar { margin: 0; }
}

/* Drawer */
.drawer {
    position: fixed;
    top: 64px; /* header height approx */
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background: #ffffff;
    box-shadow: 2px 0 20px rgba(0,0,0,0.15);
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 10;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.drawer.open {
    transform: translateX(0);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 6px;
}

.drawer-nav a {
    padding: 12px 10px;
    border-radius: 8px;
    color: #1f241d;
    text-decoration: none;
}

.drawer-nav a:hover {
    background: rgba(0,0,0,0.06);
}

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9;
}

/* ==========================
   Virtual Library (Borrow)
   ========================== */
.pill-header {
    background: #a8b89a;
    color: #10140f;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 26px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    display: inline-flex;
    gap: 8px;
}

.pill-header .city {
    color: #0b66c3; /* lien bleu comme la maquette */
}

.book-grid {
    width: min(1100px, 92vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px 36px;
    padding: 24px 8px 40px;
}

.book-card {
    background: #a1b38f;
    border-radius: 26px;
    padding: 22px 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 16px 30px rgba(0,0,0,0.15);
}

.book-cover {
    width: 160px;
    height: 200px;
    border-radius: 6px;
    background: linear-gradient(180deg, #d9e6f2 0%, #cde0ee 40%, #b7d0e3 40%, #cfe2ee 100%);
    position: relative;
}

.book-title {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .book-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .book-grid { grid-template-columns: 1fr; }
}

/* ==========================
   Modal & Toast
   ========================== */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index: 30;
}
.modal-backdrop.open { display:flex; }
.modal {
    background: #ffffff; border-radius: 18px; width: min(420px, 92vw); padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    max-height: 90vh; /* prevent full-page takeover on mobile */
    overflow: auto;   /* allow internal scroll */
}
.modal h3 { margin-bottom: 8px; }
.code-pill { font-size: 32px; letter-spacing: 8px; font-weight: 800; background:#a8b89a; color:#10140f; padding: 12px 16px; border-radius: 14px; text-align:center; }
.modal-actions { margin-top: 14px; display:flex; justify-content:flex-end; gap: 8px; }
.btn-outline { padding:8px 12px; border-radius:8px; border:1px solid #2c2c2c; background:transparent; cursor:pointer; }

/* Touch target improvements */
.btn, .btn-outline, .main-action-btn, .auth-btn, .scan-btn { min-height: 44px; }
.rail-icon, .rail-avatar { min-width: 44px; min-height: 44px; }

/* Improve search surface spacing on narrow screens */
@media (max-width: 560px) {
    .search-surface { padding: 16px; }
    .search-bar { padding: 8px 10px; }
    .search-bar input { font-size: 16px; }
}

.toast { 
  position: fixed; 
  bottom: 50%; 
  left: 50%; 
  transform: translate(-50%, 50%) translateY(10px); 
  background:#2c2c2c; 
  color:#fff; 
  padding: 16px 24px; 
  border-radius: 12px; 
  opacity:0; 
  transition: all .3s; 
  z-index: 100000; 
  font-size: 16px;
  font-weight: 600;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.toast.show { opacity:1; transform: translate(-50%, 50%) translateY(0); }

/* Types de toast */
.toast.error { 
  background: linear-gradient(135deg, #e74c3c, #c0392b); 
  color: white;
}
.toast.warning { 
  background: linear-gradient(135deg, #f39c12, #e67e22); 
  color: white;
}
.toast.info { 
  background: linear-gradient(135deg, #3498db, #2980b9); 
  color: white;
}
.toast.success { 
  background: linear-gradient(135deg, #27ae60, #229954); 
  color: white;
}

/* ==========================
   Theme variables & Modern overrides
   ========================== */
:root {
    --bg: #f5f1e8;           /* beige */
    --primary: #a8b89a;      /* vert clair */
    --accent: #8fa882;       /* vert bandeau */
    --ink: #2c2c2c;          /* texte sombre */
    --muted-ink: #10140f;
    --shadow: 0 10px 30px rgba(0,0,0,.15);
    --shadow-lg: 0 30px 80px rgba(0,0,0,.28);
    --radius: 18px;
}

body { background: var(--bg); }

/* Header modern glass */
.header {
    box-shadow: 0 4px 18px rgba(0,0,0,.12);
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.header.glass {
    backdrop-filter: saturate(160%) blur(6px);
    -webkit-backdrop-filter: saturate(160%) blur(6px);
}

/* Buttons */
.connect-btn {
    background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.18));
    border: 1px solid rgba(255,255,255,.45);
    min-height: 44px; /* touch target */
}
.connect-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Header actions container */
.header-actions { display: flex; gap: 10px; align-items: center; }

.main-action-btn {
    background: linear-gradient(135deg, #8fa882 0%, #a8b89a 100%);
    box-shadow: 0 10px 30px rgba(143, 168, 130, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}
.main-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}
.main-action-btn:hover::before {
    left: 100%;
}
.main-action-btn:hover { 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: 0 15px 40px rgba(143, 168, 130, 0.45), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Inputs */
.input-group input {
    transition: box-shadow .2s ease, transform .12s ease, border-color .2s ease;
}
.input-group input:focus {
    border-color: #4e5f43;
    box-shadow: 0 0 0 4px rgba(167, 183, 156, .35);
    transform: translateY(-1px);
}

/* Cards */
.auth-card, .borrow-card, .surface, .book-surface, .search-surface {
    box-shadow: var(--shadow-lg);
    animation: fadeUp .6s ease both;
}
.book-card {
    transition: transform .18s ease, box-shadow .22s ease;
}
.book-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(0,0,0,.18); }

/* Rail & Drawer polish */
.left-rail { backdrop-filter: none; -webkit-backdrop-filter: none; }
.rail-icon, .rail-avatar { transition: transform .15s ease, background .2s ease; }
.rail-icon:hover, .rail-avatar:hover { transform: translateY(-2px); }
.drawer { background: #fcfcfc; }

/* Ensure SVG icons use theme ink color */
.rail-icon svg, .rail-avatar svg { stroke: var(--ink); }

/* Modal polish */
.modal { animation: scaleIn .2s ease both; }

/* Borrow detail description should scroll on small screens */
#detail-desc {
    max-height: 44vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
}

@media (max-width: 560px) {
    #detail-desc { max-height: 38vh; }
}

/* Simple animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Global Footer */
.site-footer {
    margin-top: 20px;
    padding: 16px 24px;
    background: rgba(0,0,0,0.04);
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--ink);
}
.site-footer a {
    color: #0b66c3;
    text-decoration: none;
    font-weight: 600;
}
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .site-footer { flex-direction: column; gap: 8px; text-align: center; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

.page-blocker {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(245,241,232,0.46);
    backdrop-filter: blur(1px);
}

.page-blocker__card {
    width: min(760px, 92vw);
    background: linear-gradient(180deg, rgba(143,168,130,0.10) 0%, #e8e7e6 34%, #e8e7e6 100%);
    border-radius: 26px;
    padding: 28px 24px;
    box-shadow: 0 22px 56px rgba(0,0,0,0.14), 0 10px 22px rgba(143,168,130,0.14);
    color: var(--ink);
    border: 1px solid rgba(143,168,130,0.28);
    box-shadow: 0 22px 56px rgba(0,0,0,0.14), 0 10px 22px rgba(143,168,130,0.14);
}

.page-blocker__header { display: flex; align-items: center; gap: 14px; }
.page-blocker__icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(143,168,130,0.28);
    color: var(--muted-ink);
    font-size: 24px;
    box-shadow: inset 0 0 0 1px rgba(143,168,130,0.35);
}

.page-blocker__title { margin: 0; font-weight: 800; color: var(--muted-ink); font-size: 28px; line-height: 1.15; }
.page-blocker__text { margin-top: 12px; font-size: 16px; line-height: 1.65; color: var(--ink); opacity: 0.92; }

.page-blocker__hint {
    margin-top: 14px;
    padding: 14px 14px;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    display: block;
    color: var(--ink);
}

.page-blocker__hint strong { color: var(--muted-ink); display: block; margin-bottom: 6px; }

.page-blocker__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.page-blocker__actions .btn-solid { padding-inline: 18px; }

@media (max-width: 520px) {
    .page-blocker { padding: 18px; }
    .page-blocker__card { padding: 22px 18px; border-radius: 22px; }
    .page-blocker__title { font-size: 22px; }
    .page-blocker__text { font-size: 15px; }
}

/* ==========================
   Global loading overlay
   ========================== */
.loading-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(245,241,232,0.65); backdrop-filter: blur(3px); z-index: 1000; }
.loading-overlay.show { display: flex; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 5px solid rgba(47,47,47,0.2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================
   Accessibility helpers
   ========================== */
.skip-link {
    position: absolute;
    left: 8px;
    top: -40px;
    background: var(--ink);
    color: #fff;
    padding: 8px 12px;
    z-index: 1000;
    border-radius: 6px;
}
.skip-link:focus { top: 8px; outline: 3px solid #0b66c3; }

/* ==========================
   Hero section (Accueil)
   ========================== */
.hero { 
    padding-block: clamp(28px, 6vh, 80px);
    position: relative;
    background: radial-gradient(ellipse at center, rgba(143, 168, 130, 0.08) 0%, transparent 70%);
}
.decor-circle { 
    position: absolute; 
    right: -180px; 
    top: -120px; 
    opacity: .12;
    filter: blur(2px);
}
.decor-circle circle { 
    fill: #8fa882;
    filter: drop-shadow(0 0 50px rgba(143, 168, 130, 0.3));
}
.hero-inner { display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; max-width: 840px; z-index: 1; padding: 0 20px; }
.hero-title { 
    font-weight: 800; 
    color: var(--muted-ink); 
    font-size: clamp(1.5rem, 4vw, 2.75rem);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.hero-subtitle { 
    color: var(--ink); 
    opacity: .85; 
    max-width: 680px; 
    font-size: clamp(0.95rem, 3vw, 1.125rem);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.hero-cta { 
    padding: 20px 40px; 
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    width: auto;
    max-width: 100%;
}

@media (max-width: 768px) {
    .hero-inner { padding: 0 15px; gap: 15px; }
    .hero-title { font-size: clamp(1.5rem, 6vw, 2rem); }
    .hero-subtitle { font-size: clamp(0.9rem, 4vw, 1rem); }
    .hero-cta { padding: 16px 32px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .hero-inner { padding: 0 10px; }
    .hero-title { font-size: 1.5rem; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-cta { padding: 14px 24px; font-size: 0.85rem; }
}

/* Generic stack center utility for pages */
.stack-center { display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ==========================
   Map page
   ========================== */
.map-title {
    background: var(--primary);
    color: var(--muted-ink);
    font-weight: 600;
    text-align: center;
    padding: 18px;
    border-radius: 26px;
    width: min(700px, 80vw);
    margin: 18px auto 28px;
    box-shadow: var(--shadow);
}

.map-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.map-card {
    background: #9db08f; /* harmonized with other cards */
    padding: 24px;
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
}

#map {
    width: min(900px, 90vw);
    height: min(420px, 60vh);
    border-radius: 12px;
    border: 6px solid var(--accent);
}

@media (max-width: 560px) {
    #map { height: 50vh; }
}

/* ============ STYLES POUR L'AUTHENTIFICATION SÉCURISÉE ============ */

/* Messages d'authentification */
.auth-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.auth-message.error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-message.success {
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Google OAuth */
.google-auth-section {
    margin-bottom: 20px;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.google-signin-btn:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    background-color: #fafafa;
}

.google-signin-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Séparateur "ou" */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #6b7280;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    padding: 0 16px;
    background: #f5f1e8;
    font-weight: 500;
}

/* Informations de vérification */
.verification-info {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    text-align: center;
    border: 1px solid #d1d5db;
}

.verification-info strong {
    color: #8fa882;
    font-weight: 600;
}

/* Champ de code de vérification */
#verification-code {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

#verification-code:focus {
    border-color: #8fa882;
    background: white;
    box-shadow: 0 0 0 3px rgba(143, 168, 130, 0.1);
}

#verification-code::placeholder {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: normal;
    font-size: 14px;
}

/* Améliorations des boutons d'authentification */
.auth-form .btn-solid {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-form .btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(143, 168, 130, 0.3);
}

.auth-form .btn-solid:active {
    transform: translateY(0);
}

.auth-form .btn-solid:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Liens de navigation simplifiés mais visibles */
.auth-switch a {
    color: #1e3a21;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid #1e3a21;
}

.auth-switch a:hover {
    color: #0f1d11;
    text-decoration: underline;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.auth-switch a:active {
    color: #0f1d11;
    transform: translateY(0);
}

/* Animation pour le changement de panneau */
.auth-panel {
    transition: all 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

.auth-panel.hidden {
    transform: translateX(-20px);
    opacity: 0;
    pointer-events: none;
}

/* Responsive pour mobile */
@media (max-width: 480px) {
    .google-signin-btn {
        padding: 12px 14px;
        font-size: 14px;
        gap: 10px;
    }
    
    .google-signin-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .divider {
        margin: 20px 0;
    }
    
    .verification-info {
        padding: 16px;
        font-size: 13px;
    }
    
    #verification-code {
        font-size: 18px;
        letter-spacing: 2px;
    }
}

/* ============ STYLES POUR LES INFORMATIONS UTILISATEUR DANS LE HEADER ============ */

.user-info {
    transition: all 0.3s ease;
}

/* Responsive pour les informations utilisateur */
@media (max-width: 768px) {
    .user-info {
        font-size: 12px !important;
        margin-right: 5px !important;
    }
    
    .user-info div:first-child {
        font-size: 13px !important;
    }
    
    .user-info div:last-child {
        font-size: 11px !important;
    }
}

/* ==========================
   Styles pour l'expérience de scan améliorée
   ========================== */

/* Conteneur vidéo */
#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Zone de scan */
.scan-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  display: none;
  flex-direction: column;
  z-index: 1000;
  padding: 20px;
}

/* Bouton de scan */
.scan-btn {
  background: #8fb13a;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin: 10px 0;
  position: relative;
  overflow: hidden;
  z-index: 5;
}

.scan-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scan-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(143, 177, 58, 0.5);
}

/* Styles responsifs */
@media (max-width: 480px) {
  .scan-btn {
    font-size: 16px;
    padding: 14px 28px;
  }
}

/* Animation de scan */
@keyframes scanLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(143, 177, 58, 0.8);
  animation: scanLine 2s ease-in-out infinite;
  z-index: 20;
}

/* Message d'état du scan */
.scan-status {
  color: white;
  text-align: center;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

/* Bouton de fermeture */
.close-scan {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-scan:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg);
}

/* Styles pour les appareils mobiles */
@media (max-width: 480px) {
    .user-info {
        display: none !important;
    }
    
    /* Afficher seulement le prénom sur très petit écran */
    .header::after {
        content: attr(data-user-name);
        color: white;
        font-size: 12px;
        font-weight: 500;
        margin-right: 10px;
    }
}

/* Animation pour l'apparition des informations utilisateur */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-info.animate {
    animation: slideInFromRight 0.3s ease;
}

/* Icône profil dans le header */
.profile-icon-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(143, 168, 130, 0.1);
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.profile-icon-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    color: white !important;
}

/* Flèche de retour */
.back-arrow {
    position: fixed;
    top: 100px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(31, 36, 29, 0.9);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-arrow:hover {
    background: rgba(31, 36, 29, 1);
    transform: scale(1.05);
    color: white;
}
