/* ==========================================================================
   MyShareBox — feuille de styles
   ========================================================================== */

/* Couleurs, arrondis et ombres : voir css/tokens.css (partagé avec le panel admin). */

/* ---------- Mise en page ---------- */
:root {
  --ui-scale: 1.21; /* agrandissement global de l'interface (hors mobile) */
  --text-scale: 0.9; /* taille du TEXTE du site public (1 = d'origine, 0.9 = 10 % plus petit) ; le panel admin n'est pas concerné */
  --container: 1000px;
  --gutter: 24px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Les mobiles et petites tablettes gardent leur taille d'origine, déjà adaptée au tactile. */
@media (min-width: 721px) {
  html {
    zoom: var(--ui-scale);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: calc(15px * var(--text-scale, 1));
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, p, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-hover);
}

.btn-outline {
  height: 34px;
  padding: 0 14px;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--navy);
  font-size: calc(13px * var(--text-scale, 1));
}

.btn-outline:hover {
  border-color: var(--blue);
  background: var(--tint);
}

.btn-ghost {
  padding: 8px 12px;
  background: transparent;
  color: var(--navy);
  font-size: calc(14px * var(--text-scale, 1));
}

.btn-ghost:hover {
  background: var(--surface-soft);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 35; /* au-dessus de la zone principale : la liste des langues déborde du header */
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.header-logo {
  justify-self: start;
  border-radius: var(--radius-sm);
}

.brand {
  justify-self: center;
  font-size: calc(18px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy);
  text-decoration: none;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

/* Le lien « Offres » est toujours souligné, comme si l'on était déjà sur sa page, sur toutes les pages du site. */
.header-link {
  color: var(--navy);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.btn-account[aria-current="page"] {
  box-shadow: 0 0 0 3px var(--navy-soft);
}

.btn-account {
  height: 34px;
  padding: 0 16px;
  font-size: calc(13px * var(--text-scale, 1));
  box-shadow: var(--shadow-btn);
}

.btn-account-icon {
  display: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Sélecteur de langue ---------- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
}

.lang-btn {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  background: var(--surface-soft);
  color: var(--navy);
}

/* Langue actuelle : pastille pleine, avec une petite flèche qui indique la liste cachée. */
.lang-current {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 46px;
  padding: 0 10px;
  background: var(--navy);
  color: #fff;
}

.lang-current:hover {
  background: var(--navy-hover);
  color: #fff;
}

.lang-current::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.lang-switcher {
  position: relative;
}

/* Les autres langues : cachées, elles apparaissent au survol, au toucher ou au clavier. */
.lang-options {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  padding-top: 8px; /* pont invisible : le survol ne se perd pas entre la pastille et la liste */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity calc(0.2s * var(--slow, 1)) ease, transform calc(0.2s * var(--slow, 1)) ease,
    visibility 0s linear calc(0.2s * var(--slow, 1));
}

/* Petit écran : la liste s'aligne sur le bord droit de la pastille, pour ne jamais dépasser de la page (même cachée, elle élargirait l'écran). */
@media (max-width: 720px) {
  .lang-options {
    left: auto;
    right: 0;
  }
}

.lang-switcher.is-open .lang-options,
.lang-switcher:has(:focus-visible) .lang-options {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* Le survol n'existe que sur les appareils à souris : sur écran tactile, il « colle » après un appui. */
@media (hover: hover) {
  .lang-switcher:hover .lang-options {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  .lang-switcher:hover .lang-current::after {
    transform: rotate(225deg) translate(-1px, -1px);
  }
}

.lang-switcher.is-open .lang-current::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.lang-options-box {
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-option[hidden] {
  display: none;
}

.lang-option:hover {
  background: var(--surface-soft);
  color: var(--navy);
}

.lang-option-code {
  min-width: 26px;
  font-weight: 800;
  color: var(--navy);
}

.lang-option-name {
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  flex: 1;
  padding-block: 72px;
  background: var(--hero-gradient);
}

.hero-grid {
  display: grid;
  grid-template-columns: 470px minmax(0, 1fr);
  /* Les deux colonnes partent du haut : le texte de présentation ne bouge plus quand la carte grandit. Son décalage d'origine (centré sur la
     carte au repos) est posé par js/main.js (pinIntro). */
  align-items: start;
  gap: 56px;
}

/* ---------- Carte d'upload ---------- */
.upload-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 262px;
  padding: 40px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropzone:hover {
  border-color: var(--border-strong);
}

.dropzone.is-dragover {
  border-color: var(--blue);
  border-style: solid;
  background: var(--tint);
}

.dropzone.is-invalid {
  border-color: var(--red);
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.dropzone.is-dragover .dropzone-icon {
  transform: translateY(-4px);
}

.dropzone-title {
  font-size: calc(18px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--text);
}

.dropzone-subtitle {
  margin-top: 4px;
  font-size: calc(14px * var(--text-scale, 1));
  color: var(--text-muted);
}

.dropzone .btn-outline {
  margin-top: 20px;
}

/* ---------- Liste des fichiers ---------- */
.file-list {
  display: grid;
  gap: 8px;
  max-height: 228px;
  margin-top: 16px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--tint);
  color: var(--navy);
}

.file-icon svg,
.file-remove svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-name {
  overflow: hidden;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: calc(12px * var(--text-scale, 1));
  color: var(--text-soft);
}

.file-remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.file-remove:hover {
  background: var(--red-soft);
  color: var(--red);
}

.file-summary {
  margin-top: 10px;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Erreurs ---------- */
.form-errors:empty {
  display: none;
}

.form-errors {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 500;
}

/* ---------- Maintenance ---------- */
.maintenance-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  background: var(--status-warning-bg);
  color: var(--status-warning);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
}

.dropzone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Options du lien ---------- */
.link-options {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.link-options summary {
  padding: 10px 12px;
  color: var(--navy);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
}

.link-options-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}

.option-field {
  display: grid;
  gap: 4px;
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--text-muted);
}

.option-input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 500;
}

.option-check {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-body);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  cursor: pointer;
}

.option-check[hidden] {
  display: none;
}

.option-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}

/* ---------- Adresse e-mail de l'envoyeur (mode « envoi vérifié ») ---------- */
.verify {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.verify-intro {
  color: var(--text-body);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
}

.verify-code {
  max-width: 180px;
  font-size: calc(20px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
}

.verify-status {
  color: var(--text-muted);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 600;
}

.verify-status.is-error {
  color: var(--red);
}

.verify-status:empty {
  display: none;
}

.verify-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.link-button {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:disabled {
  color: var(--text-soft);
  text-decoration: none;
  cursor: default;
}

.result-validity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 10px;
  margin-top: 10px;
}

.result-validity .result-meta {
  margin-top: 0;
}

/* ---------- Fenêtre « Étendre la date de validité » ---------- */
.extend-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.35);
}

.extend-dialog::backdrop {
  background: rgba(11, 18, 32, 0.55);
}

.extend-body {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.extend-title {
  font-size: calc(20px * var(--text-scale, 1));
  font-weight: 800;
  color: var(--navy);
}

.extend-text {
  color: var(--text-muted);
  font-size: calc(14px * var(--text-scale, 1));
}

.extend-options {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.extend-legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--text);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 800;
}

.extend-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.extend-option.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  background: var(--surface-soft);
}

.extend-option-main {
  display: grid;
  gap: 2px;
}

.extend-option-main small,
.extend-summary small {
  color: var(--text-muted);
  font-size: calc(12px * var(--text-scale, 1));
}

.extend-price {
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 800;
  color: var(--navy);
}

.extend-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.extend-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: calc(15px * var(--text-scale, 1));
}

/* Durée promotionnelle : prix de base barré à côté du prix payé. */
.extend-summary-price {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 2px 8px;
  text-align: right;
}

.extend-price-old {
  color: var(--text-soft);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
  text-decoration-thickness: 2px;
}

.extend-promo-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--status-good);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 800;
}

.extend-summary-promo {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.extend-demo {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--status-warning-bg);
  color: var(--status-warning);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
}

.extend-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.extend-button {
  height: 42px;
  padding: 0 18px;
  font-size: calc(14px * var(--text-scale, 1));
}

.extend-done-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--status-good);
  font-size: calc(24px * var(--text-scale, 1));
  font-weight: 800;
}

.viewer-extend {
  display: block;
  margin: 2px 0 0 auto;
}

/* ---------- Contacter l'équipe (réutilise la fenêtre ci-dessus) ---------- */
.contact-form {
  display: grid;
  gap: 12px;
}

.contact-textarea {
  height: auto;
  padding: 10px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.4;
}

.contact-identity {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-body);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-note {
  font-size: calc(12px * var(--text-scale, 1));
}

/* Champ piège anti-robot : hors écran (pas display:none, que certains robots détectent). */
.contact-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Chat avec l'équipe ---------- */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(11, 18, 32, 0.28);
  cursor: pointer;
}

.chat-launcher:hover {
  background: var(--navy-hover);
}

.chat-launcher-icon,
.chat-launcher-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.chat-launcher-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.chat-badge[hidden],
.chat-panel[hidden],
.chat-composer[hidden],
.chat-error[hidden] {
  display: none;
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 78px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 360px;
  height: min(560px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.3);
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: #fff;
}

.chat-title {
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 800;
}

.chat-subtitle {
  margin-top: 2px;
  font-size: calc(12px * var(--text-scale, 1));
  opacity: 0.8;
}

.chat-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: calc(24px * var(--text-scale, 1));
  line-height: 1;
  cursor: pointer;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background: var(--surface-soft);
}

.chat-start {
  margin-top: 0;
}

.chat-start-button {
  height: 44px;
}

.chat-note {
  color: var(--text-muted);
  font-size: calc(12px * var(--text-scale, 1));
  text-align: center;
}

.chat-day {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: calc(11px * var(--text-scale, 1));
  font-weight: 700;
  text-align: center;
}

.chat-message {
  display: grid;
  gap: 2px;
  max-width: 84%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: calc(14px * var(--text-scale, 1));
}

.chat-message--mine {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--navy);
  color: #fff;
}

.chat-message--team {
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.chat-author {
  font-size: calc(11px * var(--text-scale, 1));
  font-weight: 800;
  opacity: 0.75;
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-time {
  font-size: calc(11px * var(--text-scale, 1));
  opacity: 0.65;
  text-align: right;
}

.chat-composer {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  max-height: 110px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.35;
  resize: none;
}

.chat-send {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
  cursor: pointer;
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-error {
  color: var(--red);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
}

.chat-permanent {
  color: var(--text-soft);
  font-size: calc(11px * var(--text-scale, 1));
  text-align: center;
}

.chat-notify {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-body);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 600;
  cursor: pointer;
}

.chat-notify input {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}

.chat-notice {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--status-good);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
  text-align: center;
}

@media (max-width: 720px) {
  .chat-launcher {
    right: 14px;
    bottom: 14px;
  }

  .chat-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: min(78vh, 600px);
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

.share-contact {
  margin-top: 4px;
  text-align: center;
}

.share-contact a {
  color: var(--text-muted);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-emailed {
  max-width: 380px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--status-good);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
}

/* ---------- CGU + envoi ---------- */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-body);
  cursor: pointer;
}

.consent[hidden] {
  display: none;
}

.consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.consent a {
  font-weight: 600;
  color: var(--blue);
  text-underline-offset: 2px;
}

.btn-send {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-size: calc(15px * var(--text-scale, 1));
}

.btn-send:hover:not(:disabled) {
  background: var(--green-hover);
}

.btn-send:disabled {
  background: var(--green-disabled);
  cursor: not-allowed;
}

/* ---------- Progression / résultat ---------- */
.upload-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 362px;
  padding: 16px;
  text-align: center;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
}

.status-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-icon--progress {
  background: var(--tint);
  color: var(--blue);
}

.status-icon--progress svg {
  animation: rise 1.2s ease-in-out infinite;
}

.status-icon--success {
  background: var(--green-soft);
  color: var(--green-check);
}

.status-title {
  font-size: calc(20px * var(--text-scale, 1));
  font-weight: 800;
  color: var(--navy);
}

.status-title:focus {
  outline: none;
  box-shadow: none;
}

.status-text {
  margin-top: 6px;
  font-size: calc(14px * var(--text-scale, 1));
  color: var(--text-muted);
}

.progress {
  width: 100%;
  height: 10px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--tint);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  transition: width 0.2s linear;
}

.progress-value {
  margin-top: 10px;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.link-field {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
}

.link-field input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--navy);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
}

.btn-copy {
  height: 46px;
  min-width: 96px;
  padding: 0 18px;
  font-size: calc(14px * var(--text-scale, 1));
}

.btn-copy.is-copied {
  background: var(--green);
}

.result-meta {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: calc(13px * var(--text-scale, 1));
}

.result-meta:empty {
  display: none;
}

.result-open {
  margin-top: 8px;
  color: var(--blue);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
}

.manage-link {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  background: var(--status-warning-bg);
  text-align: left;
}

.manage-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 800;
  color: var(--status-warning);
}

.manage-alert::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--status-warning);
  color: #fff;
  font-size: calc(13px * var(--text-scale, 1));
  line-height: 1;
}

.manage-title {
  display: block;
  margin-top: 12px;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 800;
  color: var(--text);
}

.manage-mail {
  margin-top: 4px;
}

.manage-mail-status {
  margin-top: 6px;
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--green);
}

.manage-mail-status.is-error {
  color: var(--status-danger, #b91c1c);
}

.manage-mail-status:empty {
  display: none;
}

.link-field--small {
  margin-top: 8px;
}

.link-field--small input {
  height: 38px;
  font-size: calc(12px * var(--text-scale, 1));
  background: var(--surface);
}

.link-field--small .btn {
  height: 38px;
}

.manage-hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: calc(12px * var(--text-scale, 1));
}

.upload-status .btn-ghost {
  margin-top: 16px;
}

@keyframes rise {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-3px); }
}

/* ---------- Présentation ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--navy);
  font-size: calc(11.5px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-dot);
}

.hero-title {
  margin-top: 18px;
  font-size: calc(clamp(2.25rem, 4.4vw, 2.75rem) * var(--text-scale, 1));
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.hero-text {
  max-width: 450px;
  margin-top: 20px;
  font-size: calc(17px * var(--text-scale, 1));
  line-height: 1.55;
  color: var(--text-muted);
}

.features {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: calc(15px * var(--text-scale, 1));
  font-weight: 600;
}

.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-check);
}

.check svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-top: 44px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
}

.footer-brand p {
  max-width: 190px;
  margin-top: 20px;
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-body);
}

.footer-title {
  margin: 6px 0 16px;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-col ul {
  display: grid;
  gap: 14px;
}

.footer-col a {
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-body);
  text-decoration: none;
  border-radius: 4px;
}

.footer-col a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-block: 22px 28px;
  border-top: 1px solid var(--border);
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-body);
}

.footer-company {
  font-weight: 800;
  color: var(--blue);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablette : les colonnes du hero s'empilent
   (seuil relevé à cause de l'agrandissement --ui-scale) */
@media (max-width: 1190px) {
  .hero {
    padding-block: 48px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-intro,
  .upload-card {
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
  }

  /* Sur petit écran, le titre explique la page avant la carte d'upload */
  .hero-intro {
    order: -1;
  }

  .hero-text {
    max-width: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    min-height: 60px;
  }

  .brand {
    justify-self: start;
    font-size: calc(17px * var(--text-scale, 1));
  }

  .header-actions {
    gap: 8px;
  }

  .header-divider {
    display: none;
  }

  .btn-account {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .btn-account-icon {
    display: block;
  }

  .btn-account-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .hero {
    padding-block: 32px 40px;
  }

  .hero-title {
    font-size: calc(2rem * var(--text-scale, 1));
  }

  .hero-text {
    font-size: calc(16px * var(--text-scale, 1));
  }

  .upload-card {
    padding: 16px;
  }

  .dropzone {
    min-height: 220px;
    padding: 32px 16px;
  }

  .btn-outline {
    height: 44px;
    padding: 0 18px;
  }

  .btn-send {
    height: 52px;
  }

  .consent[hidden] {
  display: none;
}

.consent input {
    width: 20px;
    height: 20px;
    margin-top: -1px;
  }

  .upload-status {
    min-height: 300px;
  }

  .link-field {
    flex-direction: column;
  }

  .link-options-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Écrans tactiles : cibles plus grandes */
@media (pointer: coarse) {
  .lang-btn {
    min-width: 40px;
    height: 40px;
  }

  .footer-col ul {
    gap: 6px;
  }

  .footer-col a {
    display: inline-block;
    padding-block: 6px;
  }
}

/* Mouvements réduits */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Essai gratuit de Premium proposé dans la fenêtre de récupération */
.extend-trial {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong, #c9d4e5);
}

.extend-trial-or {
  margin: 0;
  color: var(--text-muted, #5b6b85);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
  text-transform: uppercase;
}

.extend-trial .extend-button {
  justify-self: start;
  text-decoration: none;
}

/* Proposition Premium dans « Étendre la date de validité » : garder le fichier en illimité. */
.extend-premium {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border: 2px solid var(--navy);
  border-radius: var(--radius-md);
  background: var(--navy-soft, #eef2fa);
}

.extend-premium .extend-text {
  margin: 0;
}

.extend-premium-title {
  color: var(--navy);
  font-size: calc(16px * var(--text-scale, 1));
}

.extend-premium-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
  font-weight: 700;
  color: var(--text-muted);
}

.extend-premium-price strong {
  color: var(--text);
  font-size: calc(26px * var(--text-scale, 1));
  font-weight: 800;
}

.extend-premium-price strong.is-struck {
  color: var(--text-soft);
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 700;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.extend-premium-price .is-struck-unit {
  color: var(--text-soft);
  text-decoration: line-through;
}

.extend-premium-badge {
  align-self: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 800;
}

.extend-premium .extend-button {
  text-decoration: none;
}

/* Aide sous un champ d'option, et marque de l'auteur (offre Business) sur la page de téléchargement */
.option-hint {
  display: block;
  margin-top: 4px;
  color: var(--text-muted, #5b6b85);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 500;
}

.option-hint a,
.share-hint a {
  color: var(--navy);
  font-weight: 700;
}

.share-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.share-brand-logo {
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
}

.share-brand-name {
  font-size: calc(18px * var(--text-scale, 1));
  font-weight: 800;
}

.share-limit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 10px 0;
}

.share-limit .option-field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.share-limit-input {
  width: 160px;
}

/* Fenêtre d'attente avant un téléchargement */
.wait-dialog .extend-body { text-align: center; }
.wait-count { margin: 0.25rem 0 0.75rem; font-size: calc(3rem * var(--text-scale, 1)); font-weight: 700; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.wait-bar { display: block; height: 6px; margin: 0 0 1rem; border-radius: 3px; background: var(--navy-soft, #e8edf5); overflow: hidden; }
.wait-bar-fill { display: block; height: 100%; width: 0; background: var(--navy); transition: width 1s linear; }

/* Informations légales et cases à cocher de la fenêtre d'essai. */
.order-info {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  color: var(--text-body);
  font-size: calc(0.92rem * var(--text-scale, 1));
  line-height: 1.5;
}

ul.order-info {
  display: grid;
  gap: 4px;
}

/* Fenêtre de commande : un peu plus large, bouton long sur plusieurs lignes et en pleine largeur au-dessus de « Annuler ». */
.extend-dialog:has(.order-block) {
  width: min(520px, calc(100vw - 32px));
}

.extend-actions:has(.order-submit) {
  flex-direction: column-reverse;
  align-items: stretch;
}

.order-submit {
  height: auto;
  min-height: 46px;
  padding: 10px 16px;
  line-height: 1.3;
  white-space: normal;
}

.order-info strong {
  color: var(--text);
}

.order-checks {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.order-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: calc(0.92rem * var(--text-scale, 1));
  line-height: 1.45;
  color: var(--text-body);
  cursor: pointer;
}

.order-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.order-check a,
.order-info a {
  color: var(--blue);
  text-decoration: underline;
}

/* Bouton « Créer un compte » de l'en-tête (affiché par js/header-auth.js ; masqué sur petit écran : la place manque). */
.btn-signup[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .btn-signup {
    display: none;
  }
}

/* Envoi sans compte : proposition de créer un compte, sous le résultat. */
.signup-nudge {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong, #c4cde0);
  border-radius: var(--radius-md, 12px);
  background: var(--surface-soft, #f5f7fb);
  text-align: center;
}

.signup-nudge[hidden] {
  display: none;
}

.signup-nudge-title {
  margin: 0;
  font-weight: 800;
  color: var(--text);
}

.signup-nudge-text {
  margin: 0;
  max-width: 44ch;
  color: var(--text-soft, #5b6b8c);
  font-size: calc(13.5px * var(--text-scale, 1));
}

/* Visiteur sans compte : limite de téléchargements du jour (page de téléchargement). */
.visitor-quota {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--border, #d8e0ee);
  border-radius: 12px;
  background: var(--surface-soft, #f5f7fb);
  font-size: calc(14px * var(--text-scale, 1));
}

.visitor-quota p {
  margin: 0;
}

.visitor-quota.is-reached {
  border-color: #e0a100;
  background: #fff7e0;
  color: #5a3d00;
}

/* « Pourquoi créer un compte gratuit ? » sous le formulaire de connexion. */
.auth-why {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong, #c4cde0);
  border-radius: 12px;
  background: var(--surface-soft, #f5f7fb);
  font-size: calc(13.5px * var(--text-scale, 1));
}

.auth-why-title {
  margin: 0 0 6px;
  font-size: calc(15px * var(--text-scale, 1));
}

.auth-why ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.visitor-quota .btn {
  padding: 9px 18px;
  white-space: nowrap;
}

/* Ce que permet l'offre actuelle, sous la zone de dépôt (taille par fichier et par envoi) et lien vers l'offre supérieure. */
.limits-hint {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  text-align: center;
  font-size: calc(13.5px * var(--text-scale, 1));
}

.limits-hint[hidden] {
  display: none;
}

.limits-hint-text {
  margin: 0;
  color: var(--text-soft, #5b6b8c);
}

.limits-hint-link {
  color: var(--blue, #1e3a8a);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.limits-hint-link[hidden] {
  display: none;
}

/* Durées plus longues avec un compte ou une offre : phrase sous la liste « Durée de validité ». */
.expiration-hint {
  margin: -4px 0 4px;
}

.expiration-hint[hidden] {
  display: none;
}

.expiration-hint a {
  color: var(--blue, #1e3a8a);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Envoyer par e-mail (facultatif) : destinataires, message, copie, notification. */
.send-mail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.send-mail .option-hint.is-error {
  color: var(--red, #c62828);
  font-weight: 600;
}

.send-mail .option-hint[hidden],
.send-mail-more[hidden] {
  display: none;
}

.send-mail-more {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border, #d8e0ee);
  border-radius: 12px;
  background: var(--surface-soft, #f5f7fb);
}

.send-mail-more textarea {
  resize: vertical;
}

/* Message de l'expéditeur, sur la page de téléchargement. */
.share-invite {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-left: 4px solid var(--navy, #1e3a8a);
  border-radius: 8px;
  background: var(--surface-soft, #f5f7fb);
}

.share-invite p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Page « Ne plus recevoir d'e-mails » */
.block-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}