/* ===== CSS VARIABLES ===== */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --secondary: #0ea5e9;
  --secondary-hover: #0284c7;
  --accent: #d946ef;
  --accent-hover: #c026d3;
  --accent-light: rgba(217, 70, 239, 0.15);
  --waiting: #71717a;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.12);
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #71717a;
  --text-light: #fafafa;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-primary-rgb: 255, 255, 255;
  --border-light: #e4e4e7;
  --border-medium: #d4d4d8;
  --logo-color: #ffffff;
  --accent-color: var(--accent);
  --accent-color-rgb: 217, 70, 239;
  --accent-color-dark: #b91cda;
  --accent-color-light: rgba(217, 70, 239, 0.15);
  --accent-text-color: white;
  --tooltip-bg: rgba(15, 23, 42, 0.9);
  --tooltip-color: #f8fafc;
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #f472b6 100%);
  --gradient-light: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  --gradient-dark: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --container-max: 1280px;
  --header-height: 4rem;
  --mobile-toolbar-height: 56px;
  --mobile-zoom-strip-height: 44px;
  --dark-bg-primary: #0f172a;
  --dark-bg-secondary: #334155;
  --dark-bg-elevated: #1e293b;
  --dark-text-primary: #f1f5f9;
  --dark-text-secondary: #94a3b8;
  --dark-text-tertiary: #cbd5e1;
  --dark-border-color: #334155;
  --dark-primary-accent: #60a5fa;
}

/* ===== DARK MODE VARIABLES ===== */
body.dark-mode {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  --logo-color: #ffffff;
}

.dark-mode {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.25);
  --secondary: #0ea5e9;
  --secondary-hover: #0284c7;
  --accent: #d946ef;
  --accent-hover: #c026d3;
  --accent-light: rgba(217, 70, 239, 0.25);
  --success-light: rgba(34, 197, 94, 0.15);
  --warning-light: rgba(245, 158, 11, 0.15);
  --error-light: rgba(239, 68, 68, 0.15);
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --text-light: #18181b;
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-tertiary: #374151;
  --bg-primary-rgb: 31, 41, 55;
  --border-light: #374151;
  --border-medium: #4b5563;
  --tooltip-bg: rgba(248, 250, 252, 0.9);
  --tooltip-color: #111827;
  --gradient-light: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

/* ===== GLOBAL RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ===== GLOBAL ELEMENTS ===== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--primary-hover);
}

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

button,
input {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

/* ===== UTILITY CLASSES ===== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hide-mobile {
  display: none !important;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* ===== BADGE COMPONENT ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  background-color: var(--primary-light);
  color: var(--primary);
}

/* ===== BUTTON COMPONENTS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-light);
  box-shadow: 0 2px 8px rgba(58, 134, 255, 0.25);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--secondary-hover);
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.35);
  transform: translateY(-2px);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-light);
  box-shadow: 0 2px 8px rgba(217, 70, 239, 0.25);
}

.btn-accent:hover,
.btn-accent:focus {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(217, 70, 239, 0.35);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover,
.btn-outline:focus {
  background-color: var(--bg-tertiary);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== BOUTONS DE FERMETURE UNIFORMISÉS ===== */
.close-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background-color: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  outline: none;
  font-size: 0;
}

.close-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.close-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.close-btn:active {
  transform: translateY(0);
  background-color: var(--bg-secondary);
}

.close-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
  transition: stroke var(--transition-normal);
}

/* Variantes de taille */
.close-btn.btn-sm {
  width: 2.7rem;
  height: 2.7rem;
}

.close-btn.btn-sm svg {
  width: 1rem;
  height: 1rem;
}

/* Specific positioning for panels */
.search-header .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.grid-header .close-btn {
  position: relative;
  margin-left: auto;
}

.embed-header .close-btn {
  position: relative;
}

/* Mode sombre */
.dark-mode .close-btn {
  border-color: var(--border-light);
  color: var(--text-primary);

}

.dark-mode .close-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.dark-mode .modal-close.close-btn {
  background-color: rgba(39, 39, 42, 0.9);
  border-color: var(--border-light);
}

.dark-mode .modal-close.close-btn:hover {
  background-color: rgba(39, 39, 42, 1);
}

/* Responsive */
@media (max-width: 768px) {
  .close-btn {
    width: 2.25rem;
    height: 2.25rem;
  }

  .close-btn svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .close-btn.btn-sm {
    width: 1.875rem;
    height: 1.875rem;
  }

  .close-btn.btn-sm svg {
    width: 0.875rem;
    height: 0.875rem;
  }
}

/* Improved interaction states */
.close-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.close-btn:disabled:hover {
  background-color: transparent;
  border-color: var(--border-light);
  color: var(--text-secondary);
}

/* Animation de fermeture */
@keyframes close-btn-press {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

.close-btn:active {
  animation: close-btn-press 0.1s ease-in-out;
}

/* ===== HEADER/TOPBAR ===== */
.topbar {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-light);
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--primary);
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform var(--transition-normal);
}

.logo:hover {
  transform: scale(1.05);
}

.logo span {
  font-weight: 400;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
  transition: color var(--transition-normal);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--text-primary);
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--primary);
  border: 1px solid var(--primary);
  background: transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.nav-auth-btn .user-status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--success, #10b981);
  box-shadow: 0 0 0 2px var(--bg-primary, #ffffff);
}

.dark-mode .nav-auth-btn .user-status-dot {
  box-shadow: 0 0 0 2px var(--dark-bg-primary, #0f172a);
}

.nav-auth-btn .user-display-name {
  white-space: nowrap;
}

.nav-auth-btn:hover,
.nav-auth-btn:focus {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary-hover);
}

.nav-auth-btn.is-logged-in {
  background: var(--bg-tertiary);
  border-color: transparent;
  color: var(--text-primary);
}

.nav-auth-btn.is-logged-in:hover,
.nav-auth-btn.is-logged-in:focus {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}

.dark-mode .nav-auth-btn.is-logged-in {
  background: var(--dark-bg-elevated, #1e293b);
  color: var(--dark-text-primary, #f8fafc);
}

.nav-user-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-user-btn:hover,
.nav-user-btn:focus {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}

.nav-user-btn::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--success, #10b981);
  box-shadow: 0 0 0 2px var(--bg-primary, #ffffff);
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===== MAIN DASHBOARD ===== */
.dashboard {
  flex: 1;
  padding: 3rem 0;
}

.intro-section {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.intro-section h2 {
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  font-weight: 700;
}

.intro-section p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 auto;
}

/* ===== PDF SELECTOR ===== */

/* 1. Carte plus moderne */


/* 2. Header avec icône */
.pdf-load-card .card-header.flex-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.pdf-load-card .pdf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3. Source selector amélioré */
.source-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /*! background: var(--bg-tertiary); */
  /*! padding: 0.75rem 1rem; */
  /*! margin-bottom: 1rem; */
}

.source-option {
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.source-option.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.source-option input:checked+label,
.source-option.active {
  background: var(--primary);
  color: #fff;
}

/* 4. Champ URL avec helper */
#pdf-url-wrapper .helper-text {
  font-size: 0.90em;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
}

/* 5. Drag & drop area */
.file-drop-area {
  width: 100%;
  min-height: 120px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 1.1rem;
  text-align: center;
  position: relative;
  padding: 2rem;
  outline: none;
}

.file-drop-area:hover,
.file-drop-area:focus {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-drop-area.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  transition: var(--transition-normal);
}

.file-drop-area:hover .upload-icon,
.file-drop-area.dragover .upload-icon,
.file-drop-area:focus .upload-icon {
  transform: scale(1.1);
  color: var(--secondary);
}

.file-drop-description {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.file-drop-area svg {
  width: 2.5rem;
  height: 2.5rem;
  stroke: var(--primary);
  transition: transform var(--transition-normal), stroke var(--transition-normal);
}

.file-drop-area:hover svg,
.file-drop-area:focus svg,
.file-drop-area.dragover svg {
  transform: scale(1.1);
  stroke: var(--secondary);
}

.upload-text {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.upload-formats {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-name {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08em;
  font-weight: 600;
  color: var(--primary);
  /*! margin: 0.5rem 0; */
  box-shadow: 0 2px 12px 0 rgba(99, 102, 241, 0.08);
  word-break: break-all;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  animation: fadeIn 0.25s;
  cursor: default;
}

#pdf-file-name:hover {
  color: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}


.file-error {
  display: none;
  opacity: 0;
  max-height: 0;
  font-size: 0.9em;
  color: #dc2626;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow: hidden;
  transition: opacity 0.3s ease-out, max-height 0.3s ease-out;
}

.file-error.active {
  display: flex;
  opacity: 1;
  max-height: 100px; /* Assez grand pour le contenu */
}

.file-error:not(.active) {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
}

.file-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 6. Bouton principal plus grand et centré */
.btn-lg {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* 7. Animation focus sur input */
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  transition: box-shadow 0.2s;
}


.pdf-selector {
  margin-bottom: 3rem;
}

#pdf-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
}

.input-wrapper {
  position: relative;
}

.input-wrapper label {
  display: block;
  /*! margin-bottom: 0.5rem; */
  font-weight: 500;
  font-size: 0.9375rem;
}

.input-wrapper .input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  transition: all var(--transition-normal);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  margin: 10px 0;
}

.input-wrapper .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-icon {
  position: absolute;
  left: 1rem;
  transform: translateY(calc(0.5rem / 2 + 0.9375em / 2));
  color: var(--text-secondary);
}

.input-wrapper label+.input+.input-icon {
  top: calc(0rem + 2.1em + 0.75rem + 0.1rem);
  transform: translateY(0);
}

.source-selector {
  display: inline-flex;
  border: 1px solid var(--border-light, #e4e4e7);
  overflow: hidden;
}

.source-selector input {
  display: none;
}

.source-selector label {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  user-select: none;
  transition: background-color 0.2s, color 0.2s;
}

.source-selector label.active {
  background: var(--primary);
  color: #fff;
}

.file-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-upload .file-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== FLIPBOOK PREVIEW ===== */
.flipbook-preview {
  margin-bottom: 3rem;
}

.card-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 3rem;
}

.uniform-card {
  width: 100%;
  max-width: 820px;
}

.hidden-preview {
  display: none;
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 2px var(--waiting);
  display: inline-block;
  transition: background 0.3s;
}

.status-indicator.success {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-light);
}

.status-indicator.error {
  background: var(--error);
  box-shadow: 0 0 0 2px var(--error-light);
}

.status-indicator.warning {
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--warning-light);
}

#status-text.warning {
  color: var(--warning);
}

#status-text.success {
  color: var(--success);
}

#status-text.error {
  color: var(--error);
}

/* ===== CANVAS OPTIMIZATIONS ===== */
.firefox-optimized canvas {
  image-rendering: optimizeSpeed;
  /* Fallback */
  image-rendering: -moz-crisp-edges;
  /* Firefox */
  image-rendering: -webkit-optimize-contrast;
  /* Webkit */
  image-rendering: crisp-edges;
  /* Standard */
  image-rendering: pixelated;
  /* Alternative */
}

.preview-container canvas {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-normal);
}

.preview-container canvas:hover {
  transform: translateY(-4px) scale(1.02);
}

/* ===== PREVIEW OVERLAY ===== */
.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(4px);
}

.preview-container:hover .preview-overlay {
  opacity: 1;
}

.preview-card {
  background-color: var(--bg-primary);
  /*! border-radius: var(--radius-lg); */
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid var(--border-light);
}

.hidden-preview {
  display: none;
}

.preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}


.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.preview-header h3 {
  margin: 0;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.preview-container {
  position: relative;
  padding: 2rem;
  display: flex;
  justify-content: center;
  background: var(--gradient-light);
  min-height: 300px;
  transition: background var(--transition-normal);
}

.preview-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 1rem;
}

.preview-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.meta-item svg {
  stroke: var(--text-tertiary);
}

.preview-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== LOADING COMPONENTS ===== */
.spinner {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--primary-light);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
  z-index: 1100;
}

#loading-wrapper {
  position: absolute;
  inset: 0;
  background: var(--gradient-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.upload-progress {
  position: absolute;
  inset: 0;
  background: var(--gradient-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.progress {
  width: 240px;
  height: 6px;
  background-color: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-inner);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s;
}

.loading-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: text-bottom;
  border: 2px solid var(--text-tertiary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-rotate .75s linear infinite;
}

/* ===== FLIPBOOK AREA ===== */
.flipbook-area {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flipbook-wrapper {
  flex: 1 1 auto;
  position: relative;
  padding: 2rem;
  justify-content: center;
  align-items: center;
  background: var(--gradient-light);
  overflow: hidden;
  scrollbar-width: none;
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flipbook-wrapper::-webkit-scrollbar {
  display: none;
}

.flipbook-wrapper.zoom-scroll {
  overflow: auto;
  cursor: grab;
}

.flipbook-wrapper.zoom-scroll::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

.flipbook-wrapper.zoom-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.flipbook-wrapper.zoom-scroll.dragging {
  cursor: grabbing;
}

.flipbook-embed {
  transition-property: transform, opacity, box-shadow;
  transition-duration: 250ms;
  transition-timing-function: ease-in-out;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: white;
  margin: 0 auto;
  flex-shrink: 0;
}

.flipbook-embed.zoom-scale {
  box-shadow: none;
  border-radius: 0;
}

.flipbook-embed .page {
  margin: 0 !important;
  border: none;
  overflow: hidden;
  background-color: #fff;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.flipbook-embed .page canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ===== GRID VIEW ===== */
#grid-view {
  position: absolute;
  inset: 0;
  background-color: rgba(248, 250, 252, 0.97);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  overflow: auto;
  padding: 2rem;
  z-index: 500;
}

.dark-mode #grid-view {
  background-color: rgba(24, 24, 27, 0.97);
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.grid-thumb {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-bounce);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.grid-thumb:hover {
  border-color: var(--primary);
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.grid-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 0.707;
  object-fit: cover;
}

.grid-thumb:hover img {
  filter: brightness(1.1);
}

.page-num {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* ===== EMBED CODE CONTAINER ===== */
#embed-code-container {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: 820px;
  margin: 1rem auto 3rem;
  background-color: var(--bg-primary);
  /*! border-radius: var(--radius-lg); */
  box-shadow: var(--shadow-xl);
  z-index: 30;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.embed-header h3 {
  margin: 0;
  flex: 1;
}

.embed-actions {
  display: flex;
  gap: 0.5rem;
}

#embed-code {
  padding: 1.5rem;
  margin: 0;
  background-color: #1e293b;
  color: #e2e8f0;
  overflow: auto;
  font-family: monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  max-height: 60vh;
  white-space: pre-wrap;
  /*! border-radius: 0 0 var(--radius-lg) var(--radius-lg); */
}


/* ===== PLACEHOLDER ===== */
.thumb-placeholder {
  width: 180px;
  height: 220px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===== FOOTER ===== */
.site-footer {
  background-color: var(--bg-primary);
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--border-light);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  flex: 1;
  min-width: 250px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--primary);
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform var(--transition-normal);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-column h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: color var(--transition-normal);
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links.is-empty {
  display: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.social-links a:hover {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: 0 2px 8px var(--primary-light);
}

.social-links a svg {
  stroke: currentColor;
  transition: stroke var(--transition-normal);
}

.social-links a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== TEXT LAYER ===== */
.textLayer {
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: hidden;
  opacity: 0.25;
  line-height: 1;
  forced-color-adjust: none;
  transform-origin: 0 0;
  caret-color: CanvasText;
  -webkit-text-size-adjust: none;
  /* Safari/Chrome */
  -moz-text-size-adjust: none;
  /* Firefox */
  -ms-text-size-adjust: none;
  /* IE/Edge */
  text-size-adjust: none;
  /* Standard */
}

.textLayer span,
.textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}

.textLayer .highlight {
  margin: -1px;
  padding: 1px;
  background-color: rgba(180, 0, 170, 0.2);
  border-radius: 4px;
}

.textLayer .highlight.appended {
  position: initial;
}

.textLayer .highlight.begin {
  border-radius: 4px 0 0 4px;
}

.textLayer .highlight.end {
  border-radius: 0 4px 4px 0;
}

.textLayer .highlight.middle {
  border-radius: 0;
}

.textLayer .highlight.selected {
  background-color: rgba(0, 100, 0, 0.2);
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(0, 150, 255, 0.4);
}

::-moz-selection {
  background: rgba(0, 150, 255, 0.4);
}

/* ===== SEARCH HIGHLIGHT LAYER ===== */
.search-highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.search-highlight {
  background-color: rgba(245, 158, 11, 0.4);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5);
  transition: all 0.3s ease;
  outline: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--text-primary);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.7);
  padding: 1px 0;
  backdrop-filter: brightness(120%);
  will-change: left, top, width, height;
  pointer-events: none !important;
}

.search-highlight-layer * {
  pointer-events: none !important;
}

.search-highlight.pulseHighlight {
  animation: pulse-highlight 1.8s ease-in-out infinite;
}

/* ===== CENTER HIGHLIGHT BUTTON ===== */
.center-highlight-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary, #6366f1);
  color: var(--text-light);
  border: none;
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease, right 0.3s ease;
  opacity: 0.9;
}

.center-highlight-btn.shifted-by-panel {
  right: calc(20px + 320px);
}

.center-highlight-btn:hover {
  transform: scale(1.1);
  opacity: 1;
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
}

.center-highlight-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== SEARCH NOTIFICATION ===== */
.search-notification { 
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.125rem;
  background-color: var(--bg-primary, #ffffff);
  border-radius: var(--radius-md, 0.5rem);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1050;
  opacity: 0;
  max-width: calc(100% - 40px);
  pointer-events: none;
}

.search-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.search-notification:not(.show) {
  transform: translateX(-50%) translateY(20px);
}

.search-notification.info {
  border-left: 4px solid var(--secondary, #0ea5e9);
}

.search-notification.success {
  border-left: 4px solid var(--success, #10b981);
}

.search-notification.warning {
  border-left: 4px solid var(--warning, #f59e0b);
}

.search-notification.error {
  border-left: 4px solid var(--error, #ef4444);
}

.notification-icon {
  font-size: 1.125rem;
}

.notification-message {
  font-size: 0.875rem;
  color: var(--text-primary, #1e293b);
  font-weight: 500;
}

/* ===== GLOBAL TOASTS ===== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  width: min(90vw, 420px);
  pointer-events: none;
  z-index: 11000;
}

.toast-notification {
  width: 100%;
  background: var(--toast-bg, rgba(15, 23, 42, 0.96));
  color: var(--toast-text, #f8fafc);
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: auto;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-notification-info {
  --toast-bg: rgba(37, 99, 235, 0.96);
  --toast-text: #f8fafc;
}

.toast-notification-warning {
  --toast-bg: rgba(217, 119, 6, 0.96);
  --toast-text: #0f172a;
}

.toast-notification-success {
  --toast-bg: rgba(22, 163, 74, 0.96);
  --toast-text: #f8fafc;
}

.toast-notification-error {
  --toast-bg: rgba(239, 68, 68, 0.96);
  --toast-text: #f8fafc;
}

.toast-dismiss {
  margin-left: auto;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.toast-dismiss:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.6);
  outline-offset: 2px;
}

.dark-mode .toast-notification {
  border-color: rgba(71, 85, 105, 0.35);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.55);
}

/* ===== LAYOUT ADJUSTMENTS ===== */
.flipbook-area.pushed .flipbook-wrapper {
  margin-right: 320px;
}

/* ===== FORM VALIDATION ===== */
input[type="text"].error,
input[type="url"].error {
  border-color: var(--error);
  background-color: var(--error-light);
  color: var(--error);
}

.input-wrapper .input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.btn:focus-visible,
.theme-toggle:focus-visible,
input[type=range]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible),
input[type=range]:focus:not(:focus-visible),
.input-wrapper .input:focus:not(:focus-visible) {
  outline: none;
}

/* ===== SCROLLBAR STYLES ===== */
/* ===== SCROLLBAR STYLES ===== */

/* Standard scrollbar properties (Firefox, newer browsers) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) var(--background-light);
}

/* WebKit-specific styles in a separate block */
/* These will be ignored by Firefox without errors */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}


/* ===== TRANSITIONS ===== */
.btn,
.theme-toggle,
.nav-link {
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-normal);
}

input[type="text"],
input[type="url"] {
  transition: border var(--transition-normal), box-shadow var(--transition-normal);
}

.loading-state {
  opacity: 0.6;
  pointer-events: none;
}

.content-loaded {
  opacity: 1;
  transition: opacity var(--transition-normal);
}

/* États des boutons pendant le chargement */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-highlight {

  0%,
  100% {
    background-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5), 0 0 8px rgba(245, 158, 11, 0.4);
  }

  50% {
    background-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.7), 0 0 15px rgba(245, 158, 11, 0.5);
  }
}

/* ===== MARKETING PAGES ===== */
.page-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-hero {
  padding: 4rem 0 3rem;
  background: var(--gradient-light);
}

.dark-mode .page-hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
}

.page-hero .container {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--secondary);
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin: 0 auto;
  max-width: 720px;
}

.section-block {
  padding: 4rem 0;
}

.section-block.subtle {
  background: var(--bg-secondary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.info-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dark-mode .info-card {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border-color);
}

.info-card h2 {
  font-size: 1.25rem;
}

.info-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.dark-mode .info-icon {
  background: rgba(99, 102, 241, 0.25);
  color: var(--dark-text-primary);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.info-list li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-list span {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.split-content,
.split-highlight {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dark-mode .split-content,
.dark-mode .split-highlight {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border-color);
}

.split-highlight {
  background: var(--primary-light);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.dark-mode .split-highlight {
  background: rgba(99, 102, 241, 0.25);
}

.split-highlight h3 {
  color: var(--primary);
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.pricing-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dark-mode .pricing-card {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border-color);
}

.pricing-card.highlight {
  background: var(--primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

.pricing-card.highlight .info-list li {
  color: rgba(255, 255, 255, 0.85);
}

.pricing-card.highlight .btn {
  background: #ffffff;
  color: var(--primary);
}

.pricing-value {
  font-size: 2rem;
  font-weight: 700;
}

.pricing-value span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.pricing-card.highlight .pricing-value span {
  color: rgba(255, 255, 255, 0.75);
}

.cta-section {
  background: var(--gradient-primary);
  color: #ffffff;
  padding: 4rem 0;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  padding: 3rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-xl);
}

.cta-card p {
  color: rgba(255, 255, 255, 0.85);
}

.cta-card .btn {
  background: #ffffff;
  color: var(--primary);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.contact-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dark-mode .contact-card {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border-color);
}

.contact-link {
  color: var(--primary);
  font-weight: 600;
}

.contact-form-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.contact-form-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-secondary);
}

.contact-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dark-mode .contact-form {
  background: var(--dark-bg-elevated);
  border-color: var(--dark-border-color);
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-secondary);
}

.timeline span {
  font-weight: 600;
  color: var(--primary);
  margin-right: 0.5rem;
}

/* ===== DARK MODE SPECIFIC STYLES ===== */
.dark-mode .loading-spinner {
  border-color: var(--dark-text-tertiary);
  border-right-color: transparent;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width:640px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr))
  }
}

@media (min-width:1024px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr))
  }
}

@media (max-width: 960px) {
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 940px) {
  .badge {
    font-size: 0.65em;
  }

  .container {
    padding: 0 1rem;
  }

  .flipbook-wrapper {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .flipbook-area.pushed {
    margin-right: 0;
  }

  .page-hero {
    padding: 3rem 0 2.5rem;
  }

  .cta-card {
    padding: 2rem;
    text-align: center;
    align-items: stretch;
  }

  .cta-card .btn {
    align-self: stretch;
  }
}

@media (max-width: 700px) {
  .intro-section h2 {
    font-size: 1.75rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
}

@media (max-width: 680px) {
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  :root {
    --mobile-toolbar-height: 52px;
    --mobile-zoom-strip-height: 40px;
  }

  .hide-mobile {
    display: none !important;
  }

  .section-block {
    padding: 3rem 0;
  }

  .contact-form {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-toolbar-height: 48px;
    --mobile-zoom-strip-height: 38px;
  }
}

@media (max-width: 400px) {
  .intro-section h2 {
    font-size: 1.2rem;
  }
}

/* ===== ADMIN TOGGLE BUTTON (simplifié) ===== */
.admin-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.admin-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.admin-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}
