/* =========================================
   Règles génériques / reset léger
========================================= */

[hidden],
.hidden {
  display: none !important;
}

.avqr-container {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =========================================
   Bloc INPUT (Texte + WiFi)
========================================= */

.avqr-input-wrapper {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  padding: clamp(18px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avqr-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.avqr-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.avqr-conj {
  font-size: 0.9rem;
  color: #6b7280;
}

.avqr-wifi-btn {
  height: auto;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.avqr-wifi-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Ligne texte */

.avqr-text-row {
  display: block;
}

.avqr-text-row input[type="text"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 1rem;
  color: #0f172a;
  box-sizing: border-box;
}

.avqr-text-row input[type="text"]::placeholder {
  color: #94a3b8;
}

.avqr-text-row input[type="text"]:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* =========================================
   Boutons génériques
========================================= */

.avqr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  background: #0ea5e9;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
}

.avqr-btn:hover {
  background: #0284c7;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.avqr-btn:active {
  transform: translateY(1px);
}

.avqr-btn.small {
  height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

/* Copy icon button */

.avqr-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.avqr-btn--icon svg {
  width: 20px;
  height: 20px;
}

/* =========================================
   PREVIEW + PANEL EXPORT
========================================= */

.avqr-preview-row {
  display: flex;
  align-items: center;
  justify-content: center; /* centre l’ensemble */
  gap: 24px;       /* centre le bloc préview + panneau */
}

/* Preview (gauche) */

.avqr-preview{
  padding: 6px;              /* ← 4–6 px, comme tu veux */
  background: #f6f7f9;       /* ou transparent si tu préfères */
  border-radius: 12px;
  display: inline-flex;      /* ⬅️ clé : s’adapte au contenu */
  align-items: center;
  justify-content: center;
  width: auto;        /* clé */
  max-width: none;   /* clé */
  flex: 0 0 auto; 
}

.avqr-placeholder {
  color: #64748b;
  font-size: 0.98rem;
  user-select: none;
  text-align: center;
}

.avqr-canvas img,
.avqr-canvas canvas,
.avqr-canvas svg {
  width: 256px;
  height: 256px;
  display: block;
}

/* Mode smartphone */
@media (max-width: 768px) {
  .avqr-canvas img,
  .avqr-canvas canvas,
  .avqr-canvas svg {
    width: 175px;
    height: 175px;
  }
}

/* Export (droite) */

.avqr-export-panel {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.avqr-export-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avqr-export-group label {
  font-size: 0.85rem;
  color: #4b5563;
}

.avqr-export-panel select {
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
  background: #ffffff;
}

/* =========================================
   Onglets
========================================= */

.avqr-tabs {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.avqr-tab {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: 1rem;
  color: #6b7280;
}

.avqr-tab.active {
  background: #f9fafb;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-color: #f9fafb;
}

/* =========================================
   PANELS & FIELDS
========================================= */

.avqr-panel {
  border: 1px solid #e5e7eb;
  border-radius: 0 12px 12px 12px;
  padding: 16px;
  background: #f9fafb;
  margin-bottom: 12px;
}

.avqr-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.avqr-field-group > label,
.avqr-field-group > h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.avqr-field-group > h4 {
  margin-bottom: 4px;
}

.avqr-field-group input[type="number"],
.avqr-field-group select {
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
  background: #ffffff;
  box-sizing: border-box;
}

.avqr-field-group [data-avqr="points-shape"],[data-avqr="corners-frame-shape"],[data-avqr="corners-inner-shape"]  {
  min-width: 300px;
}

.avqr-field-group [data-avqr="error-correction"] {
  min-width: 300px;
}

.avqr-field-group input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* radio rows */

.avqr-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 4px;
}

.avqr-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: #4b5563;
}

.avqr-radio-row input[type="radio"] {
  accent-color: #0ea5e9;
}

/* Sous-sections (solid / linear / radial) */

.avqr-sub {
  padding-left: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.avqr-sub label {
  font-size: 0.85rem;
  color: #4b5563;
}

/* Logo */

.avqr-logo-status {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}

/* =========================================
   Zone erreurs
========================================= */

.avqr-error {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  background: #fee2e2;
  border-radius: 12px;
  color: #7f1d1d;
  font-size: 0.9rem;
}

/* =========================================
   Dialog Wi-Fi (repris de ta version précédente)
========================================= */

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

.avqr-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.avqr-dialog[hidden],
.avqr-dialog-backdrop[hidden] {
  display: none !important;
}

.avqr-dialog__card {
  background: #fff;
  max-width: 520px;
  width: min(92vw, 520px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.avqr-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.avqr-dialog__title {
  margin: 0;
  font-size: 1.1rem;
}

.avqr-dialog__close {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.avqr-dialog__body {
  padding: 16px;
}

.avqr-dialog__footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.avqr-dialog__body .avqr-field-group {
  margin-top: 0;
}

/* =========================================
   Accessibilité utilitaire
========================================= */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Bouton copier dans le panneau export */

.avqr-export-panel [data-avqr="copy-image"] {
  align-self: center;
  width: auto;
  min-width: 44px;
}

/* Limiter la largeur des petits champs dans les panels */

.avqr-panel input[type="number"],
.avqr-panel select {
  max-width: 80px;
}

/* encore plus compact pour marge & correction d’erreur */

.avqr-panel [data-avqr="margin"],
.avqr-panel [data-avqr="error-correction"] {
  max-width: 120px;
}

.avqr-logo-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.avqr-logo-row input[type="file"]{
  flex:1 1 auto;
  min-width:220px;
}
.avqr-logo-remove{
  width:auto;
  white-space:nowrap;
}


/* Rotation rapide du bouton Copier */
.avqr-btn.is-rotating{
  animation: avqrRotateOnce .45s ease-in-out both;
}
@keyframes avqrRotateOnce{
  to { transform: rotate(360deg); }
}



.avqr-wifi-modal[hidden]{ display:none !important; }
.avqr-wifi-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.avqr-wifi-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.avqr-wifi-card{
  position: relative;
  width: min(520px, calc(100% - 24px));
  margin: 8vh auto 0;
  background: #0f172a;
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.avqr-wifi-card h3{ margin: 0 0 12px; }
.avqr-wifi-fields{
  display: grid;
  gap: 12px;
}
.avqr-wifi-fields label{
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.85);
}
.avqr-wifi-fields input,
.avqr-wifi-fields select{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  outline: none;
}
.avqr-wifi-check{
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
}
.avqr-wifi-actions{
  display:flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.avqr-helper-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8faff; /* Bleu très léger */
    border-left: 4px solid #3498db; /* Rappel du bleu de ton bouton */
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.4;
}

.avqr-link {
    display: inline-block;
    margin-top: 8px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.avqr-link:hover {
    text-decoration: underline;
}



/* Style de la boîte parente */
.avqr-helper-box {
  margin-top: 25px;
  padding: 15px 20px; /* Réduit un peu le padding quand c'est fermé */
  background-color: #ffffff;
  border: 1px solid #e1e8ed;
  border-left: 4px solid #3498db;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

/* Style du titre cliquable */
.avqr-helper-title {
  color: #2c3e50;
  font-size: 1.05em;
  cursor: pointer;
  list-style: none; /* Cache la flèche par défaut du navigateur */
  display: flex;
  align-items: center;
  outline: none;
  justify-content: space-between;
}

/* Création de la flèche personnalisée */
.avqr-helper-title::after {
  content: "▼";
  font-size: 1.2em;
  margin-left: auto;
  color: #3498db;
  transition: transform 0.3s ease;
}

/* Rotation de la flèche quand c'est ouvert */
.avqr-helper-box[open] .avqr-helper-title::after {
  transform: rotate(180deg);
}

/* Cache la flèche par défaut sur Safari/Chrome */
.avqr-helper-title::-webkit-details-marker {
  display: none;
}

/* Espacement du contenu intérieur */
.avqr-content {
  padding-top: 15px;
}

/* On garde vos styles existants pour la liste et le lien */
.avqr-checklist {
  list-style: none;
  margin: 0 0 15px 0;
  padding: 0;
}

.avqr-checklist li {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
}

.avqr-link {
  display: inline-block;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85em;
}