/* ============================================================
   AKAZ CALCULATOR — CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface2:   #222536;
  --border:     #2e3148;
  --accent:     #6c63ff;
  --accent-light: #8b84ff;
  --accent-glow: rgba(108,99,255,0.25);
  --text:       #f0f1f8;
  --text-muted: #9ba0c2;
  --success:    #4caf82;
  --warning:    #f0a500;
  --sidebar-w:  260px;
  --topbar-h:   58px;
  --radius:     12px;
  --radius-sm:  8px;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Overlay mobile ─────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

@media (min-width: 900px) {
  .sidebar { transform: translateX(0); }
  .overlay { display: none !important; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 26px;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--text);
}
.logo-text small {
  font-size: 10px;
  color: var(--accent-light);
  letter-spacing: 0.15em;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.close-btn:hover { color: var(--text); background: var(--surface2); }

@media (min-width: 900px) { .close-btn { display: none; } }

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 16px 20px 6px;
}

/* ── Nav group (collapsible) ──────────────────────────────── */
.nav-group { border-bottom: 1px solid var(--border); }
.nav-group:last-of-type { border-bottom: none; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}
.nav-group-toggle:hover { background: var(--surface2); }
.nav-group-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.nav-chevron { width: 14px; height: 14px; color: var(--text-muted); margin-left: auto; transition: transform 0.2s; flex-shrink: 0; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }

.nav-group-items {
  display: none;
  padding-bottom: 6px;
}
.nav-group.open .nav-group-items { display: block; }

.nav-group-items .nav-item {
  padding: 9px 20px 9px 46px;
  font-size: 13px;
  border-left: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}
.nav-item.active {
  color: var(--accent-light);
  background: rgba(108,99,255,0.1);
  border-left-color: var(--accent);
}

.nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 20px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.05em;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.nav-pro-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--warning);
  background: rgba(240,165,0,0.12);
  border: 1px solid rgba(240,165,0,0.3);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: auto;
}

.sidebar-upgrade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(240,165,0,0.15), rgba(108,99,255,0.15));
  border: 1px solid rgba(240,165,0,0.3);
  border-radius: var(--radius-sm);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.sidebar-upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(240,165,0,0.25), rgba(108,99,255,0.25));
  border-color: var(--warning);
}

/* ── Main layout ────────────────────────────────────────── */
.main-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

@media (min-width: 900px) {
  .main-wrapper { margin-left: var(--sidebar-w); }
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background var(--transition);
}
.menu-btn:hover { background: var(--surface2); }

@media (min-width: 900px) { .menu-btn { display: none; } }

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

/* ── Content ────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 20px 16px 40px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

/* ── Sections ───────────────────────────────────────────── */
.calc-section { display: none; }
.calc-section.active { display: block; }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 18px;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-grid .form-group { margin-bottom: 0; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-primary:active { transform: scale(0.98); }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn-tva {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-tva.active, .btn-tva:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Results ────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .results-grid { grid-template-columns: 1fr; } }

.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.result-box.accent {
  background: rgba(108,99,255,0.12);
  border-color: rgba(108,99,255,0.4);
}
.result-box.highlight {
  background: rgba(76,175,130,0.1);
  border-color: rgba(76,175,130,0.35);
}

.result-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.result-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.result-box.accent .result-value { color: var(--accent-light); }
.result-box.highlight .result-value { color: var(--success); }

/* ── Livret ref row + result variants → voir section agent ci-dessous ── */

/* ── Chart ──────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-dot.accent  { background: var(--accent); }
.legend-dot.muted   { background: var(--text-muted); }
.legend-dot.livreta { background: var(--warning); }

/* ── Promo badge ────────────────────────────────────────── */
.promo-badge-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.promo-badge {
  background: linear-gradient(135deg, var(--accent), #ff6584);
  border-radius: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 8px 30px rgba(108,99,255,0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ── Pourcentage blocks ─────────────────────────────────── */
.pct-block { margin-bottom: 6px; }
.pct-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Topbar right group ──────────────────────────────────── */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Topbar notepad btn ─────────────────────────────────── */
.notepad-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 18px;
  padding: 5px 10px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.notepad-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ── Topbar more menu ────────────────────────────────────── */
.topbar-more-wrap { position: relative; }
.topbar-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.topbar-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}
.topbar-more-item:hover { background: var(--surface2); }
.topbar-more-item svg { width: 15px; height: 15px; color: var(--text-muted); }

.notepad-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* ── Result-value clickable ─────────────────────────────── */
.result-value.clickable {
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
  padding: 2px 4px;
  margin: -2px -4px;
}
.result-value.clickable:hover {
  background: rgba(108,99,255,0.2);
  color: var(--accent-light);
}
.result-value.clickable:hover::after {
  content: ' +';
  font-size: 14px;
  opacity: 0.6;
}

/* ── Notepad panel ──────────────────────────────────────── */
.notepad-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 198;
}
.notepad-overlay.active { display: block; }

.notepad-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 92vw;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 199;
  display: flex;
  flex-direction: column;
  transition: right var(--transition);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  overflow: hidden;
}
.notepad-panel.open { right: 0; }

.notepad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notepad-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.notepad-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notepad-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.notepad-clear:hover { border-color: #e74c3c; color: #e74c3c; }

.notepad-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.notepad-close:hover { color: var(--text); background: var(--surface2); }

.notepad-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notepad-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notepad-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 40px;
}

.notepad-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.notepad-item-content {
  flex: 1;
  min-width: 0;
}

.notepad-item-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.notepad-item-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-light);
  word-break: break-all;
}

.notepad-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.notepad-item-delete:hover { color: #e74c3c; background: rgba(231,76,60,0.1); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.calc-section.active { animation: fadeIn 0.3s ease; }
.card { animation: fadeIn 0.3s ease; }

/* ── Feather icons sizing ───────────────────────────────── */
.nav-icon svg { width: 17px; height: 17px; stroke-width: 2; }
.menu-btn svg { width: 22px; height: 22px; }
.close-btn svg { width: 18px; height: 18px; }
.notepad-btn svg { width: 19px; height: 19px; }
.notepad-title svg { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; }
.notepad-close svg { width: 16px; height: 16px; }
.btn-refresh svg { width: 15px; height: 15px; }
.btn-swap svg { width: 18px; height: 18px; }
.devise-live-icon { width: 13px; height: 13px; color: var(--success); }
.livret-ref-icon-svg { width: 16px; height: 16px; color: var(--warning); flex-shrink: 0; }

/* ── Copyright sidebar footer ───────────────────────────── */
.copyright-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  transition: color var(--transition);
}
.copyright-link:hover { color: var(--accent-light); }

.sidebar-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  width: 100%;
}
.sidebar-legal-links a {
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--transition), color var(--transition);
}
.sidebar-legal-links a:hover { opacity: 1; color: var(--accent-light); }

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.feedback-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.feedback-btn svg { width: 13px; height: 13px; }

/* ── Livret ref row — fixed ─────────────────────────────── */
.livret-ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(240,165,0,0.08);
  border: 1px solid rgba(240,165,0,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.livret-ref-row label {
  font-size: 12px;
  color: var(--warning);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  white-space: nowrap;
  font-weight: 500;
}
.livret-ref-row input {
  width: 64px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.livret-ref-unit {
  font-size: 12px;
  color: var(--warning);
  font-weight: 700;
}
.livret-ref-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  font-style: italic;
}

/* ── Result box variants ────────────────────────────────── */
.result-box.livreta {
  background: rgba(240,165,0,0.1);
  border-color: rgba(240,165,0,0.35);
}
.result-box.livreta .result-value { color: var(--warning); }
.result-box.highlight-orange {
  background: rgba(255,101,84,0.1);
  border-color: rgba(255,101,84,0.35);
}
.result-box.highlight-orange .result-value { color: #ff8c7a; }
.legend-dot.livreta { background: var(--warning); }

/* ── Devise converter ───────────────────────────────────── */
.devise-rate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
#devise-rate-info { flex: 1; }
.btn-refresh {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color var(--transition);
}
.btn-refresh:hover { color: var(--accent-light); }
.btn-refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.devise-pair-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}
.devise-pair-row .form-group,
.conv-pair-row .form-group {
  margin-bottom: 0;
}
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
select:focus { border-color: var(--accent); }
.btn-swap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 0;
  transition: all var(--transition);
  height: 42px;
}
.btn-swap:hover { color: var(--accent-light); border-color: var(--accent); }

.devise-main-result {
  margin-top: 4px;
}
.devise-rate-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.devise-rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 400px) { .devise-rates-grid { grid-template-columns: 1fr; } }
.devise-rate-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.devise-rate-item.skeleton {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  grid-column: 1 / -1;
}
.devise-rate-currency {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.devise-rate-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-light);
}
.devise-rate-flag {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Trading Layout ─────────────────────────────────────── */
.trading-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 760px) {
  .trading-layout {
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: start;
  }
}
.trading-left { display: flex; flex-direction: column; }
.trading-right {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-y: auto;
}

/* ── Input with unit ─────────────────────────────────────── */
.input-unit-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-unit-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-unit-wrap input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}
.input-unit-wrap input:focus { box-shadow: none; }
.input-unit {
  background: var(--surface2);
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── CFD instruments preset ─────────────────────────────── */
.cfd-instruments {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.instr-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.btn-instr {
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-instr.active, .btn-instr:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── CFD Performance ─────────────────────────────────────── */
.cfd-perf-grid { display: flex; flex-direction: column; gap: 8px; }
.cfd-perf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.cfd-perf-label { font-size: 13px; color: var(--text-muted); }
.cfd-perf-val {
  font-size: 16px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 6px;
  min-width: 80px;
  text-align: center;
}
.cfd-perf-val.gain     { background: rgba(76,175,130,0.2); color: var(--success); }
.cfd-perf-val.loss     { background: rgba(231,76,60,0.2);  color: #e74c3c; }
.cfd-perf-val.neutral  { background: rgba(108,99,255,0.15); color: var(--accent-light); }
.cfd-perf-val.positive { background: rgba(76,175,130,0.15); color: var(--success); }

/* ── CFD Stop table ──────────────────────────────────────── */
.cfd-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cfd-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 2px;
  border-radius: 4px;
  overflow: hidden;
}
.cfd-table-row .cfd-cell {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: var(--surface2);
  color: var(--text-muted);
}
.cfd-table-row.row-5 .cfd-cell {
  background: rgba(108,99,255,0.25);
  color: var(--accent-light);
}
.cfd-table-row.row-current .cfd-cell {
  background: #f0a500;
  color: #000;
}

/* ── Convertisseur d'unités ─────────────────────────────── */
.conv-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.conv-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.2;
}
.conv-cat-btn svg { width: 18px; height: 18px; }
.conv-cat-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(108,99,255,0.08);
}
.conv-cat-btn.active {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

.conv-pair-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.conv-result-box {
  margin-top: 4px;
}
.conv-formula {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* Table de conversion */
.conv-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.conv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 400px;
}
.conv-table th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.conv-table th:first-child { text-align: left; }
.conv-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(46,49,72,0.5);
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
}
.conv-table td.conv-table-base {
  text-align: left;
  font-weight: 700;
  color: var(--accent-light);
}
.conv-table tr:hover td { background: rgba(108,99,255,0.05); }
.conv-table tr:last-child td { border-bottom: none; }

/* ============================================================
   BANNIÈRE COOKIES
   ============================================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.cookie-banner--visible  { transform: translateY(0); }
.cookie-banner--hidden   { transform: translateY(100%); }

.cookie-banner__content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}
.cookie-banner__icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.cookie-banner__text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.cookie-banner__text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cookie-banner__link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color var(--transition);
}
.cookie-banner__link:hover { color: var(--accent-light); }

.cookie-banner__btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
}
.cookie-banner__btn:hover { opacity: 0.85; }

.cookie-banner__btn--refuse {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.cookie-banner__btn--accept {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 600px) {
  .cookie-banner__content { padding: 14px 16px; gap: 14px; }
  .cookie-banner__actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   PAGES LÉGALES
   ============================================================ */

.legal-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.legal-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-back {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.legal-back:hover { color: var(--accent-light); }
.legal-back svg  { width: 16px; height: 16px; }

.legal-content h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.legal-updated {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.legal-content section {
  margin-bottom: 36px;
}

.legal-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.legal-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px;
}

.legal-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 10px;
}

.legal-content ul {
  margin: 8px 0 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legal-content ul li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.legal-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-content a:hover { color: var(--text); }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.legal-table th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.legal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46,49,72,0.5);
  color: var(--text-muted);
  vertical-align: top;
}
.legal-table tr:last-child td { border-bottom: none; }

.legal-notice {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
}
.legal-notice--warning {
  background: rgba(240,165,0,0.08);
  border-color: rgba(240,165,0,0.3);
}
.legal-notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; stroke: var(--accent-light); }
.legal-notice--warning svg { stroke: var(--warning); }
.legal-notice p, .legal-notice li { font-size: 13px; margin-bottom: 6px; }
.legal-notice ul { margin: 8px 0 0 18px; }

.legal-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0 0;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.legal-footer a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.legal-footer a:hover { color: var(--accent-light); }
.legal-footer span { color: var(--text-muted); margin-left: auto; }

/* ============================================================
   ADMIN
   ============================================================ */

/* ── Auth screen ─────────────────────────────────────────── */
.admin-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.admin-auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.admin-auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}

.admin-auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.admin-back-to-site {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.admin-back-to-site:hover { color: var(--accent-light); }

/* ── Dashboard layout ────────────────────────────────────── */
.admin-dashboard {
  display: flex;
  min-height: 100vh;
}

/* ── Admin sidebar ───────────────────────────────────────── */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition), color var(--transition);
}
.admin-nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.admin-nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-light);
}
.admin-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.admin-sidebar-footer {
  padding: 16px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-back-link,
.admin-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.admin-back-link {
  color: var(--text-muted);
  background: none;
  border: none;
}
.admin-back-link:hover { background: var(--surface2); color: var(--text); }

.admin-logout-btn {
  color: #e57373;
  background: none;
  border: none;
  text-align: left;
}
.admin-logout-btn:hover { background: rgba(229,115,115,0.1); }
.admin-back-link svg,
.admin-logout-btn svg { width: 14px; height: 14px; }

/* ── Admin main ──────────────────────────────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.admin-badge {
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sections ────────────────────────────────────────────── */
.admin-section {
  display: none;
  padding: 24px 28px;
  max-width: 720px;
  flex-direction: column;
  gap: 20px;
}
.admin-section.active {
  display: flex;
}

.admin-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Toggle switch ───────────────────────────────────────── */
.admin-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.admin-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.admin-toggle-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translate(20px, -50%);
  background: #fff;
}

/* ── Input row ───────────────────────────────────────────── */
.admin-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.admin-input-row input { flex: 1; }

.admin-input-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Field messages ──────────────────────────────────────── */
.admin-field-error {
  font-size: 12px;
  color: #e57373;
  margin-top: 6px;
}

.admin-success-msg {
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
}

/* ── Users table ─────────────────────────────────────────── */
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-users-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.admin-users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46,49,72,0.4);
  color: var(--text);
}
.admin-users-table tr:hover td {
  background: rgba(108,99,255,0.04);
}

/* ── Status card ─────────────────────────────────────────── */
.admin-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  margin-top: 20px;
  transition: border-color var(--transition);
}
.admin-status-card.status-active  { border-color: var(--success); }
.admin-status-card.status-paused  { border-color: var(--warning); }
.admin-status-card.status-inactive { border-color: var(--border); }

.admin-status-icon svg { width: 22px; height: 22px; }
.status-active  .admin-status-icon svg { stroke: var(--success); }
.status-paused  .admin-status-icon svg { stroke: var(--warning); }
.status-inactive .admin-status-icon svg { stroke: var(--text-muted); }

.admin-status-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.admin-status-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: monospace;
}

/* ── Events list ─────────────────────────────────────────── */
.admin-events-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.admin-event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.admin-event-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--success);
}
.admin-event-item code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--accent-light);
  font-family: monospace;
}

/* ── Responsive admin ────────────────────────────────────── */
@media (max-width: 640px) {
  .admin-sidebar { display: none; }
  .admin-section { padding: 16px; }
  .admin-topbar  { padding: 14px 16px; }
}

/* ============================================================
   AUTH — Modal, User button, Freemium overlay
   ============================================================ */

/* ── Notepad locked ──────────────────────────────────────── */
#notepadBtnWrapper.notepad-locked .notepad-btn { opacity: 0.5; }

/* ── User button ─────────────────────────────────────────── */
.user-btn-wrap { position: relative; }

.user-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  width: 34px;
  height: 34px;
}
.user-btn:hover { background: var(--surface2); color: var(--text); }
.user-btn svg   { width: 18px; height: 18px; }

.user-avatar {
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── User dropdown ───────────────────────────────────────── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}

.user-dropdown-name {
  padding: 12px 14px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown-item:hover { background: var(--surface2); color: var(--text); }
.user-dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Auth modal ──────────────────────────────────────────── */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal--open { display: flex; }

.auth-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  z-index: 1;
  transition: color var(--transition), background var(--transition);
}
.auth-modal-close:hover { color: var(--text); background: var(--surface2); }
.auth-modal-close svg { width: 18px; height: 18px; }

/* Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.auth-tab:hover  { color: var(--text); }
.auth-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* Forms */
.auth-form        { display: none; padding: 24px; flex-direction: column; }
.auth-form.active { display: flex; }

.auth-form-header { margin-bottom: 20px; }
.auth-form-header h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-form-header p  { font-size: 13px; color: var(--text-muted); }

.auth-error {
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: var(--radius-sm);
  color: #e57373;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.auth-submit { margin-top: 8px; }

/* Liens bas de form */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.auth-sep { color: var(--border); font-size: 13px; }

.auth-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 4px;
  transition: color var(--transition);
  font-family: var(--font);
}
.auth-link-btn:hover { color: var(--accent-light); }

/* Message succès */
.auth-success {
  background: rgba(76, 175, 130, 0.12);
  border: 1px solid rgba(76, 175, 130, 0.35);
  color: #4caf82;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Bouton danger (suppression compte) */
.btn-danger {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #dc3545;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover {
  background: rgba(220, 53, 69, 0.3);
}

/* Champ mot de passe avec toggle */
.input-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-pw-wrap input {
  flex: 1;
  padding-right: 40px;
}
.pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 15px; height: 15px; }

/* ── Nav lock ────────────────────────────────────────────── */
.nav-lock {
  margin-left: auto;
  width: 13px;
  height: 13px;
  opacity: 0.45;
  flex-shrink: 0;
}

/* ── Freemium overlay ────────────────────────────────────── */
.calc-section { position: relative; }

.freemium-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,17,23,0.88);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 24px;
  border-radius: var(--radius);
}

.freemium-overlay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.freemium-overlay-box svg { width: 36px; height: 36px; stroke: var(--accent); margin-bottom: 16px; }
.freemium-overlay-box h3  { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.freemium-overlay-box p   { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.freemium-overlay-box .btn-primary { margin-bottom: 8px; }

/* ── Comparateur ──────────────────────────────────────────── */
.comparator-panel { border-color: var(--accent); }
.comparator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.comparator-header .card-title { margin: 0; }
.comparator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 500px) { .comparator-grid { grid-template-columns: 1fr; } }
.comparator-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-light); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.comparator-col:last-child .comparator-col-title { color: var(--warning); }
.comparator-field { margin-bottom: 10px; }
.comparator-field label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; }
.comparator-field input { width: 100%; padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit; }

/* ── Calculatrice standard ────────────────────────────────── */
.std-calc { max-width: 380px; margin: 0 auto; }
.std-calc-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  text-align: right;
}
.std-calc-history { font-size: 13px; color: var(--text-muted); min-height: 20px; margin-bottom: 4px; }
.std-calc-screen { font-size: 38px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; word-break: break-all; line-height: 1.2; }
.std-calc-memory { font-size: 11px; color: var(--accent-light); min-height: 16px; margin-bottom: 8px; padding: 0 4px; }
.std-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.std-btn {
  padding: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.1s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.std-btn:active { transform: scale(0.95); }
.std-num { background: var(--surface2); color: var(--text); }
.std-num:hover { background: var(--surface); border-color: var(--accent); }
.std-op { background: rgba(108,99,255,0.15); color: var(--accent-light); font-size: 18px; }
.std-op:hover { background: rgba(108,99,255,0.25); }
.std-fn { background: var(--surface); color: var(--text-muted); font-size: 13px; }
.std-fn:hover { background: var(--surface2); color: var(--text); }
.std-eq { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 20px; }
.std-eq:hover { background: var(--accent-light); }
.std-calc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.std-calc-actions .std-btn { font-size: 12px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.std-calc-actions .std-btn svg { width: 14px; height: 14px; }
.std-calc-tva-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.std-calc-tva-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.std-calc-tva {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
