/* GDV Assistant v1.1.0 */

/* ── FAB ──────────────────────────────────────────────────── */
#gdva-fab {
  position: fixed;
  z-index: 9999;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  outline: none;
}
#gdva-fab:hover  { transform: scale(1.07); box-shadow: 0 6px 24px rgba(0,0,0,.28); }
#gdva-fab:active { transform: scale(.97); }
#gdva-fab.gdva-fab-active { transform: rotate(15deg) scale(1.05); }

#gdva-fab.gdva-style-round  { width:56px; height:56px; border-radius:50%; padding:0; }
#gdva-fab.gdva-style-round svg { width:28px; height:28px; pointer-events:none; }
#gdva-fab.gdva-style-rect   { border-radius:28px; padding:12px 20px; font-size:14px; min-width:90px; }
#gdva-fab.gdva-style-rect svg { pointer-events:none; }
#gdva-fab.gdva-style-tab    { writing-mode:vertical-rl; text-orientation:mixed; border-radius:6px 0 0 6px; padding:16px 10px; font-size:13px; letter-spacing:.5px; box-shadow:-2px 2px 12px rgba(0,0,0,.2); }

/* ── Menu ─────────────────────────────────────────────────── */
#gdva-menu {
  position: fixed;
  z-index: 9998;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  min-width: 220px;
  padding: 6px 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.gdva-menu-item {
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #2d2d2d;
  text-align: left;
  transition: background .1s, border-color .1s;
}
.gdva-menu-item:hover { }
.gdva-item-icon { width:24px; text-align:center; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.gdva-item-icon-emoji { font-size:20px; }
.gdva-item-label { flex:1; }

/* ── Modal WhatsApp QR ────────────────────────────────────── */
.gdva-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gdva-wa-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.gdva-modal-close-btn {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: #888; line-height: 1;
}
.gdva-modal-close-btn:hover { color: #333; }
.gdva-wa-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin-bottom: 16px; }
.gdva-wa-qr-img {
  width: 200px; height: 200px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin: 0 auto 16px;
  display: block;
}
.gdva-wa-text { font-size: 14px; color: #555; line-height: 1.5; margin-bottom: 20px; }
.gdva-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #25D366;
  color: #fff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}
.gdva-wa-link:hover { background: #1da851; color: #fff; }

/* ── Modal signalement ────────────────────────────────────── */
#gdva-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#gdva-modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 64px rgba(0,0,0,.25);
  overflow: hidden;
}
#gdva-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  flex-shrink: 0;
}
#gdva-modal-title { font-size: 16px; font-weight: 700; color: #1a1a1a; }
#gdva-modal-close { background:none; border:none; cursor:pointer; font-size:22px; color:#888; line-height:1; padding:2px 6px; border-radius:4px; }
#gdva-modal-close:hover { color: #e63946; }
#gdva-modal-body { overflow-y: auto; flex: 1; padding: 20px; }

/* ── Loader ───────────────────────────────────────────────── */
.gdva-loader-wrap { text-align: center; padding: 40px 20px 20px; }
.gdva-spinner {
  width: 44px; height: 44px;
  border: 4px solid #eee;
  border-top-color: #e63946; /* remplacé par JS */
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: gdva-spin .8s linear infinite;
}
@keyframes gdva-spin { to { transform: rotate(360deg); } }
.gdva-loader-msg  { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 6px; }
.gdva-loader-hint { font-size: 13px; color: #777; }
.gdva-loader-actions { text-align: center; padding-bottom: 20px; }
.gdva-btn-secondary {
  background: none;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
}
.gdva-btn-secondary:hover { border-color: #999; color: #333; }

/* ── Capture + toolbar ────────────────────────────────────── */
.gdva-step-hint { font-size: 13px; color: #666; margin-bottom: 10px; }
#gdva-canvas-wrap { width:100%; overflow:auto; border:1px solid #e0e0e0; border-radius:8px; background:#f0f0f0; max-height:52vh; }
#gdva-canvas-wrap canvas { display:block; }

#gdva-toolbar { display:flex; align-items:center; gap:4px; padding:10px 0 4px; flex-wrap:wrap; }
.gdva-tool { background:#f3f3f3; border:1px solid #ddd; border-radius:6px; padding:6px 10px; cursor:pointer; font-size:14px; min-width:34px; text-align:center; transition:background .1s; }
.gdva-tool:hover { background:#eaeaea; }
.gdva-tool.active { background:#2d2d2d; color:#fff; border-color:#2d2d2d; }
.gdva-sep { color:#ccc; padding:0 3px; }
#gdva-color-picker { width:34px; height:30px; border:1px solid #ddd; border-radius:6px; padding:2px; cursor:pointer; }
#gdva-stroke-width { border:1px solid #ddd; border-radius:6px; padding:4px 6px; font-size:13px; }
#gdva-undo, #gdva-clear { padding:6px 10px; border:1px solid #ddd; border-radius:6px; cursor:pointer; background:#f3f3f3; font-size:14px; }
#gdva-undo:hover, #gdva-clear:hover { background:#eaeaea; }
.gdva-btn-primary { padding:8px 20px; border:none; border-radius:8px; color:#fff; font-size:14px; font-weight:600; cursor:pointer; margin-left:auto; }
.gdva-btn-primary:hover { opacity:.9; }

/* ── Formulaire ───────────────────────────────────────────── */
#gdva-preview-thumb-wrap { position:relative; display:inline-block; margin-bottom:16px; }
#gdva-preview-thumb { max-width:100%; max-height:160px; border-radius:8px; border:1px solid #e0e0e0; display:block; }
#gdva-back-to-capture { position:absolute; top:8px; right:8px; background:#fff; border:1px solid currentColor; border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; font-weight:600; }

.gdva-form-row { margin-bottom: 14px; }
.gdva-form-row label { display:block; font-size:13px; font-weight:600; color:#444; margin-bottom:5px; }
.gdva-form-row input,
.gdva-form-row textarea { width:100%; padding:9px 12px; border:1px solid #d0d0d0; border-radius:8px; font-size:14px; font-family:inherit; color:#1a1a1a; box-sizing:border-box; transition:border-color .15s; }
.gdva-form-row input:focus,
.gdva-form-row textarea:focus { outline:none; border-color:#999; }
.gdva-form-row textarea { resize:vertical; }

#gdva-form-error { background:#ffeaea; border:1px solid #e63946; color:#c0000a; padding:8px 12px; border-radius:6px; font-size:13px; margin-bottom:12px; }
#gdva-submit-btn { width:100%; padding:12px; color:#fff; border:none; border-radius:8px; font-size:15px; font-weight:700; cursor:pointer; transition:background .15s; }
#gdva-submit-btn:disabled { opacity:.6; cursor:not-allowed; }

/* ── Succès ───────────────────────────────────────────────── */
#gdva-step-success { text-align:center; padding:40px 16px; }
.gdva-success-icon { font-size:56px; margin-bottom:12px; }
#gdva-step-success h3 { font-size:22px; font-weight:700; color:#1a1a1a; margin-bottom:8px; }
#gdva-step-success p  { color:#555; font-size:15px; margin-bottom:24px; }
#gdva-success-close { padding:10px 32px; background:#2d2d2d; color:#fff; border:none; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width:600px) {
  #gdva-modal-box { max-height:95vh; border-radius:12px; }
  #gdva-modal-body { padding:14px; }
  #gdva-toolbar { gap:2px; }
  .gdva-tool { padding:5px 7px; font-size:12px; min-width:28px; }
}
