/* ============================================================
   Chat2Evidence — Reusable UI Components
   ============================================================ */

/* ── HEADER ── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.logo {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.02em;
  text-decoration: none;
}
.logo span { color: var(--teal); }
.logo:hover { text-decoration: none; }

.badge-private {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  padding: 5px 13px;
  border-radius: var(--r-full);
}
.badge-private svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  border-radius: var(--r-md);
  padding: 13px 26px;
  transition: all var(--t-fast);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn svg { flex-shrink: 0; }

.btn--primary {
  background: var(--orange);
  color: var(--white);
}
.btn--primary:hover:not(:disabled) {
  background: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--orange-glow);
}

.btn--teal {
  background: var(--teal);
  color: var(--white);
}
.btn--teal:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn--outline:hover:not(:disabled) {
  background: var(--teal-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn--full { width: 100%; }
.btn--lg   { padding: 15px 32px; font-size: 1.05rem; }
.btn--sm   { padding: 8px 16px;  font-size: .82rem; }

/* Pulsing download button */
.btn--download-ready {
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 6px 20px var(--orange-glow); }
  50%       { box-shadow: 0 6px 32px rgba(232,77,28,.45); }
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.card__body   { padding: var(--space-8); }
.card__header {
  padding: var(--space-5) var(--space-8);
  border-bottom: 1px solid var(--gray-100);
}
.card__footer {
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ── FORM FIELDS ── */
.field-group { margin-bottom: var(--space-5); }
.field-group label {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
  color: var(--navy);
}
.field-hint {
  font-size: .78rem;
  color: var(--gray-400);
  margin-bottom: 7px;
  display: block;
}

.field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md);
  padding: 0 14px;
  background: var(--white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.field-wrap.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.field-wrap svg {
  width: 18px; height: 18px;
  color: var(--teal);
  flex-shrink: 0;
}
.field-wrap input,
.field-wrap textarea {
  width: 100%;
  padding: 13px 0;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--navy);
  background: transparent;
}
.field-wrap input::placeholder,
.field-wrap textarea::placeholder { color: var(--gray-400); }

/* ── TOGGLE SWITCH ── */
.toggle-switch { position: relative; width: 52px; height: 28px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  border-radius: 28px;
  background: var(--gray-300);
  cursor: pointer;
  transition: background var(--t-fast);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--teal); }
.toggle-thumb {
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--t-fast);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked ~ .toggle-track ~ .toggle-thumb,
.toggle-switch input:checked + .toggle-track + .toggle-thumb { transform: translateX(24px); }

/* ── TRUST BADGES ── */
.trust-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.trust-badge svg { width: 17px; height: 17px; flex-shrink: 0; }
.trust-badge--row {
  flex-direction: row;
  width: 100%;
}

.trust-row-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.trust-item-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-600);
}
.trust-check {
  width: 22px; height: 22px;
  background: var(--teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.trust-check svg { width: 12px; height: 12px; color: var(--white); }

/* ── STAT CHIPS ── */
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-5);
}
.stat-chip {
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  color: var(--teal-dark);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--r-full);
}

/* ── PROGRESS OVERLAY ── */
.progress-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(12,31,63,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.progress-overlay.show { display: flex; }
.progress-box {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 44px 52px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: popIn .25s ease;
}
@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.spinner {
  width: 54px; height: 54px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto var(--space-5);
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-box h3  { font-size: 1.1rem; color: var(--navy); margin-bottom: 7px; }
.progress-box p   { font-size: .88rem; color: var(--gray-500); }

/* ── ERROR MESSAGE ── */
.error-msg {
  display: none;
  align-items: flex-start;
  gap: 9px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: .88rem;
  margin-top: var(--space-4);
  line-height: 1.5;
}
.error-msg.show { display: flex; }
.error-msg svg  { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ── SUCCESS BANNER ── */
.success-banner {
  display: none;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--teal-bg), var(--white));
  border: 1px solid var(--teal-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: var(--space-5);
  animation: fadeInUp .3s ease;
}
.success-banner.show { display: flex; }
.success-banner svg  { width: 28px; height: 28px; color: var(--teal); flex-shrink: 0; }
.success-banner strong { display: block; font-size: .95rem; color: var(--navy); }
.success-banner span   { font-size: .82rem; color: var(--gray-600); }

/* ── SECTION HEADINGS ── */
.section-title {
  text-align: center;
  margin-bottom: var(--space-2);
}
.section-sub {
  text-align: center;
  color: var(--gray-500);
  font-size: .95rem;
  margin-bottom: var(--space-8);
}

/* ── STAT ROW (preview panel) ── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .85rem;
}
.stat-row:last-of-type { border-bottom: none; }
.stat-label { color: var(--gray-500); }
.stat-val   { font-weight: 700; color: var(--navy); text-align: right; max-width: 60%; }

/* ── HASH BOX ── */
.hash-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--gray-600);
  word-break: break-all;
  line-height: 1.7;
  margin-top: var(--space-3);
}

/* ── TAG ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-full);
}
.tag--mandatory {
  background: var(--teal-bg);
  color: var(--teal-dark);
  border: 1px solid var(--teal-border);
}

/* ── FILE CHOSEN INDICATOR ── */
.file-chosen {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  margin: 14px auto 0;
  font-size: .88rem;
  font-weight: 600;
  color: var(--teal-dark);
  max-width: 640px;
}
.file-chosen.show { display: flex; }
.file-chosen svg  { width: 18px; height: 18px; flex-shrink: 0; }
.file-chosen .file-size {
  margin-left: auto;
  font-weight: 400;
  color: var(--gray-500);
  font-size: .8rem;
}

/* ── DIVIDER ── */
.divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--gray-400); font-size: .82rem; margin: var(--space-4) 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

/* ── MORE INDICATOR ── */
.more-indicator {
  color: var(--gray-400) !important;
  font-style: italic;
  background: var(--gray-100) !important;
  border-radius: var(--r-full);
  padding: 4px 14px !important;
  font-size: .75rem !important;
  text-align: center;
}

/* ── MOBILE FIRST ── */
@media (max-width: 640px) {
  .site-header { padding: 12px var(--space-4); }
  .card__body  { padding: var(--space-5); }
}
