/* ═══════════════════════════════════════════
   RADIOLOGY ROADMAP — assistant.css
   De-Identified Radiology Language Assistant
═══════════════════════════════════════════ */

/* ── Email gate overlay ─────────────────── */
.email-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 25, 41, 0.97);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.4s ease;
}

.email-gate.gate-success {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  background: var(--navy-card);
  border: 1px solid var(--border-blue);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.15);
}

.gate-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid var(--border-blue);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.gate-title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
}

.gate-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

.gate-form { width: 100%; }

.gate-input-wrap {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-blue);
  border-radius: 10px;
  overflow: hidden;
  background: var(--navy-mid);
  margin-bottom: 10px;
}

.gate-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
}

.gate-input::placeholder { color: var(--text-dim); }

.gate-btn {
  background: var(--blue-accent);
  color: #fff;
  border: none;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gate-btn:hover:not(:disabled) { background: #2563eb; }
.gate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gate-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.gate-error {
  font-size: 0.82rem;
  color: #f87171;
  margin-bottom: 8px;
  text-align: left;
}

.gate-fine {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 14px;
  line-height: 1.5;
}

@media (max-width: 500px) {
  .gate-card { padding: 32px 22px; }
  .gate-input-wrap { flex-direction: column; border-radius: 10px; }
  .gate-btn { border-radius: 0 0 8px 8px; justify-content: center; }
}

/* ── Page layout ─────────────────────────── */
.assistant-page {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 80px;
}

/* ── Legal banner ───────────────────────── */
.legal-banner {
  background: rgba(234, 179, 8, 0.12);
  border-bottom: 1px solid rgba(234, 179, 8, 0.35);
  padding: 10px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: #fbbf24;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.legal-banner strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Assistant hero ─────────────────────── */
.assistant-hero {
  padding: 56px 0 40px;
  text-align: center;
}

.assistant-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid var(--border-blue);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.assistant-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  flex-shrink: 0;
}

.assistant-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 14px;
}

.assistant-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Step flow ──────────────────────────── */
.assistant-flow {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Cards ──────────────────────────────── */
.a-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 20px;
}

.a-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.a-card-title .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.a-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

/* ── Disclaimer box ─────────────────────── */
.disclaimer-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.disclaimer-box p {
  font-size: 0.82rem;
  color: #fca5a5;
  line-height: 1.6;
  margin: 0 0 8px 0;
}

.disclaimer-box p:last-child { margin-bottom: 0; }

.disclaimer-box strong {
  color: #f87171;
  font-weight: 700;
}

/* ── Checkboxes ─────────────────────────── */
.ack-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ack-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.ack-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-blue);
  border-radius: 4px;
  background: var(--navy-mid);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--blue-accent);
}

.ack-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  user-select: none;
}

.ack-label strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Upload area ────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-blue);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(59, 130, 246, 0.03);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--blue-accent);
  background: rgba(59, 130, 246, 0.08);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.upload-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Preview panel ──────────────────────── */
.preview-panel {
  display: none;
  gap: 20px;
  margin-top: 20px;
}

.preview-panel.visible { display: flex; flex-wrap: wrap; }

.preview-img-wrap {
  flex: 0 0 auto;
  position: relative;
}

.preview-img-wrap img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.preview-meta {
  flex: 1;
  min-width: 180px;
}

.preview-meta-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.status-ok    { color: #4ade80; }
.status-warn  { color: #fbbf24; }
.status-error { color: #f87171; }

/* ── Quality badge ──────────────────────── */
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

.quality-badge.ok   { background: rgba(74, 222, 128, 0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.25); }
.quality-badge.warn { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.quality-badge.poor { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ── Buttons ────────────────────────────── */
.btn-analyze {
  width: 100%;
  padding: 16px;
  background: var(--blue-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.btn-analyze:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-analyze:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.btn-reset:hover {
  border-color: var(--blue-accent);
  color: var(--text);
}

/* ── Loading spinner ────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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

/* ── Results ────────────────────────────── */
#results-section { display: none; }
#results-section.visible { display: block; }

.result-must-review {
  background: rgba(234, 179, 8, 0.10);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: #fbbf24;
  line-height: 1.5;
}

.result-must-review .review-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.result-refused {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.30);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.refused-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refused-reason {
  font-size: 0.88rem;
  color: #fca5a5;
  line-height: 1.6;
}

.result-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.result-card-header {
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
}

.confidence-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.confidence-low    { background: rgba(239,68,68,0.15); color: #f87171; }
.confidence-medium { background: rgba(251,191,36,0.15); color: #fbbf24; }
.confidence-high   { background: rgba(74,222,128,0.15); color: #4ade80; }

.result-card-body {
  padding: 16px 20px;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 16px;
  position: relative;
}

.result-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.result-meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.result-meta-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.result-meta-pill strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Output disclaimer ──────────────────── */
.output-disclaimer {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.output-disclaimer strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Footer disclaimer ──────────────────── */
.assistant-footer-disclaimer {
  max-width: 700px;
  margin: 32px auto 0;
  padding: 0 20px;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.7;
  text-align: center;
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 600px) {
  .a-card { padding: 22px 18px; }
  .preview-img-wrap img { width: 120px; height: 120px; }
}
