/* ==========================================================================
   STUDIO IA — Feuille de styles v3
   Thème clair : fond crème, texte noir profond, pastels doux
   Lisibilité renforcée partout (contraste ≥ 4.5:1)
   ========================================================================== */

:root {
  /* Fonds */
  --bg:          #faf8f3;   /* crème très doux */
  --bg-2:        #ffffff;   /* cartes */
  --bg-3:        #f3efe6;   /* inputs, blocs subtils */
  --bg-4:        #e9e3d5;   /* hover */
  --bg-dark:     #2c2823;   /* topbar sombre pour contraste */

  /* Bordures */
  --border:      #e3dcd0;
  --border-2:    #cfc7b6;
  --border-3:    #b5ab97;

  /* Texte */
  --text:        #1a1815;   /* noir profond (contraste 15:1 sur blanc) */
  --text-2:      #3a3632;
  --text-dim:    #4a4640;
  --muted:       #6b6558;

  /* Pastels pour accents visuels (fonds de badges, dots...) */
  --pastel-lavender: #e6dcf5;
  --pastel-mint:     #d6ecdf;
  --pastel-peach:    #fae0d0;
  --pastel-rose:     #f5dfe8;
  --pastel-sky:      #d6e6f5;
  --pastel-cream:    #f5ebd4;
  --pastel-butter:   #f7edc4;

  /* Couleurs fonctionnelles (assombries pour lisibilité sur fond clair) */
  --accent:      #7c5cff;   /* violet profond (contraste OK sur blanc) */
  --accent-2:    #2a8fb0;   /* teal profond */
  --accent-3:    #d1477a;   /* rose profond */
  --success:     #3a8a52;   /* vert profond */
  --warning:     #b58620;   /* ambre profond */
  --danger:      #c23c3c;   /* rouge profond */

  /* Ombres très douces (adaptées au thème clair) */
  --shadow:      0 1px 3px rgba(60,50,40,.08), 0 1px 2px rgba(60,50,40,.06);
  --shadow-md:   0 4px 12px rgba(60,50,40,.10), 0 2px 4px rgba(60,50,40,.06);
  --shadow-lg:   0 12px 32px rgba(60,50,40,.14), 0 4px 8px rgba(60,50,40,.08);

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --transition:  .18s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Petit motif pastel en arrière-plan, très discret */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 400px at 8% -5%, rgba(230,220,245,.5), transparent 65%),
    radial-gradient(700px 400px at 95% 3%, rgba(214,230,245,.45), transparent 65%);
  z-index: 0;
}

.hidden { display: none !important; }
.muted  { color: var(--muted); font-size: .9em; }
.msg    { font-size: .9em; margin-top: 8px; min-height: 1em; display: block; }
.msg.ok { color: var(--success); font-weight: 600; }
.msg.err{ color: var(--danger); font-weight: 600; }

h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 12px; color: var(--text); }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; color: var(--text-2); margin-top: 24px; }

/* ========== FORMULAIRES ========== */
label {
  display: block;
  margin-bottom: 14px;
  font-size: .9em;
  color: var(--text-2);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  background: var(--bg-3);
  color: var(--text);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(124,92,255,.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: .8;
}

textarea {
  resize: vertical;
  min-height: 90px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: .95em;
  cursor: pointer;
  margin: 14px 0;
  font-weight: 500;
}
.check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

/* ========== BOUTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--bg-2);
  color: var(--text);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.btn:hover   { background: var(--bg-3); border-color: var(--border-3); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active  { transform: translateY(0); box-shadow: var(--shadow); }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
  background: linear-gradient(135deg, #c9b8e8, #a8c8dc);
  color: #2a1f45;   /* texte sombre sur pastel = lisible */
  border: 1.5px solid #b09fd8;
  box-shadow: 0 2px 8px rgba(124,92,255,.18);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #bfaae0, #9bbdd4);
  box-shadow: 0 4px 12px rgba(124,92,255,.28);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-2);
  box-shadow: none;
}
.btn.ghost:hover { color: var(--text); border-color: var(--border-3); background: var(--bg-3); }

.btn.danger {
  background: #f7dada;
  color: #8a1c1c;
  border-color: #e8b0b0;
}
.btn.danger:hover { background: #f2c8c8; border-color: var(--danger); }

.btn.small { padding: 7px 12px; font-size: 13px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

/* ========== ÉCRAN D'AUTH ========== */
#screen-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

#screen-auth .card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
#screen-auth .card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #e6dcf5, #d6e6f5, #f5dfe8, #d6ecdf);
}
#screen-auth h1 {
  background: linear-gradient(135deg, #7c5cff, #2a8fb0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
#screen-auth .row { margin-top: 22px; }
#screen-auth .row .btn { flex: 1; padding: 13px 18px; }

/* ========== APP (connecté) ========== */
#screen-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(250, 248, 243, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #7c5cff, #2a8fb0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.tab {
  padding: 8px 14px;
  background: transparent;
  color: var(--text-dim);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.tab:hover  { color: var(--text); background: var(--bg-3); }
.tab.active {
  color: var(--text);
  background: var(--bg-2);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.tab.active::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(124,92,255,.5);
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#user-mail { font-size: .85em; color: var(--text-2); }

/* ========== PANES ========== */
.tabpane {
  display: none;
  flex: 1;
  padding: 28px 24px 100px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn .22s ease;
}
.tabpane.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== STUDIO — SECTIONS ========== */
.sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.section-card {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.section-card:hover  { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.section-card.open   { border-color: var(--accent); box-shadow: var(--shadow-md); }

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.section-header:hover { background: var(--bg-3); }

.section-icon {
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-sky));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 20px;
  flex-shrink: 0;
}

.section-title {
  flex: 1;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text);
}
.section-sub {
  color: var(--muted);
  font-size: .85em;
  font-weight: 500;
  margin-top: 2px;
}

.section-chevron {
  color: var(--text-dim);
  transition: transform var(--transition);
  font-size: 1.15em;
  font-weight: 700;
}
.section-card.open .section-chevron { transform: rotate(180deg); }

.section-body {
  display: none;
  padding: 4px 20px 22px;
  border-top: 1px solid var(--border);
  animation: fadeIn .22s ease;
  background: var(--bg-2);
}
.section-card.open .section-body { display: block; }

.section-body .upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-3);
  margin-top: 16px;
}
.section-body .upload-zone:hover {
  border-color: var(--accent);
  background: var(--pastel-lavender);
}
.section-body .upload-zone.has-img {
  padding: 10px;
  border-style: solid;
  border-color: var(--success);
  background: var(--pastel-mint);
}
.section-body .upload-zone img {
  max-width: 180px;
  max-height: 180px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.section-body .upload-zone .placeholder { color: var(--text-2); }
.section-body .upload-zone .placeholder strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
  font-size: 1em;
}

.section-body .actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.section-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.section-results .thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.section-results .thumb:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.section-results .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.section-results .thumb.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  cursor: default;
  box-shadow: none;
}
.section-results .thumb.skeleton:hover { transform: none; border-color: var(--border); box-shadow: none; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.section-results .thumb.error {
  border-color: var(--danger);
  background: #f8e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 22px;
  font-weight: 800;
}

/* ========== MES CRÉATIONS ========== */
.creations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.creation-card {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.creation-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.creation-thumb {
  aspect-ratio: 4/3;
  background: var(--bg-3);
  overflow: hidden;
  position: relative;
}
.creation-thumb img { width: 100%; height: 100%; object-fit: cover; }

.creation-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.creation-badge.done     { background: #d6ecdf; color: #1f5c30; border: 1px solid #9ed0ae; }
.creation-badge.running  { background: #d6e6f5; color: #1e4a6b; border: 1px solid #9dbcd8; }
.creation-badge.pending  { background: #f7edc4; color: #6b4d0e; border: 1px solid #e0cb80; }
.creation-badge.error,
.creation-badge.cancelled{ background: #f7dada; color: #8a1c1c; border: 1px solid #e8a8a8; }

.creation-info {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.creation-info .title { font-weight: 800; font-size: .95em; color: var(--text); margin-bottom: 4px; }
.creation-info .meta  { color: var(--muted); font-size: .82em; display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }

.creation-detail {
  grid-column: 1 / -1;
  background: var(--bg-2);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px;
  animation: fadeIn .22s ease;
  box-shadow: var(--shadow-md);
}
.creation-detail .detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.creation-detail .detail-head strong { color: var(--text); font-size: 1.05em; }

/* ========== FILE D'ATTENTE ========== */
.queue-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.queue-item:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.queue-item.dragging { opacity: .4; cursor: grabbing; }
.queue-item.drag-over { border-color: var(--accent); transform: scale(1.01); }

.queue-item .drag-handle {
  color: var(--muted);
  font-size: 20px;
  flex-shrink: 0;
  font-weight: 700;
}
.queue-item .q-body { flex: 1; min-width: 0; }
.queue-item .q-title { font-weight: 800; font-size: .95em; color: var(--text); }
.queue-item .q-meta  { color: var(--muted); font-size: .82em; margin-top: 3px; font-weight: 500; }

.queue-item .progress {
  width: 100%;
  height: 6px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.queue-item .progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s ease;
  border-radius: 3px;
}

/* ========== CLÉS API ========== */
#form-keys {
  max-width: 720px;
  margin-top: 20px;
  background: var(--bg-2);
  padding: 22px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#keys-input { min-height: 200px; }

/* ========== ADMIN ========== */
#admin-login {
  max-width: 380px;
  margin-top: 20px;
  background: var(--bg-2);
  padding: 22px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#admin-panel { margin-top: 24px; }
#admin-file-select { max-width: 340px; margin-bottom: 12px; }
#admin-file-content { min-height: 280px; }

#admin-shared-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: .9em;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#admin-shared-table th,
#admin-shared-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
#admin-shared-table th {
  color: var(--text-2);
  font-weight: 800;
  font-size: .82em;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--bg-3);
}
#admin-shared-table tr:last-child td { border-bottom: none; }
#admin-shared-table td { font-family: "SF Mono", Menlo, monospace; font-size: .85em; }

/* ========== MODAL ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

.modal-content {
  position: relative;
  background: var(--bg-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-lg);
  max-width: 980px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-content > img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--bg-3);
  align-self: start;
  max-height: 80vh;
  box-shadow: var(--shadow);
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px; height: 36px;
  background: var(--bg-3);
  color: var(--text);
  border: 1.5px solid var(--border-2);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}
.modal-close:hover { background: #f7dada; color: var(--danger); border-color: var(--danger); }

@media (max-width: 780px) {
  .modal-content { grid-template-columns: 1fr; padding: 20px; }
  .modal-content > img { max-height: 40vh; }
}

/* ========== MINI QUEUE FLOTTANTE ========== */
.mini-queue {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .88em;
  cursor: pointer;
  z-index: 900;
  transition: all var(--transition);
  max-width: 320px;
}
.mini-queue:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.mini-queue .mq-title {
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.mini-queue .mq-title::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(42,143,176,.6);
  animation: pulse 1.4s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.9); }
}
.mini-queue .mq-meta { color: var(--muted); font-size: .85em; font-weight: 500; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 6px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .tabs { order: 3; width: 100%; }
  .topbar .right { margin-left: auto; }
  .tabpane { padding: 20px 16px 110px; }
  .creations { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.15rem; }
  .section-results { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .mini-queue { right: 12px; bottom: 12px; max-width: calc(100% - 24px); }
  #screen-auth .card { padding: 30px 22px; }
  .brand { font-size: 1rem; }
}

/* ========== TOASTS ========== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 13px 20px;
  background: var(--bg-2);
  color: var(--text);
  border: 1.5px solid var(--border-2);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .92em;
  font-weight: 600;
  animation: slideIn .25s ease;
  max-width: 340px;
  pointer-events: auto;
}
.toast.ok  { border-left-color: var(--success); background: #f0faf3; color: #1f5c30; }
.toast.err { border-left-color: var(--danger);  background: #fdf0f0; color: #8a1c1c; }
.toast.fade-out { animation: slideOut .25s ease forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ========== ACCESSIBILITÉ ========== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Lien hypertexte par défaut */
a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent); }