/* ============================================================================
   CIELO — public/css/cielo.css — Version ZIP 2
   Charte Horizon : sable + indigo ocean, lagon, corail, or, turquoise
   Thème : [data-theme="dark"] sur <html>
   Whitelabel MSSP : --cielo-primary / --cielo-accent / --cielo-logo-url
   ============================================================================ */

/* =========== 1. FONT FACES ================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-weight: 500;
  font-style: italic;
  font-display: swap;
  src: url('../fonts/Fraunces-MediumItalic.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('../fonts/Fraunces-Italic.woff2') format('woff2');
}

/* =========== 2. VARIABLES & THEMES ======================================== */

:root {
  --h-bg:            #F8F5EE;
  --h-surface:       #FEFCF7;
  --h-surface-alt:   #F0ECE0;
  --h-border:        #E2DCCB;
  --h-border-strong: #C9C0A8;
  --h-text:          #0C1C2E;
  --h-text-muted:    #475569;
  --h-text-soft:     #94A3B8;
  --h-primary:       #0F766E;
  --h-primary-hover: #0D5F58;
  --h-primary-soft:  #CCFBF1;
  --h-primary-ink:   #FFFFFF;
  --h-accent:        #F43F5E;
  --h-accent-soft:   #FFE4E6;
  --h-gold:          #FCD34D;
  --h-success:       #059669;
  --h-success-soft:  #D1FAE5;
  --h-warning:       #D97706;
  --h-warning-soft:  #FEF3C7;
  --h-danger:        #DC2626;
  --h-danger-soft:   #FEE2E2;
  --h-info:          #0369A1;
  --h-info-soft:     #E0F2FE;

  --cielo-primary:   var(--h-primary);
  --cielo-accent:    var(--h-accent);
  --cielo-logo-url:  none;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --t-fast: 150ms;
  --t-theme: 250ms;
  --t-sig: 400ms;

  --shadow-sm: 0 1px 2px rgba(12, 28, 46, 0.05);
  --shadow-md: 0 4px 12px rgba(12, 28, 46, 0.08);
  --shadow-lg: 0 12px 28px rgba(12, 28, 46, 0.12);

  --font-sans: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', 'Georgia', serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.15);
  --focus-ring-strong: 0 0 0 3px rgba(15, 118, 110, 0.35);
}

[data-theme="dark"] {
  --h-bg:            #0C1C2E;
  --h-surface:       #162B43;
  --h-surface-alt:   #1F3956;
  --h-border:        #2A4365;
  --h-border-strong: #3B5579;
  --h-text:          #EDE9DB;
  --h-text-muted:    #B8C5D6;
  --h-text-soft:     #7A8CA8;
  --h-primary:       #14B8A6;
  --h-primary-hover: #2DD4BF;
  --h-primary-soft:  #134E4A;
  --h-primary-ink:   #0C1C2E;
  --h-accent:        #FB7185;
  --h-accent-soft:   #4C1D25;
  --h-gold:          #FBBF24;
  --h-success:       #10B981;
  --h-success-soft:  #064E3B;
  --h-warning:       #F59E0B;
  --h-warning-soft:  #451A03;
  --h-danger:        #EF4444;
  --h-danger-soft:   #450A0A;
  --h-info:          #38BDF8;
  --h-info-soft:     #0C4A6E;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);

  --focus-ring: 0 0 0 3px rgba(20, 184, 166, 0.25);
  --focus-ring-strong: 0 0 0 3px rgba(20, 184, 166, 0.5);
}

/* =========== 3. RESET & BASE ============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background-color: var(--h-bg);
  color: var(--h-text);
  min-height: 100vh;
  transition: background-color var(--t-theme) ease, color var(--t-theme) ease;
}
body, body * {
  transition-property: background-color, color, border-color, fill, stroke, box-shadow;
  transition-duration: var(--t-theme);
  transition-timing-function: ease;
}

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

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

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--h-primary-soft); color: var(--h-text); }

/* =========== 4. TYPOGRAPHIE =============================================== */

h1, h2, h3, h4 {
  font-weight: 500;
  color: var(--h-text);
  line-height: 1.2;
  letter-spacing: -0.2px;
}
h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(26px, 3.5vw, 34px);
  letter-spacing: -0.4px;
}
h1 em { font-style: italic; color: var(--cielo-primary); font-weight: 500; }

h2 { font-size: 22px; }
h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
h4 { font-size: 16px; }

p { color: var(--h-text); line-height: 1.55; }
p.muted { color: var(--h-text-muted); }

.font-serif { font-family: var(--font-serif); font-style: italic; }
.font-mono  { font-family: var(--font-mono); }

.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--h-text-soft);
}

/* =========== 5. LAYOUT & UTILITAIRES ====================================== */

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--space-6); }

.stack-1 > * + * { margin-top: var(--space-1); }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-8 > * + * { margin-top: var(--space-8); }

.row { display: flex; gap: var(--space-3); align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.spacer { flex: 1; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--h-text-muted); }
.text-soft   { color: var(--h-text-soft); }
.text-primary{ color: var(--cielo-primary); }
.text-accent { color: var(--cielo-accent); }

.hidden { display: none !important; }
.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;
}

/* =========== 6. COMPOSANTS ================================================ */

/* --- App shell --- */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}
.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--h-surface);
  border-bottom: 0.5px solid var(--h-border);
  z-index: 10;
}
.app-side {
  background: var(--h-surface);
  border-right: 0.5px solid var(--h-border);
  padding: var(--space-4) var(--space-2);
  overflow-y: auto;
}
.app-main {
  padding: var(--space-8) var(--space-8);
  max-width: 1200px;
  width: 100%;
}

/* --- Logo --- */
.logo {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: var(--cielo-primary);
  letter-spacing: -0.6px;
  line-height: 1;
}
.logo .dot { color: var(--cielo-accent); font-style: normal; }

/* --- Nav sidebar --- */
.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--h-text-soft);
  text-transform: uppercase;
  padding: 0 var(--space-3) var(--space-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--h-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav-item:hover {
  background: var(--h-surface-alt);
  color: var(--h-text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--h-primary-soft);
  color: var(--cielo-primary);
  font-weight: 500;
}
.nav-item .count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  background: var(--h-surface-alt);
  color: var(--h-text-soft);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
}
.nav-item.active .count { background: var(--cielo-primary); color: var(--h-primary-ink); }
.nav-sep { height: 0.5px; background: var(--h-border); margin: var(--space-3) var(--space-2); }

/* --- Header actions --- */
.header-right { display: flex; align-items: center; gap: var(--space-3); }

/* --- Avatar --- */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--h-primary-soft);
  color: var(--cielo-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  border: 0.5px solid var(--h-border);
  cursor: pointer;
  transition: border-color var(--t-fast);
  text-decoration: none;
}
.avatar:hover { border-color: var(--cielo-primary); text-decoration: none; }

/* --- Theme toggle --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-pill);
  color: var(--h-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.theme-toggle:hover { border-color: var(--cielo-primary); color: var(--cielo-primary); }
.theme-toggle .cielo-icon { width: 14px; height: 14px; transition: transform var(--t-theme) ease; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon,
:root:not([data-theme]) .theme-toggle .moon-icon { display: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--h-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .cielo-icon { width: 14px; height: 14px; }

.btn-primary { background: var(--cielo-primary); color: var(--h-primary-ink); border-color: var(--cielo-primary); }
.btn-primary:hover { background: var(--h-primary-hover); border-color: var(--h-primary-hover); }

.btn-ghost { border-color: var(--h-border); color: var(--h-text); }
.btn-ghost:hover { border-color: var(--cielo-primary); color: var(--cielo-primary); }

.btn-danger { background: var(--h-danger); color: #fff; border-color: var(--h-danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }

/* --- Inputs --- */
.field { display: block; margin-bottom: var(--space-4); }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--h-text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.2px;
}
.field-hint {
  display: block;
  font-size: 11px;
  color: var(--h-text-soft);
  margin-top: var(--space-1);
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--h-danger);
  margin-top: var(--space-1);
}

.input, .textarea, .select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--h-surface);
  color: var(--h-text);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.3;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-theme);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--h-border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--cielo-primary);
  box-shadow: var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--h-text-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--h-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.input[readonly] { background: var(--h-surface-alt); cursor: not-allowed; }

.textarea { min-height: 96px; resize: vertical; }

.input-wrap { position: relative; }
.input-wrap .cielo-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--h-text-soft);
  pointer-events: none;
  width: 16px; height: 16px;
}
.input-wrap .input { padding-left: 38px; }

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--h-text);
  user-select: none;
}
.checkbox input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-xs);
  background: var(--h-surface);
  cursor: pointer;
  position: relative;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.checkbox input[type="checkbox"]:checked {
  background: var(--cielo-primary);
  border-color: var(--cielo-primary);
}
.checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox input[type="checkbox"]:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* --- Cards --- */
.card {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.card-hover { cursor: pointer; }
.card-hover:hover { border-color: var(--cielo-primary); transform: translateY(-1px); }
.card-title { font-size: 14px; font-weight: 500; margin-bottom: var(--space-1); color: var(--h-text); }
.card-sub { font-size: 12px; color: var(--h-text-soft); }
.card-icon { width: 24px; height: 24px; color: var(--cielo-primary); margin-bottom: var(--space-3); }

/* --- Stat cards (ZIP 2) --- */
.stat-card {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--h-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  color: var(--cielo-primary);
  line-height: 1;
}
.stat-total {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 14px;
  color: var(--h-text-soft);
  font-weight: 400;
}

/* --- Tables (ZIP 2) --- */
.cielo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cielo-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: var(--h-text-muted);
  text-transform: uppercase;
  border-bottom: 0.5px solid var(--h-border);
  background: var(--h-surface-alt);
}
.cielo-table th:first-child { border-top-left-radius: var(--radius-lg); }
.cielo-table th:last-child  { border-top-right-radius: var(--radius-lg); }
.cielo-table td {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--h-border);
  vertical-align: middle;
  color: var(--h-text);
}
.cielo-table tbody tr:last-child td { border-bottom: none; }
.cielo-table tbody tr:hover { background: var(--h-surface-alt); }
.cielo-table-compact th, .cielo-table-compact td { padding: 8px 10px; font-size: 12px; }

/* --- Badges & pills --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.2px;
  border: 0.5px solid transparent;
}
.badge-neutral  { background: var(--h-surface-alt); color: var(--h-text-muted); border-color: var(--h-border); }
.badge-primary  { background: var(--h-primary-soft); color: var(--cielo-primary); border-color: rgba(15,118,110,0.2); }
.badge-success  { background: var(--h-success-soft); color: var(--h-success); }
.badge-warning  { background: var(--h-warning-soft); color: var(--h-warning); }
.badge-danger   { background: var(--h-danger-soft);  color: var(--h-danger); }
.badge-accent   { background: var(--h-accent-soft);  color: var(--cielo-accent); }
.badge-gold     { background: rgba(252, 211, 77, 0.2); color: #92400E; }
[data-theme="dark"] .badge-gold { color: var(--h-gold); }
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge-plain::before { display: none; }

/* --- GED (ZIP 3) : folder tiles --- */
.folder-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.folder-tile:hover {
  border-color: var(--cielo-primary);
  background: var(--h-primary-soft);
}
.folder-tile:hover .cielo-icon { color: var(--cielo-primary); }
.folder-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.folder-link:hover { text-decoration: none; }
.folder-link > div { flex: 1; min-width: 0; }
.folder-link > div > div:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- GED : drop zone upload --- */
#drop_zone {
  border: 2px dashed var(--h-border-strong);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast), background-color var(--t-fast);
  cursor: pointer;
}
#drop_zone:hover {
  border-color: var(--cielo-primary);
  background: rgba(15, 118, 110, 0.03);
}
#file_input {
  font-size: 13px;
  padding: 8px;
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  background: var(--h-surface);
  color: var(--h-text);
  cursor: pointer;
  max-width: 320px;
}

/* --- PDF TOOLS (ZIP 5) : cartes outils --- */
.pdf-tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.pdf-tool-card .card-icon {
  color: var(--cielo-primary);
  margin-bottom: var(--space-2);
  transition: transform var(--t-fast);
}
.pdf-tool-card:hover {
  border-color: var(--cielo-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pdf-tool-card:hover .card-icon {
  transform: scale(1.1);
}
.pdf-tool-card .card-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
}

/* ============================================================================
   PDF TOOLS ZIP 6 — Refonte UX iLovePDF-like (v2 sans color-mix)
   ============================================================================ */

/* Landing — cartes widgets modernes */
.pdf-tool-hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--h-border);
  background: var(--h-surface);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
  cursor: pointer;
}
.pdf-tool-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tool-color, var(--cielo-primary));
  opacity: 0.85;
}
.pdf-tool-hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -10px rgba(12, 28, 46, 0.2);
  border-color: var(--tool-color, var(--cielo-primary));
}

.pdf-tool-hero-card .tool-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--tool-color, var(--cielo-primary));
  color: white;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pdf-tool-hero-card:hover .tool-icon-wrap {
  transform: scale(1.08) rotate(-5deg);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.35);
}

.pdf-tool-hero-card .tool-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  color: var(--h-text);
  line-height: 1.2;
}
.pdf-tool-hero-card .tool-desc {
  font-size: 12.5px;
  color: var(--h-text-muted);
  line-height: 1.5;
}

.pdf-tool-hero-card .tool-arrow {
  position: absolute;
  top: 22px;
  right: 20px;
  color: var(--h-text-soft);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pdf-tool-hero-card:hover .tool-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--tool-color, var(--cielo-primary));
}

/* Workshop : layout 2 colonnes (files | options) */
.pdf-workshop {
  --tool-color: var(--cielo-primary);
}
.pdf-workshop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--h-border);
}
.pdf-workshop-header h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 4px 0;
}
.pdf-workshop-header h1 em { color: var(--tool-color); font-style: italic; }
.pdf-workshop-header .muted { font-size: 13px; line-height: 1.55; margin: 0; }

.pdf-workshop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 920px) {
  .pdf-workshop-layout { grid-template-columns: 1fr; }
}

/* Colonne gauche : fichiers */
.pdf-files-wrapper {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 400px;
  transition: border-color var(--t-fast);
}
.pdf-files-wrapper-empty {
  background: var(--h-surface);
}

/* Zone drop */
.pdf-drop-zone {
  position: relative;
  border: 2px dashed var(--h-border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--h-surface-alt);
  transition: border-color 0.2s ease, background 0.2s ease;
  user-select: none;
}
.pdf-drop-zone:hover,
.pdf-drop-zone-hover {
  border-color: var(--tool-color);
  background: var(--h-surface);
}
.pdf-drop-zone-icon {
  color: var(--tool-color);
  margin-bottom: 14px;
  display: inline-flex;
}
.pdf-drop-zone-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--h-text);
}
.pdf-drop-zone-sub {
  font-size: 13px;
  color: var(--h-text-muted);
  margin-bottom: 16px;
}
.pdf-drop-zone-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.pdf-drop-zone-input { display: none; }
.pdf-drop-zone-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 11px;
  color: var(--h-text-soft);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.pdf-drop-zone-divider::before,
.pdf-drop-zone-divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--h-border);
}

/* Container des fichiers selectionnes */
.pdf-files-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.pdf-files-empty {
  padding: 20px 0;
}
.pdf-files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 0.5px solid var(--h-border);
}
.pdf-file-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--h-text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Carte fichier */
.pdf-file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 140px;
  padding: 12px 10px 10px;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.pdf-file-card:active { cursor: grabbing; }
.pdf-file-card:hover {
  border-color: var(--tool-color);
  box-shadow: 0 6px 16px -4px rgba(12, 28, 46, 0.1);
  transform: translateY(-2px);
}
.pdf-file-card-dragging {
  opacity: 0.55;
  transform: rotate(-2deg);
}
.pdf-file-card-loading {
  opacity: 0.7;
  pointer-events: none;
}

.pdf-file-thumb {
  position: relative;
  width: 82px;
  height: 108px;
  background: linear-gradient(145deg, #F87171 0%, #DC2626 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px -3px rgba(220, 38, 38, 0.35);
}
.pdf-file-thumb::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-top: 14px solid rgba(255, 255, 255, 0.25);
  border-left: 14px solid transparent;
  border-radius: 0 var(--radius-sm) 0 0;
}
.pdf-file-thumb-pdf { background: linear-gradient(145deg, #F87171 0%, #DC2626 100%); box-shadow: 0 4px 10px -3px rgba(220, 38, 38, 0.35); }
.pdf-file-thumb-image { background: linear-gradient(145deg, #60A5FA 0%, #2563EB 100%); box-shadow: 0 4px 10px -3px rgba(37, 99, 235, 0.35); }
.pdf-file-thumb-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.pdf-file-thumb-pages {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 4px;
  border-radius: 3px;
}
.pdf-file-info {
  width: 100%;
  text-align: center;
  overflow: hidden;
}
.pdf-file-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--h-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  margin: 0 auto;
}
.pdf-file-meta {
  font-size: 10px;
  color: var(--h-text-soft);
  margin-top: 2px;
}
.pdf-file-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--h-danger);
  color: white;
  border: 2px solid var(--h-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.pdf-file-card:hover .pdf-file-remove {
  opacity: 1;
}
.pdf-file-remove:hover { transform: scale(1.15); }

/* Spinner */
.pdf-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: pdfSpin 0.8s linear infinite;
}
@keyframes pdfSpin {
  to { transform: rotate(360deg); }
}

/* Colonne droite : options */
.pdf-options-panel {
  position: sticky;
  top: 24px;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.pdf-options-panel h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 14px 0;
  color: var(--tool-color);
}
.pdf-options-panel .field:last-of-type { margin-bottom: 0; }

/* Bouton submit principal */
.pdf-submit-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--tool-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pdf-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.25);
  filter: brightness(1.08);
}
.pdf-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pdf-submit-btn-processing { pointer-events: none; }

/* Overlay de traitement */
.pdf-processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 46, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  z-index: 1000;
  color: white;
}
.pdf-processing-overlay-show { display: flex; }
.pdf-processing-overlay .pdf-spinner {
  width: 56px;
  height: 56px;
  border-width: 4px;
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: white;
}
.pdf-processing-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
}
.pdf-processing-sub {
  font-size: 13px;
  opacity: 0.75;
}

/* Barre d'erreur transitoire */
.pdf-error-bar {
  background: var(--h-danger);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}
.pdf-error-bar-show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Modal GED */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 46, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pdf-modal-backdrop[hidden] { display: none; }
.pdf-modal {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.3);
}
.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 0.5px solid var(--h-border);
}
.pdf-modal-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
}
.pdf-modal-header h3 em { color: var(--cielo-primary); font-style: italic; }
.pdf-modal-search { padding: 12px 22px; border-bottom: 0.5px solid var(--h-border); }
.pdf-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.pdf-modal-loading,
.pdf-modal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--h-text-soft);
  font-size: 13px;
}
.pdf-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-top: 0.5px solid var(--h-border);
}
.pdf-modal-count { font-size: 12px; color: var(--h-text-muted); }
.pdf-ged-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.pdf-ged-item:hover { background: var(--h-surface-alt); }
.pdf-ged-item input[type="checkbox"] { width: 16px; height: 16px; }
.pdf-ged-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #F87171 0%, #DC2626 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pdf-ged-item-meta { flex: 1; min-width: 0; }
.pdf-ged-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--h-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-ged-item-sub {
  font-size: 11px;
  color: var(--h-text-soft);
  margin-top: 2px;
}

/* Page resultat */
.pdf-result-page {
  max-width: 620px;
  margin: 40px auto;
  text-align: center;
}
.pdf-result-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--tool-color, var(--h-success));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: pdfResultPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
}
@keyframes pdfResultPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.pdf-result-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 34px;
  font-weight: 400;
  margin-bottom: 8px;
}
.pdf-result-sub {
  font-size: 14px;
  color: var(--h-text-muted);
  margin-bottom: 32px;
}
.pdf-result-file {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  text-align: left;
  margin-bottom: 24px;
}
.pdf-result-file-thumb {
  width: 48px;
  height: 60px;
  background: linear-gradient(145deg, #F87171 0%, #DC2626 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.pdf-result-file-info { flex: 1; min-width: 0; }
.pdf-result-file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--h-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-result-file-meta {
  font-size: 12px;
  color: var(--h-text-muted);
}
.pdf-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.pdf-result-primary-btn {
  padding: 16px 24px;
  background: var(--tool-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.pdf-result-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.3);
  filter: brightness(1.08);
}
.pdf-result-secondary-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pdf-result-back {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 0.5px solid var(--h-border);
  font-size: 13px;
  color: var(--h-text-muted);
}

/* ============================================================================
   PAGE PICKER (ZIP 7) — 3 modes visual / buttons / text
   ============================================================================ */

.picker-wrapper {
  margin-top: 20px;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.picker-header h4 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  margin: 0;
  color: var(--tool-color, var(--cielo-primary));
}

/* Switcher de mode */
.picker-mode-switcher {
  display: inline-flex;
  gap: 2px;
  background: var(--h-surface-alt);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--h-border);
}
.picker-mode-switcher label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--h-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.picker-mode-switcher input {
  display: none;
}
.picker-mode-switcher label.picker-mode-label-active {
  background: var(--tool-color, var(--cielo-primary));
  color: white;
}

/* Warning trop de pages */
.picker-too-many-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #92400E;
  border: 0.5px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* Etat vide */
.picker-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--h-text-soft);
  font-size: 13px;
  background: var(--h-surface-alt);
  border-radius: var(--radius-md);
}

/* Actions (Select all / Invert / Clear / Rotate all) */
.picker-actions-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.picker-actions-bar button {
  padding: 5px 10px;
  font-size: 11px;
  background: var(--h-surface-alt);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-sm);
  color: var(--h-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.picker-actions-bar button:hover {
  background: var(--tool-color);
  color: white;
  border-color: var(--tool-color);
}

/* ===== MODE A : vignettes ===== */
.picker-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  min-height: 100px;
}
.picker-tile {
  position: relative;
  width: 100%;
  height: 130px;
  background: linear-gradient(145deg, #F87171 0%, #DC2626 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 3px 8px -2px rgba(220, 38, 38, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  overflow: hidden;
}
.picker-tile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-top: 10px solid rgba(255, 255, 255, 0.22);
  border-left: 10px solid transparent;
  border-radius: 0 var(--radius-sm) 0 0;
}
.picker-tile-drag {
  cursor: grab;
}
.picker-tile-drag:active {
  cursor: grabbing;
}
.picker-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -3px rgba(220, 38, 38, 0.45);
}
.picker-tile-dragging {
  opacity: 0.5;
  transform: rotate(-2deg);
}
.picker-tile-number {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.picker-tile-pos {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
}
.picker-tile-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.15s ease;
}
.picker-tile-selected {
  outline: 3px solid var(--tool-color, var(--cielo-primary));
  outline-offset: 2px;
}
.picker-tile-selected .picker-tile-check {
  background: var(--tool-color, var(--cielo-primary));
  border-color: white;
}
.picker-tile-selected .picker-tile-check::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-55%, -65%) rotate(45deg);
}
.picker-tile-rotate-btn {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.35);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.picker-tile-rotate-btn:hover {
  background: rgba(0, 0, 0, 0.55);
}
.picker-tile-rotated {
  outline: 2px solid var(--tool-color, var(--cielo-primary));
  outline-offset: 1px;
}

/* ===== MODE B : boutons ===== */
.picker-buttons-list {
  max-height: 400px;
  overflow-y: auto;
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  background: var(--h-surface-alt);
}
.picker-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--h-border);
}
.picker-btn-row:last-child {
  border-bottom: none;
}
.picker-btn-pos {
  font-weight: 600;
  color: var(--h-text-muted);
  min-width: 28px;
  font-size: 12px;
}
.picker-btn-page {
  flex: 1;
  font-size: 13px;
  color: var(--h-text);
}
.picker-btn-move {
  width: 28px;
  height: 28px;
  border: 0.5px solid var(--h-border);
  background: var(--h-surface);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--h-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.picker-btn-move:hover:not(:disabled) {
  background: var(--tool-color, var(--cielo-primary));
  color: white;
  border-color: var(--tool-color, var(--cielo-primary));
}
.picker-btn-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.picker-btn-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
}
.picker-btn-rot {
  padding: 4px 8px;
  font-size: 12px;
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-sm);
  background: var(--h-surface);
  color: var(--h-text);
  cursor: pointer;
}

/* ===== MODE C : texte ===== */
.picker-text-panel {
  padding: 4px 0;
}
.picker-text-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--h-text-muted);
}

/* Preview du resultat (pour debug/info) */
.picker-value-preview-wrap {
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--h-surface-alt);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--h-text-soft);
  font-family: var(--font-mono);
}
.picker-value-preview-wrap strong {
  color: var(--h-text-muted);
  margin-right: 6px;
  font-family: var(--font-sans);
}

/* --- Alert (flash messages) --- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 0.5px solid transparent;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: var(--space-4);
}
.alert .cielo-icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert-info    { background: var(--h-info-soft);    color: var(--h-info);    border-color: rgba(3,105,161,0.2); }
.alert-success { background: var(--h-success-soft); color: var(--h-success); border-color: rgba(5,150,105,0.2); }
.alert-warning { background: var(--h-warning-soft); color: var(--h-warning); border-color: rgba(217,119,6,0.2); }
.alert-danger  { background: var(--h-danger-soft);  color: var(--h-danger);  border-color: rgba(220,38,38,0.2); }

/* --- Modal (utile V3) --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12, 28, 46, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: calc(100% - 32px);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}
.modal-header { margin-bottom: var(--space-4); }
.modal-title { font-size: 18px; font-weight: 500; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--h-border);
}

/* --- Toast --- */
.toast {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 200;
  font-size: 13px;
}

/* =========== 7. SIGNATURES HORIZON ======================================== */
.quota {
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--t-fast);
}
.quota-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
}
.quota-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--h-text-muted);
  text-transform: uppercase;
}
.quota-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--h-text);
}
.quota-value em { color: var(--cielo-primary); font-style: normal; font-weight: 500; }
.quota-track {
  height: 24px;
  background: var(--h-surface-alt);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.quota-fill {
  height: 100%;
  width: var(--quota-pct, 0%);
  background: var(--cielo-primary);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  transition: width 600ms ease, background-color var(--t-fast);
}
.quota-fill::before,
.quota-fill::after {
  content: '';
  position: absolute;
  left: 0; top: -2px;
  width: 200%;
  height: calc(100% + 4px);
  background-repeat: repeat-x;
  background-size: 200px 24px;
  animation: quotaWave 7s linear infinite;
  pointer-events: none;
}
.quota-fill::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q25,2 50,6 T100,6 T150,6 T200,6 V24 H0 Z' fill='rgba(255,255,255,0.28)'/%3E%3C/svg%3E");
}
.quota-fill::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q25,6 50,10 T100,10 T150,10 T200,10 V24 H0 Z' fill='rgba(255,255,255,0.18)'/%3E%3C/svg%3E");
  animation-duration: 5s;
  animation-direction: reverse;
  top: -1px;
}
@keyframes quotaWave {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.quota-fill.warn { background: var(--h-warning); animation-duration: 4s; }
.quota-fill.danger { background: var(--h-danger); animation-duration: 2.5s; }
.quota-fill.warn::before,
.quota-fill.danger::before { animation-duration: 4s; }

/* --- Success check --- */
.success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--h-success-soft);
  color: var(--h-success);
  animation: dropIn var(--t-sig) cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropIn {
  0%   { transform: translateY(-20px) scale(0.6); opacity: 0; }
  60%  { transform: translateY(4px)   scale(1.1); opacity: 1; }
  100% { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* --- Fade-in page --- */
.page-in { animation: fadeIn 300ms ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Icones --- */
.cielo-icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* =========== 8. PAGES AUTH (login / otp / invitation / force-password) ==== */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--h-bg);
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--h-primary-soft) 0%, transparent 60%);
  opacity: 0.35;
  pointer-events: none;
}
.auth-shell::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--h-accent-soft) 0%, transparent 60%);
  opacity: 0.25;
  pointer-events: none;
}
.auth-card {
  position: relative;
  z-index: 1;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
}
.auth-header { text-align: center; margin-bottom: var(--space-6); }
.auth-header .logo { font-size: 36px; display: inline-block; margin-bottom: var(--space-2); }
.auth-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.auth-title em { color: var(--cielo-primary); font-style: italic; font-weight: 500; }
.auth-subtitle { font-size: 13px; color: var(--h-text-muted); line-height: 1.5; }
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--h-border);
  font-size: 12px;
  color: var(--h-text-soft);
}

/* OTP / PIN inputs */
.otp-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 14px;
  padding-left: 14px;
  font-weight: 500;
}

/* =========== 9. PUBLIC SHARE (ZIP 4) ====================================== */

.public-share-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--h-bg);
  position: relative;
  overflow: hidden;
}
.public-share-shell::before {
  content: '';
  position: absolute;
  top: -30%; right: -15%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--h-primary-soft) 0%, transparent 60%);
  opacity: 0.3;
  pointer-events: none;
}
.public-share-shell::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -15%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--h-accent-soft) 0%, transparent 60%);
  opacity: 0.22;
  pointer-events: none;
}
.public-share-card {
  position: relative;
  z-index: 1;
  background: var(--h-surface);
  border: 0.5px solid var(--h-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-md);
}
.public-share-header {
  text-align: center;
  margin-bottom: var(--space-6);
}
.public-share-header img { display: inline-block; margin-bottom: var(--space-3); }
.public-share-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  font-weight: 500;
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
  color: var(--h-text);
}
.public-share-title em { color: var(--cielo-primary); font-style: italic; font-weight: 500; }
.public-share-sub {
  font-size: 13px;
  color: var(--h-text-muted);
  line-height: 1.55;
}
.public-share-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--h-border);
  font-size: 11px;
  color: var(--h-text-soft);
  line-height: 1.6;
}

/* =========== 10. RESPONSIVE =============================================== */

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
  }
  .app-side {
    grid-row: 2;
    border-right: none;
    border-bottom: 0.5px solid var(--h-border);
    padding: var(--space-2);
    display: flex;
    overflow-x: auto;
    gap: var(--space-2);
  }
  .app-side .nav-label { display: none; }
  .app-side .nav-sep { display: none; }
  .nav-item { white-space: nowrap; flex: 0 0 auto; }
  .app-main { padding: var(--space-4); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }

  .cielo-table { font-size: 12px; }
  .cielo-table th, .cielo-table td { padding: 8px 10px; }
}

@media (max-width: 600px) {
  .auth-card { padding: var(--space-6) var(--space-4); }
  .row-between { flex-wrap: wrap; }
  h1 { font-size: 22px; }
}

/* =========== 11. PREFERS-REDUCED-MOTION =================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .quota-fill::before, .quota-fill::after { display: none; }
}
