/* ============================================================================
   Calyx — Styles spécifiques
   Version : 2.2.1 (VNCT Design System)

   Ce fichier contient UNIQUEMENT les styles propres à Calyx.
   Variables, thèmes, FAB, modals, toasts, nav, version badge
   sont gérés par vnct-design-system.css et vnct-common.js.
   ============================================================================ */

/* ── Layout ── */
.container {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-12);
}

.header { text-align: center; margin-bottom: var(--space-10); }
.logo {
  /* Hero landing : clamp fluid 40px → 60px, aligné sur Ostra.
     --text-2xl (31px) du DS est trop timide pour un hero.
     Extraction dans le DS commun trackée dans Nexus #32. */
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}
.logo span { color: var(--accent); }
.subtitle {
  color: var(--text-muted); font-size: var(--text-sm);
  font-weight: var(--font-light); letter-spacing: 0.5px;
}
.vault-count {
  color: var(--text-muted); font-size: var(--text-xs);
  margin-top: var(--space-2);
}

/* ── Upload zone ── */
.upload-zone {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.dropzone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.dropzone:hover,
.dropzone--dragover {
  border-color: var(--accent);
  background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.05);
}

.dropzone__icon {
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  transition: color 0.3s ease;
}

.dropzone:hover .dropzone__icon {
  color: var(--accent);
}

.dropzone__text {
  font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.dropzone__hint {
  color: var(--text-muted); font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.dropzone__actions {
  display: flex; justify-content: center;
  gap: var(--space-2); margin-top: var(--space-4);
}

.dropzone__btn {
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-secondary); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-family); font-size: var(--text-xs); font-weight: var(--font-medium);
  cursor: pointer; transition: all 0.2s;
}

.dropzone__btn:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ── File list ── */
.files-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.files-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-3);
}

.files-title {
  font-size: var(--text-sm); color: var(--text-muted);
  display: flex; align-items: center; gap: var(--space-2);
}

.files-count {
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  border-radius: var(--radius-full); padding: 2px 10px; font-size: var(--text-xs);
}

.files-stats {
  font-size: var(--text-xs); color: var(--accent); font-weight: var(--font-medium);
}

.file-list {
  list-style: none; display: flex; flex-direction: column;
  gap: var(--space-1); max-height: 300px; overflow-y: auto;
}

.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  gap: var(--space-2);
}

.file-item__info {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
}

.file-item__name {
  font-size: var(--text-sm); color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.file-item__size {
  font-size: var(--text-xs); color: var(--text-muted);
}

.file-item__remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: var(--space-1); border-radius: var(--radius-sm);
  transition: color 0.15s ease; flex-shrink: 0; font-size: 1.1rem; line-height: 1;
}

.file-item__remove:hover { color: var(--danger); }

.clear-btn {
  margin-top: var(--space-3); width: 100%;
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-muted); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-family); font-size: var(--text-xs); font-weight: var(--font-medium);
  cursor: pointer; transition: all 0.2s;
}

.clear-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Settings ── */
.settings-section {
  display: flex; flex-direction: column; gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.form-group {
  display: flex; flex-direction: column; gap: var(--space-2);
}

/* ── Action / Progress ── */
.action-section {
  display: flex; flex-direction: column; gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.create-btn {
  width: 100%;
  padding: var(--space-3) var(--space-6); border: none; border-radius: var(--radius-md);
  background: var(--accent); color: #000;
  font-family: var(--font-family); font-size: var(--text-sm); font-weight: var(--font-semibold);
  cursor: pointer; transition: all 0.25s;
}

.create-btn:hover {
  box-shadow: var(--neon-shadow-md); transform: translateY(-1px);
}

.create-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.progress-bar {
  position: relative; height: 36px;
  background: var(--bg-secondary); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: var(--radius-md);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-bar__text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* ── Result ── */
.result-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}

.result-section__title {
  font-size: var(--text-lg); font-weight: var(--font-semibold);
  color: var(--accent); margin-bottom: var(--space-4);
}

.link-box {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.link-box__input {
  flex: 1; background: none; border: none;
  color: var(--accent); font-family: monospace; font-size: var(--text-sm);
  outline: none;
}

.link-box__copy {
  background: var(--accent); color: #000; border: none;
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-4);
  font-family: var(--font-family); font-size: var(--text-xs); font-weight: var(--font-semibold);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}

.link-box__copy:hover { box-shadow: var(--neon-shadow-sm); }

.result-section__expiry {
  font-size: var(--text-xs); color: var(--text-muted);
}

.result-section__expiry strong { color: var(--warning); }

.new-btn {
  margin-top: var(--space-4);
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-primary); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6); font-family: var(--font-family); font-size: var(--text-sm);
  font-weight: var(--font-medium); cursor: pointer; transition: all 0.2s;
}

.new-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── History ── */
.history { margin-top: var(--space-8); margin-bottom: var(--space-6); }
.history-title {
  font-size: var(--text-sm);
  color: var(--text-muted); margin-bottom: var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
}
.history-count {
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  border-radius: var(--radius-full); padding: 2px 10px; font-size: var(--text-xs);
}
.history-item {
  background: var(--bg-secondary); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2); display: flex; align-items: center; gap: var(--space-3);
  transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.history-item__icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--bg-tertiary); display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem;
}
.history-item__info { flex: 1; min-width: 0; }
.history-item__name {
  font-size: var(--text-sm); font-weight: var(--font-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; color: var(--text-primary);
}
.history-item__meta {
  font-size: var(--text-xs);
  color: var(--text-muted); margin-top: 2px; display: block;
}
.history-item__timer { color: var(--warning); font-weight: var(--font-bold); }
.history-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.history-item__copy,
.history-item__open,
.history-item__qr {
  -webkit-appearance: none; appearance: none;
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-muted); border-radius: var(--radius-md);
  padding: 6px 12px; font-family: var(--font-family); font-size: var(--text-xs);
  font-weight: var(--font-medium); cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: flex; align-items: center;
}
.history-item__delete {
  -webkit-appearance: none; appearance: none;
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-muted); border-radius: var(--radius-md);
  padding: 6px 12px; font-family: var(--font-family); font-size: var(--text-xs);
  font-weight: var(--font-medium); cursor: pointer; transition: all 0.2s;
}
.history-item__copy:hover,
.history-item__open:hover,
.history-item__qr:hover { border-color: var(--accent); color: var(--accent); }
.history-item__delete:hover { border-color: var(--danger); color: var(--danger); }
.history-item__delete.confirm-pending {
  border-color: var(--danger); color: var(--danger);
  background: rgba(240, 64, 80, 0.1);
}

/* ── Vault page — Auth ── */
.auth-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
}

.auth-info {
  text-align: center; color: var(--text-secondary); font-size: var(--text-sm);
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3);
}

.auth-error {
  color: var(--danger); font-size: var(--text-sm); text-align: center;
}

.unlock-btn {
  width: 100%;
  padding: var(--space-3) var(--space-6); border: none; border-radius: var(--radius-md);
  background: var(--accent); color: #000;
  font-family: var(--font-family); font-size: var(--text-sm); font-weight: var(--font-semibold);
  cursor: pointer; transition: all 0.25s;
}

.unlock-btn:hover {
  box-shadow: var(--neon-shadow-md); transform: translateY(-1px);
}

/* ── Vault page — Content ── */
.vault-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4);
}

.vault-title {
  font-size: var(--text-lg); font-weight: var(--font-semibold);
}

.vault-expiry {
  font-size: var(--text-sm); color: var(--text-muted);
}

.zip-btn {
  width: 100%; margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-6); border: none; border-radius: var(--radius-md);
  background: var(--accent); color: #000;
  font-family: var(--font-family); font-size: var(--text-sm); font-weight: var(--font-semibold);
  cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
}

.zip-btn:hover {
  box-shadow: var(--neon-shadow-md); transform: translateY(-1px);
}

.vault-files {
  display: flex; flex-direction: column; gap: var(--space-2);
}

.vault-file {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); gap: var(--space-3);
  transition: border-color 0.2s;
}

.vault-file:hover { border-color: var(--accent); }

.vault-file__info {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
}

.vault-file__name {
  font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.vault-file__size {
  font-size: var(--text-xs); color: var(--text-muted);
}

.vault-file__dl {
  background: var(--bg-tertiary); border: 1px solid var(--border-default);
  color: var(--text-muted); border-radius: var(--radius-md);
  padding: 6px 12px; font-family: var(--font-family); font-size: var(--text-xs);
  font-weight: var(--font-medium); cursor: pointer; transition: all 0.2s;
  text-decoration: none; flex-shrink: 0;
}

.vault-file__dl:hover { border-color: var(--accent); color: var(--accent); }

/* ── Loading / Not found ── */
.loading-section {
  text-align: center; padding: var(--space-8) 0; color: var(--text-muted);
}

.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--border-default); border-top-color: var(--accent);
  border-radius: 50%; animation: vl-spin 0.8s linear infinite;
}

@keyframes vl-spin { to { transform: rotate(360deg); } }

.not-found {
  text-align: center;
  background: var(--bg-secondary); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-8);
}

.not-found h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.not-found p { color: var(--text-muted); margin-bottom: var(--space-4); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .container { padding: var(--space-6) var(--space-4) var(--space-12); }
  .dropzone__actions { flex-direction: column; align-items: center; }
  .link-box { flex-direction: column; }
  .link-box__input { text-align: center; }
  .link-box__copy { width: 100%; }
}

/* ============================================================================
   Landing enrichie (v2.2.0) — pattern outil-first
   Sections pédagogiques sous l'outil. Modèle dérivé de Ostra v2.1.2.
   ============================================================================ */

.calyx-landing {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-12);
}

/* --- Section générique --- */
.calyx-section { margin-top: var(--space-10); }
.calyx-section__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  text-align: center;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

/* --- Grille "Comment ça marche" --- */
.calyx-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.calyx-step {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.calyx-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.calyx-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-hover);
  color: var(--accent);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.calyx-step__icon {
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: center;
}
.calyx-step__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.calyx-step__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* --- Tags cas d'usage --- */
.calyx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.calyx-tag {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* --- Encart no-log --- */
.calyx-trust {
  margin-top: var(--space-10);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.calyx-trust__icon {
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: center;
}
.calyx-trust__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.calyx-trust__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* --- Section lore (origine du nom) --- */
.calyx-lore {
  margin-top: var(--space-12);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.calyx-lore__separator {
  color: var(--text-muted);
  font-size: var(--text-sm);
  letter-spacing: 0.5em;
  margin-bottom: var(--space-5);
  user-select: none;
}
.calyx-lore__title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-4);
}
.calyx-lore__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}
.calyx-lore__body strong {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}
.calyx-lore__body em {
  color: var(--accent);
  font-style: italic;
}
.calyx-lore__tagline {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* --- Responsive landing --- */
@media (max-width: 720px) {
  .calyx-steps {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .calyx-trust,
  .calyx-lore {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
}
