/* ── Worldline design tokens ──────────────────────────────────────────── */
:root {
  --wl-mint:       #00b398;
  --wl-mint-dark:  #008570;
  --wl-mint-light: #e6f7f5;
  --wl-gray:       #6c757d;
  --wl-gray-dark:  #495057;
  --wl-gray-light: #f0f0f0;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f0f2f5;
  color: #1c1f26;
}

/* ── Primary button ───────────────────────────────────────────────────── */
.btn-primary       { background-color: var(--wl-mint-dark); border-color: var(--wl-mint-dark); }
.btn-primary:hover,
.btn-primary:focus { background-color: #006e5c; border-color: #006e5c; }

/* ── Nav pills ────────────────────────────────────────────────────────── */
.nav-pills .nav-link                    { color: #495057; font-weight: 500; }
.nav-pills .nav-link:hover:not(.active) { background-color: var(--wl-mint-light); color: var(--wl-mint-dark); }
.nav-pills .nav-link.active             { background-color: var(--wl-mint-dark); }

/* ── Entity toggle badges ─────────────────────────────────────────────── */
.entity-cb:checked + label {
  background-color: var(--wl-mint-light) !important;
  border-color:     var(--wl-mint) !important;
  color:            var(--wl-mint) !important;
}

/* ── Stepper container ────────────────────────────────────────────────── */
.step-panel       { border-left: 3px solid #dee2e6; margin-left: 15px; padding-left: 28px; padding-bottom: 8px; }
.step-panel.active{ border-left-color: var(--wl-mint); }
.step-panel.done  { border-left-color: var(--wl-mint); }

/* ── Step header row ──────────────────────────────────────────────────── */
.step-header { display: flex; align-items: center; gap: 12px; padding: 12px 0; }

/* ── Step number bubble ───────────────────────────────────────────────── */
.step-number {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem;
  border: 2px solid #dee2e6; color: #6c757d; background: #fff;
  flex-shrink: 0;
  /* Pull the bubble to sit on the left border line */
  position: relative; left: -44px; margin-right: -32px;
}
.step-panel.active .step-number { border-color: var(--wl-mint); color: var(--wl-mint); background: var(--wl-mint-light); }
.step-panel.done   .step-number { border-color: var(--wl-mint); color: #fff;           background: var(--wl-mint); }

/* ── Step title ───────────────────────────────────────────────────────── */
.step-title { font-weight: 600; font-size: .95rem; }

/* ── Step body (collapsible) ──────────────────────────────────────────── */
.step-body           { padding-bottom: 16px; }
.step-body.collapsed { display: none; }

/* ── Step summary (shown when step is done) ───────────────────────────── */
.step-summary       { font-size: .82rem; color: #6c757d; padding-bottom: 12px; }
.step-summary.d-none{ display: none; }

/* ── Section labels ───────────────────────────────────────────────────── */
.section-label {
  font-size: .7rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: #6c757d;
}

/* ── Focus rings ──────────────────────────────────────────────────────── */
textarea:focus,
select:focus,
input[type="file"]:focus {
  border-color: var(--wl-mint);
  box-shadow: 0 0 0 .25rem rgba(0, 179, 152, .2);
}

/* ── Range slider (GLiNER threshold) ──────────────────────────────────── */
.form-range::-webkit-slider-thumb { background: var(--wl-mint); }
.form-range::-moz-range-thumb     { background: var(--wl-mint); }
.form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 .25rem rgba(0, 179, 152, .25);
}
.form-range:focus::-moz-range-thumb {
  box-shadow: 0 0 0 .25rem rgba(0, 179, 152, .25);
}

/* ── Reversible warning banner ────────────────────────────────────────── */
#reversible-warning {
  background-color: #fff3cd;
  border-color: #ffc107;
}

/* ── Re-identify card accent ─────────────────────────────────────────── */
.reid-card-accent {
  border-top: 3px solid var(--wl-gray) !important;
}

/* ── Re-identify accordion chevron ──────────────────────────────────── */
.reid-chevron { transition: transform .25s ease; color: var(--wl-gray); font-size: 1.1rem; }
#reid-toggle[aria-expanded="true"] .reid-chevron { transform: rotate(180deg); }

/* ── De-identify loading status bar ─────────────────────────────────── */
#loading {
  background: var(--wl-mint-light);
  border-radius: .5rem;
  padding: .45rem .85rem;
}
#loading .spinner-border { color: var(--wl-mint); }
#loading-status           { color: var(--wl-mint); }
#loading-time             { font-size: .72rem; color: var(--wl-gray); }

/* ── Re-identify loading status bar ─────────────────────────────────── */
#reid-loading {
  background: var(--wl-gray-light);
  border-radius: .5rem;
  padding: .45rem .85rem;
}
#reid-loading .spinner-border { color: var(--wl-gray); }
#reid-loading-status           { color: var(--wl-gray-dark); }
#reid-loading-time             { font-size: .72rem; color: var(--wl-gray); }

/* ── File upload dropzone ─────────────────────────────────────────────── */
.dropzone {
  border-style: dashed !important;
  border-color: #ced4da;
  background: #fafbfc;
  cursor: pointer;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--wl-mint) !important;
  background-color: var(--wl-mint-light) !important;
}
.dropzone.dropzone-active {
  border-color: var(--wl-mint) !important;
  background-color: var(--wl-mint-light) !important;
  box-shadow: 0 0 0 .25rem rgba(0, 179, 152, .2);
}
/* The native file input is kept for accessibility/screen readers but
   visually minimal — the whole dropzone area is the real click target. */
#panel-file input[type="file"] {
  font-size: .8rem;
}

/* ── Character counter ────────────────────────────────────────────────── */
#text-char-counter.char-counter-warning {
  color: #dc3545 !important;
  font-weight: 600;
}

/* ── Entities All/None quick-select buttons ───────────────────────────── */
#btn-all.is-active,
#btn-none.is-active {
  background-color: var(--wl-mint) !important;
  border-color: var(--wl-mint) !important;
  color: #fff !important;
}

/* ── Privacy / trust banner ───────────────────────────────────────────── */
.privacy-banner {
  background: linear-gradient(135deg, #f0faf8 0%, var(--wl-mint-light) 100%);
  border-bottom: 1px solid #c8ece7;
  padding: .55rem 0;
}
.privacy-banner-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #00866e;
  background: rgba(255,255,255,.7);
  border: 1px solid #b2ddd8;
  border-radius: 2rem;
  padding: .3rem .75rem;
}
.privacy-badge i {
  font-size: .72rem;
  color: #00866e;
}

/* ── GLiNER entity categories ─────────────────────────────────────────── */
.entity-category {
  margin-bottom: .35rem;
}
.entity-category-header {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8d96a0;
  margin-bottom: .35rem;
  padding-left: .15rem;
}

/* ── Engine selection cards ───────────────────────────────────────────── */
.engine-card {
  display: block;
  border: 1.5px solid #dee2e6;
  border-radius: .5rem;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  margin: 0;
}
.engine-card:hover {
  border-color: var(--wl-mint);
  background-color: var(--wl-mint-light);
}
.engine-card:has(.engine-radio:checked) {
  border-color: var(--wl-mint);
  background-color: var(--wl-mint-light);
}
.engine-card.engine-card-disabled,
.mode-card.mode-card-disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
/* Visually hidden but keyboard-accessible */
.engine-radio {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}
.engine-card:has(.engine-radio:focus-visible) {
  outline: 2px solid var(--wl-mint-dark);
  outline-offset: 2px;
}

.engine-card-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,179,152,.15);
  color: var(--wl-mint);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Global focus-visible ring ───────────────────────────────────────── */
.nav-pills .nav-link:focus-visible,
.btn:focus-visible,
.form-check-input:focus-visible,
.form-select:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid var(--wl-mint-dark);
  outline-offset: 2px;
  box-shadow: none;
}

/* ── Step edit button ────────────────────────────────────────────────── */
.step-edit {
  font-size: .8rem; color: var(--wl-mint-dark); cursor: pointer; margin-left: 8px;
  background: none; border: none; padding: 0;
}
.step-edit:hover  { text-decoration: underline; }
.step-edit:focus-visible {
  outline: 2px solid var(--wl-mint-dark);
  outline-offset: 2px;
}

/* ── Advanced settings disclosure ────────────────────────────────────── */
.configuration-summary {
  background: var(--wl-mint-light);
  border: 1px solid #b2ddd8;
}
.configuration-summary i { color: var(--wl-mint-dark); font-size: 1.1rem; }
#configuration-summary-title { font-size: .9rem; }

#language:disabled {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

.advanced-toggle {
  cursor: pointer;
  user-select: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--wl-mint-dark);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem 0;
}
.advanced-toggle:hover { text-decoration: underline; }
.advanced-toggle .bi { transition: transform .2s ease; font-size: .7rem; }
details[open] > .advanced-toggle .bi { transform: rotate(90deg); }

/* ── Redaction mode cards ────────────────────────────────────────────── */
.mode-card {
  display: block;
  border: 1.5px solid #dee2e6;
  border-radius: .5rem;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  margin: 0;
}
.mode-card:hover {
  border-color: var(--wl-mint);
  background-color: var(--wl-mint-light);
}
.mode-card:has(.form-check-input:checked) {
  border-color: var(--wl-mint);
  background-color: var(--wl-mint-light);
}
.mode-card:has(.form-check-input:focus-visible) {
  outline: 2px solid var(--wl-mint-dark);
  outline-offset: 2px;
}
.mode-card .form-check-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

/* ── Reversible inline warning ───────────────────────────────────────── */
.reversible-inline-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: .5rem;
  padding: .6rem .85rem;
  font-size: .82rem;
  margin-top: .5rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

/* ── Post-processing completion checklist ────────────────────────────── */
.completion-checklist {
  background: var(--wl-mint-light);
  border: 1px solid #b2ddd8;
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.completion-checklist ol {
  margin: .35rem 0 0 0;
  padding-left: 1.25rem;
  font-size: .82rem;
  color: #1c1f26;
}
.completion-checklist ol li { margin-bottom: .2rem; }

/* ── Re-identify contextual link ─────────────────────────────────────── */
.reid-hint-link {
  font-size: .8rem;
  color: var(--wl-gray);
  margin-top: .75rem;
}
.reid-hint-link a {
  color: var(--wl-mint-dark);
  text-decoration: underline;
}
.reid-hint-link a:hover { color: #006e5c; }

/* ── Page-width constraint ───────────────────────────────────────────── */
.page-container { max-width: 920px; }

/* ── Rounded card shell ──────────────────────────────────────────────── */
.card-rounded { border-radius: 1rem; }

/* ── Shared textarea styles ──────────────────────────────────────────── */
.textarea-body   { resize: vertical; font-size: .94rem; line-height: 1.6; }
.textarea-output {
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
  font-size: .94rem;
  line-height: 1.6;
  background: #f8f9fa;
}

/* ── Entity toggle badge shape ───────────────────────────────────────── */
.entity-badge { font-size: .78rem; border-radius: 2rem; }

/* ── Custom entity tag pill ──────────────────────────────────────────── */
.custom-entity-tag {
  background: var(--wl-mint-light);
  color: var(--wl-mint);
  border: 1px solid var(--wl-mint);
  font-size: .78rem;
  font-weight: 500;
}

/* ── Small accent badges (engine / mode cards) ───────────────────────── */
.badge-sm         { font-size: .65rem; font-weight: 600; }
.badge-mint       { background-color: var(--wl-mint-dark); }
.badge-purple     { background-color: #6610f2; }
.badge-mint-light { background-color: var(--wl-mint-light); color: var(--wl-mint-dark); }

/* ── Mode card leading icon ──────────────────────────────────────────── */
.mode-icon { font-size: 1.2rem; }

/* ── Design-token color utilities ────────────────────────────────────── */
.text-mint-dark { color: var(--wl-mint-dark); }
.text-wl-gray   { color: var(--wl-gray); }

/* ── Header / footer chrome ──────────────────────────────────────────── */
.app-header  { border-bottom: 3px solid var(--wl-mint); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.app-footer  { border-top: 1px solid #e9ecef; }
.footer-link { color: var(--wl-gray); font-size: .82rem; text-decoration: none; }
.footer-link:hover { color: var(--wl-mint-dark); text-decoration: underline; }
.logo-header { height: 36px; width: auto; }
.logo-footer { height: 22px; width: auto; opacity: 0.6; }

/* ── Input tab ARIA semantics ────────────────────────────────────────── */
[role="tablist"] .nav-link[aria-selected="true"] { font-weight: 600; }

