/* ===========================================
   CONTENU PRINCIPAL
   =========================================== */
.timestamp-intro {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--SigaGold);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.timestamp-intro h1 {
  color: var(--SigaBlue);
  margin-bottom: 0.75rem;
}

.timestamp-intro p {
  color: var(--text-secondary);
  margin: 0.5rem 0;
  text-align: left;
}

/* ===========================================
   OUTIL (dépôt, options, résultat)
   =========================================== */
.timestamp-content {
  max-width: 640px;
  margin: 0 auto;
}

.timestamp-panel {
  background: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   ZONE DE DROP / SÉLECTION DE FICHIER
   =========================================== */
.drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

.drop-zone:hover {
  border-color: var(--SigaBlue);
  background-color: var(--bg-section);
}

.drop-zone.dragover {
  border-color: var(--SigaBlue);
  background-color: var(--bg-section);
}

.drop-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--SigaBlue-shadow-light);
}

.drop-zone-text {
  color: var(--text-muted);
  font-size: 0.95em;
}

.drop-zone-text strong {
  color: var(--SigaBlue);
}

.drop-zone input[type="file"] {
  display: none;
}

/* Drop zone secondaire (fichier original, optionnelle) */
.drop-zone-secondary {
  min-height: auto;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  border-width: 1px;
  border-style: dashed;
}

.drop-zone-secondary .drop-zone-text {
  font-size: 0.85em;
}

/* Message de transparence (vérif + ASiC-S) */
.transparency-notice {
  font-size: 0.85em;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--SigaBlue);
  background-color: var(--bg-section);
}

/* Sélecteur de fournisseur TSA */
.tsa-selector {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tsa-selector label {
  font-size: 0.9em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tsa-selector select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 0.9em;
  background-color: var(--color-white);
  color: var(--text-primary);
}

/* Fichier sélectionné */
.file-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-section);
  border-radius: 4px;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.file-info.visible {
  display: flex;
}

.file-info .file-name {
  flex: 1;
  font-weight: bold;
  color: var(--text-primary);
  word-break: break-all;
}

.file-info .file-size {
  color: var(--text-muted);
  font-size: 0.85em;
  white-space: nowrap;
}

.file-info .file-remove {
  cursor: pointer;
  color: var(--color-danger);
  font-weight: bold;
  padding: 0 0.25rem;
}

/* ===========================================
   BOUTONS
   =========================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
}

.btn-primary {
  background-color: var(--SigaBlue);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--SigaBlue-shadow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================================
   RÉSULTATS
   =========================================== */
.result-section {
  margin-top: 1.5rem;
  display: none;
}

.result-section.visible {
  display: block;
}

/* Badge statut — centré */
.result-status {
  display: block;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 1.25rem;
}

.result-status .status-icon {
  margin-right: 0.25rem;
}

.result-status-valid {
  background-color: var(--alert-success-bg);
  color: var(--alert-success-text);
  border: 1px solid var(--alert-success-border);
}

.result-status-invalid {
  background-color: var(--alert-danger-bg);
  color: var(--alert-danger-text);
  border: 1px solid var(--alert-danger-border);
}

/* Date/heure — info primordiale (teinte selon l'état global du verdict) */
.result-datetime {
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--alert-success-text);
  margin-bottom: 0.25rem;
}

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

.result-datetime-danger {
  color: var(--color-danger);
}

.result-provider {
  text-align: center;
  color: var(--SigaBlue);
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* Autorité reconnue par aucune liste faisant autorité (ni Trusted List UE, ni
   liste interne Sigalion) : nom en noir plutôt que bleu. La chaîne peut être
   valide (ligne Signature verte) ; le noir dit seulement « hors liste ».
   Depuis le 18/07/2026 ce noir ne dépend plus de tsa_providers.json : un QTSP
   qualifié par l'UE est en bleu même si notre table ignore son policy OID. */
.result-provider-unlisted {
  color: var(--text-primary);
}

/* Deux affirmations courtes et centrées sous le fournisseur : la qualification
   eIDAS, et ce que le document porte. Même gabarit, deux couleurs, parce que le
   vert de la page dit « validé » et n'appartient qu'aux contrôles. Le nombre
   d'horodatages n'est ni bon ni mauvais, c'est un fait sur le fichier : il
   prend le bleu Sigalion, qui informe sans valider. */
.result-eidas,
.result-note {
  text-align: center;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-eidas {
  color: var(--alert-success-text);
}

.result-note {
  color: var(--SigaBlue);
  /* Le badge eIDAS est suivi d'autres mentions du même groupe, cette note ferme
     l'en-tête du résultat : elle porte donc l'écart avec les contrôles, à la
     place du `1rem` que la mention de format tenait avant elle. */
  margin-bottom: 1rem;
}

.result-format {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 0.25rem;
}

.result-format-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8em;
  margin-bottom: 1rem;
}

/* Lignes de vérification (RFC 3161, Signature, ASiC-S, Empreinte) */
.result-checks {
  margin-bottom: 1.25rem;
}

.result-check {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9em;
}

.result-check-label {
  font-weight: 600;
  min-width: 5.5rem;
}

.result-check-icon {
  flex-shrink: 0;
}

.result-check-message {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.result-check-success .result-check-label,
.result-check-success .result-check-icon {
  color: var(--alert-success-text);
}

.result-check-danger .result-check-label,
.result-check-danger .result-check-icon {
  color: var(--alert-danger-text);
}

.result-check-warning .result-check-label,
.result-check-warning .result-check-icon {
  color: var(--alert-warning-text);
}

/* Information sans gravité : une révocation postérieure à l'horodatage n'a aucun
   effet rétroactif, elle ne doit donc ni alarmer ni se donner l'air d'un succès.
   Même choix que le Desktop, qui rend ce cas en gris. */
.result-check-muted .result-check-label,
.result-check-muted .result-check-icon {
  color: var(--text-secondary);
}

/* Groupes de résultats */
.result-group {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.result-group-title {
  font-weight: bold;
  color: var(--SigaBlue);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.result-group dl {
  margin: 0;
}

.result-group dt {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.5rem;
  font-size: 0.9em;
}

.result-group dt:first-child {
  margin-top: 0;
}

.result-group dd {
  color: var(--text-secondary);
  margin-left: 0;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.result-group dd.hash-value {
  font-family: monospace;
  font-size: 0.85em;
}

/* Section certificat — même structure, contenu plus petit */
.result-cert {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.result-cert dl {
  margin: 0;
}

.result-cert dt {
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-size: 0.85em;
}

.result-cert dt:first-child {
  margin-top: 0;
}

.result-cert dd {
  color: var(--text-secondary);
  margin-left: 0;
  margin-bottom: 0.15rem;
  word-break: break-all;
  font-size: 0.85em;
}

/* ===========================================
   MODALE AUTHENTIFICATION (horodatage eIDAS)
   =========================================== */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#auth-overlay.hidden {
  display: none !important;
}

#auth-panel {
  background: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#auth-panel .section-title {
  color: var(--SigaBlue);
  margin: 0 0 0.5rem;
  font-size: 1.1em;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.form-group input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 0.95em;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--SigaBlue);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* Fenêtre du qualifié : le chemin pour qui n'a pas encore de compte */
.auth-no-account {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.auth-no-account a {
  color: var(--SigaBlue);
  font-weight: 600;
  white-space: nowrap;
}

.btn-secondary {
  background-color: var(--bg-section);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media screen and (max-width: 768px) {
  .timestamp-panel {
    padding: 1.5rem;
  }

  .drop-zone {
    padding: 1.5rem;
    min-height: 120px;
  }
}

/* ===========================================
   BLOCS D'INFORMATION (sous l'outil)
   =========================================== */
.info-block {
  max-width: 800px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 2px solid var(--SigaGold);
  text-align: center;
}

.info-block-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.info-block-text h2 {
  color: var(--SigaBlue);
  margin: 1.25rem 0 0.5rem;
}

.info-block-text p {
  color: var(--text-secondary);
  margin: 0.4rem 0;
  text-align: left;
}

.info-block-text a {
  color: var(--SigaBlue);
}

.info-block-text code.fingerprint {
  font-family: monospace;
  font-size: 0.85em;
  word-break: break-all;
}

/* Adresses de service (page Développeurs) : un bloc par service */
.endpoint {
  text-align: left;
}

.endpoint h3 {
  color: var(--SigaBlue);
  margin: 1.25rem 0 0.25rem;
}

.endpoint-urls {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.endpoint-urls li {
  color: var(--text-secondary);
  margin: 0.3rem 0;
}

/* L'adresse passe à la ligne plutôt que de déborder sur mobile */
.endpoint-urls code {
  word-break: break-all;
}

/* Note de transparence détachée du bloc précédent */
.transparency-notice.is-spaced {
  margin-top: 1.5rem;
}
