/* Accès Externe styles */

.ext-main {
  padding: 4px 28px 60px 12px;
}
.ext-panel {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 32px 36px 36px;
  min-height: calc(100vh - 100px);
  box-shadow: var(--shadow-sm);
}

.ext-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.ext-header h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #4f8df6, #2a5cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ext-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}
.btn-ext-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8df6, #2a5cff);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42,92,255,.25);
  transition: all .15s;
}
.btn-ext-create:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ext-create .plus { font-size: 18px; line-height: 1; }

/* Toolbar */
.ext-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ext-search {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-mute);
  box-shadow: var(--shadow-sm);
}
.ext-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.ext-search .ico {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--brand-soft);
  display: grid; place-items: center;
  color: var(--brand);
}

.ext-type-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  min-width: 180px;
  justify-content: space-between;
}

.ext-tabs {
  display: flex;
  gap: 2px;
  align-items: center;
}
.ext-tab {
  padding: 12px 18px;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: 10px;
  transition: all .15s;
}
.ext-tab.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.ext-tab:hover { background: var(--bg-soft); }
.ext-tab.active:hover { background: var(--brand-soft); }

/* Table */
.ext-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ext-table {
  width: 100%;
  border-collapse: collapse;
}
.ext-table thead th {
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  font-weight: 700;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}
.ext-table td {
  padding: 22px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  vertical-align: middle;
}
.ext-table tr:last-child td { border-bottom: none; }
.ext-table tr:hover { background: #fafbfd; }

/* Type cell with icon */
.ext-type-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 120px;
}
.ext-type-icon {
  width: 58px; height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.25);
}
.ext-type-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
}

.ext-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ext-desc { font-size: 12px; color: var(--text-soft); margin-top: 4px; line-height: 1.5; max-width: 480px; }

.ext-lang {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ede5ff;
  color: #5524a8;
  font-size: 12px;
  font-weight: 700;
}

.ext-action-cell { display: flex; gap: 6px; align-items: center; }
.ext-btn-voir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
}
.ext-btn-voir:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.ext-btn-del {
  width: 38px; height: 38px;
  background: #fdecea;
  border: 1px solid #f4c2bc;
  color: var(--danger);
  border-radius: 10px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.ext-btn-del:hover { background: #fbd8d3; }

/* Public/Privé column */
.vis-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.vis-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.vis-pill.public-l { background: #dde9ff; color: #2a5cff; }
.vis-pill.public-g {
  background: #d9f7e3; color: #0f6b2a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vis-pill.priv { background: #ececf1; color: #5a5c6a; }
.vis-pill:hover { filter: brightness(.95); }

/* Author cell */
.author-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 160px;
}
.author-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.author-meta .name { font-weight: 700; font-size: 13px; }
.author-meta .date { font-size: 12px; color: var(--text-soft); margin-top: 2px; font-variant-numeric: tabular-nums; }

.ext-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-soft);
}
.ext-empty .ic {
  width: 80px; height: 80px;
  border-radius: 999px;
  background: var(--brand-soft);
  display: grid; place-items: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: var(--brand);
}

/* Create modal */
.ext-modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.ext-modal .sub { margin: 0 0 18px; color: var(--text-soft); font-size: 13px; }
.lang-picker { display: flex; gap: 6px; }
.lang-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.lang-btn.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.vis-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vis-card {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
}
.vis-card:hover { border-color: var(--brand); }
.vis-card.active { background: var(--brand-soft); border-color: var(--brand); }
.vis-card .vt { font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.vis-card .vd { font-size: 11px; color: var(--text-soft); margin-top: 4px; }

/* Created flash */
.ext-table tr.is-new td { animation: flashRow 1.6s ease-out; }
@keyframes flashRow {
  0%   { background: #fff; }
  20%  { background: #e8fff0; }
  100% { background: #fff; }
}

/* Toast */
.ext-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #d9f7e3;
  border: 1px solid #8de0a4;
  color: #0e6b34;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: rise .25s, fadeOut .4s 2.6s forwards;
}

/* Aimy: feature cards */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.feat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  text-align: left;
}
.feat-card:hover { border-color: var(--brand); }
.feat-card.explored { background: #f3fff6; border-color: #b9e08c; }
.feat-card .fn { font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.feat-card .fd { font-size: 10px; color: var(--text-soft); line-height: 1.3; margin-top: 3px; }
.feat-card .fcheck {
  position: absolute;
  top: 4px; right: 4px;
  width: 14px; height: 14px;
  background: #2ee07a;
  color: #fff;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 9px;
}

.sim-progress {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.sim-progress .sp {
  flex: 1;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .2s;
}
.sim-progress .sp.done {
  background: #e8fff0;
  border-color: #8de0a4;
  color: #0e6b34;
}
.sim-progress .sp .sm { font-size: 16px; display: block; margin-bottom: 2px; }

/* ============================
   FINAL CELEBRATION (Aimy + Page overlay)
   ============================ */
.final-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(99,102,241,.95) 0%, rgba(31,33,56,.98) 70%);
  z-index: 300;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  animation: fadeIn .3s;
}
.final-card {
  width: min(900px, 100%);
  background: linear-gradient(180deg, #ffffff 0%, #f4f6ff 100%);
  border-radius: 28px;
  padding: 48px 48px 40px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  position: relative;
  animation: rise .4s cubic-bezier(.2,.9,.3,1.1);
}
.final-card .close-final {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,.04);
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  display: grid; place-items: center;
  font-size: 18px;
}
.final-card .eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.final-card h1 {
  margin: 0 0 8px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.final-card .lead {
  font-size: 17px;
  color: var(--text-soft);
  margin: 0 0 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.path-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.path-step {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  transition: all .3s;
  opacity: 0.4;
}
.path-step.done {
  border-color: #2ee07a;
  background: #f3fff6;
  opacity: 1;
  box-shadow: 0 6px 16px rgba(46,224,122,.18);
}
.path-step .pe { font-size: 26px; }
.path-step .pn { font-size: 11px; font-weight: 700; margin-top: 6px; line-height: 1.3; color: var(--text); }
.path-step.done .pn { color: #0e6b34; }
.path-step .pcheck {
  width: 18px; height: 18px;
  background: #2ee07a;
  color: #fff;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
}
.master-seal {
  width: 140px; height: 140px;
  border-radius: 999px;
  margin: 0 auto 16px;
  background: conic-gradient(from 0deg, #6366f1, #8b5cf6, #ec4899, #f59e0b, #22c55e, #06b6d4, #6366f1);
  display: grid; place-items: center;
  font-size: 58px;
  position: relative;
  animation: spinSlow 16s linear infinite;
}
.master-seal::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 999px;
}
.master-seal span {
  position: relative;
  z-index: 2;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.master-title { font-size: 22px; font-weight: 800; margin: 4px 0 4px; }
.master-sub { color: var(--text-soft); font-size: 14px; }
.master-pts {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #6a3e0d;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(245,158,11,.35);
}
.final-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.final-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
}
.final-btn.primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 20px rgba(99,102,241,.4);
}
.final-btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.final-btn.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.final-btn.ghost:hover { background: var(--bg-soft); }

.cf {
  position: absolute;
  width: 10px; height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  pointer-events: none;
  animation: cfDrop 4s ease-out forwards;
}
@keyframes cfDrop {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 760px) {
  .path-grid { grid-template-columns: repeat(3, 1fr); }
  .final-card { padding: 32px 22px 28px; }
}
