/* ============================================================
   THOR AUDIT AI — Premium Frontend CSS
   Design: Dark theme · Gold accents · Glassmorphism
   Inspired by: Stripe, Linear, Vercel, Segment
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --thor-gold:        #f59e0b;
  --thor-gold-light:  #fbbf24;
  --thor-gold-dim:    rgba(245, 158, 11, 0.12);
  --thor-gold-border: rgba(245, 158, 11, 0.35);

  /* Backgrounds */
  --thor-bg:          #07090f;
  --thor-surface:     #0d1117;
  --thor-card:        #111827;
  --thor-card-2:      #1a2235;
  --thor-glass:       rgba(17, 24, 39, 0.85);

  /* Borders */
  --thor-border:      rgba(255, 255, 255, 0.07);
  --thor-border-2:    rgba(255, 255, 255, 0.12);

  /* Text */
  --thor-text:        #f0f4f8;
  --thor-text-muted:  #8b9eb7;
  --thor-text-dim:    #4b5a6e;

  /* Risk levels */
  --thor-critico:     #ef4444;
  --thor-critico-bg:  rgba(239, 68, 68, 0.10);
  --thor-alto:        #f97316;
  --thor-alto-bg:     rgba(249, 115, 22, 0.10);
  --thor-medio:       #eab308;
  --thor-medio-bg:    rgba(234, 179, 8, 0.10);
  --thor-bajo:        #22c55e;
  --thor-bajo-bg:     rgba(34, 197, 94, 0.10);

  /* UI */
  --thor-radius:      12px;
  --thor-radius-lg:   18px;
  --thor-radius-xl:   24px;
  --thor-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --thor-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --thor-shadow:      0 4px 24px rgba(0, 0, 0, 0.4);
  --thor-shadow-gold: 0 0 30px rgba(245, 158, 11, 0.25);
}

/* ── RESET & BASE ───────────────────────────────────────────── */
.thor-wrap *, .thor-wrap *::before, .thor-wrap *::after {
  box-sizing: border-box;
}

.thor-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--thor-text);
  -webkit-font-smoothing: antialiased;
}

/* ── THEME OVERRIDE RESET (Bosa / Bootstrap compat) ─────────── */
/* These !important rules override Bootstrap/Bosa .entry-content
   selectors that have higher specificity than our class names   */
.thor-wrap ol,
.thor-wrap ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.thor-wrap h1,
.thor-wrap h2,
.thor-wrap h3,
.thor-wrap h4,
.thor-wrap h5,
.thor-wrap h6 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  font-weight: inherit;
  line-height: inherit;
}

.thor-wrap p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.thor-wrap a {
  text-decoration: none !important;
  color: inherit !important;
}

.thor-wrap input,
.thor-wrap select,
.thor-wrap textarea,
.thor-wrap button {
  font-family: inherit !important;
}

.thor-wrap label {
  margin-bottom: 0 !important;
  font-weight: inherit !important;
}

.thor-wrap table {
  width: 100%;
}

.thor-wrap img {
  max-width: 100%;
  height: auto;
}

/* ── MAIN CONTAINER ─────────────────────────────────────────── */
.thor-wrap .thor-container {
  background: var(--thor-surface) !important;
  border: 1px solid var(--thor-border) !important;
  border-radius: var(--thor-radius-xl);
  overflow: hidden;
  box-shadow: var(--thor-shadow);
}

/* ── HERO HEADER ────────────────────────────────────────────── */
.thor-wrap .thor-hero {
  background: linear-gradient(135deg, #0d1117 0%, #111827 50%, #0f1923 100%) !important;
  padding: 40px 40px 36px;
  border-bottom: 1px solid var(--thor-border);
  position: relative;
  overflow: hidden;
}

.thor-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.thor-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--thor-gold-border), transparent);
}

.thor-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--thor-gold-dim);
  border: 1px solid var(--thor-gold-border);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--thor-gold-light);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.thor-hero__badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thor-gold);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.thor-hero__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--thor-text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.thor-hero__title span { color: var(--thor-gold); }

.thor-hero__subtitle {
  font-size: 15px;
  color: var(--thor-text-muted);
  margin: 0 0 24px;
  max-width: 540px;
}

.thor-trust-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.thor-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--thor-text-muted);
}

.thor-trust-item svg,
.thor-trust-item .icon {
  color: var(--thor-gold);
  font-size: 14px;
}

/* ── STEP WIZARD INDICATOR ──────────────────────────────────── */
.thor-wrap .thor-steps-wrap {
  padding: 28px 40px 0;
  background: var(--thor-surface) !important;
}

.thor-steps {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.thor-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
  cursor: pointer;
}

/* Connector line */
.thor-step + .thor-step::before {
  content: '';
  position: absolute;
  top: 17px;
  right: calc(50% + 22px);
  left: calc(-50% + 22px);
  height: 2px;
  background: var(--thor-border-2);
  transition: background 0.4s var(--thor-ease);
}

.thor-step.done + .thor-step::before {
  background: var(--thor-gold);
}

.thor-step__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--thor-border-2);
  background: var(--thor-card);
  color: var(--thor-text-dim);
  transition: all 0.35s var(--thor-ease-bounce);
  position: relative;
  z-index: 1;
}

.thor-step.active .thor-step__circle {
  border-color: var(--thor-gold);
  background: var(--thor-gold);
  color: #000;
  box-shadow: 0 0 0 5px rgba(245,158,11,0.18), var(--thor-shadow-gold);
  transform: scale(1.08);
}

.thor-step.done .thor-step__circle {
  border-color: var(--thor-gold);
  background: var(--thor-gold-dim);
  color: var(--thor-gold);
}

.thor-step.done .thor-step__circle::after {
  content: '✓';
  font-size: 14px;
  font-weight: 800;
}

.thor-step.done .thor-step__circle > span { display: none; }

.thor-step__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--thor-text-dim);
  text-align: center;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.thor-step.active .thor-step__label { color: var(--thor-gold-light); font-weight: 600; }
.thor-step.done .thor-step__label  { color: var(--thor-text-muted); }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.thor-progress-strip {
  height: 2px;
  background: var(--thor-border);
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.thor-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--thor-gold), var(--thor-gold-light));
  border-radius: 99px;
  transition: width 0.5s var(--thor-ease);
  position: relative;
}

.thor-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── FORM BODY ──────────────────────────────────────────────── */
.thor-wrap .thor-form-body {
  padding: 36px 40px;
  background: var(--thor-surface) !important;
}

/* ── STEP SECTIONS ──────────────────────────────────────────── */
.thor-step-section {
  display: none;
  animation: step-in 0.35s var(--thor-ease) forwards;
}

.thor-step-section.active { display: block; }
.thor-step-section.exit   { animation: step-out 0.25s var(--thor-ease) forwards; }

@keyframes step-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes step-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}

.thor-step-header {
  margin-bottom: 28px;
}

.thor-step-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--thor-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.thor-step-header p {
  font-size: 13px;
  color: var(--thor-text-muted);
  margin: 0;
}

/* ── FIELD GROUPS ───────────────────────────────────────────── */
.thor-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.thor-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.thor-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thor-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--thor-text-muted);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.thor-label .req {
  color: var(--thor-critico);
  font-size: 15px;
  line-height: 1;
}

.thor-label .thor-tip {
  cursor: help;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--thor-border-2);
  color: var(--thor-text-muted);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.thor-label .thor-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--thor-card-2);
  border: 1px solid var(--thor-border-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--thor-text);
  width: 220px;
  z-index: 100;
  box-shadow: var(--thor-shadow);
  white-space: normal;
  text-align: left;
  pointer-events: none;
}

/* ── INPUTS ─────────────────────────────────────────────────── */
.thor-wrap .thor-input,
.thor-wrap .thor-select,
.thor-wrap .thor-textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--thor-card) !important;
  border: 1.5px solid var(--thor-border-2) !important;
  border-radius: 10px;
  color: var(--thor-text) !important;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
}

.thor-input::placeholder,
.thor-textarea::placeholder {
  color: var(--thor-text-dim);
}

.thor-input:focus,
.thor-select:focus,
.thor-textarea:focus {
  border-color: var(--thor-gold-border);
  background: var(--thor-card-2);
  box-shadow: 0 0 0 4px rgba(245,158,11,0.10);
}

.thor-input.error,
.thor-select.error {
  border-color: var(--thor-critico);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.10);
}

.thor-input.valid {
  border-color: var(--thor-bajo);
}

.thor-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9eb7' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 44px;
  cursor: pointer;
}

.thor-select option {
  background: var(--thor-card);
  color: var(--thor-text);
}

.thor-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── RADIO / CHECKBOX PILLS ─────────────────────────────────── */
.thor-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thor-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--thor-card);
  border: 1.5px solid var(--thor-border-2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--thor-text-muted);
  transition: all 0.2s var(--thor-ease);
  user-select: none;
  position: relative;
}

.thor-pill input[type="radio"],
.thor-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.thor-pill__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--thor-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--thor-ease);
  flex-shrink: 0;
}

.thor-pill:hover {
  border-color: var(--thor-gold-border);
  background: var(--thor-card-2);
  color: var(--thor-text);
}

.thor-pill.selected {
  border-color: var(--thor-gold);
  background: var(--thor-gold-dim);
  color: var(--thor-gold-light);
}

.thor-pill.selected .thor-pill__dot {
  border-color: var(--thor-gold);
  background: var(--thor-gold);
}

.thor-pill.selected .thor-pill__dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thor-bg);
}

/* Checkbox variant */
.thor-pill.checkbox.selected .thor-pill__dot {
  border-radius: 4px;
}

.thor-pill.checkbox.selected .thor-pill__dot::after {
  content: '✓';
  font-size: 10px;
  font-weight: 900;
  color: var(--thor-bg);
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}

/* Pill grid for many options */
.thor-pills--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ── NUMBER INPUT WITH ICON ──────────────────────────────────── */
.thor-input-wrap {
  position: relative;
}

.thor-input-wrap .thor-input {
  padding-left: 42px;
}

.thor-input-wrap .thor-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--thor-text-dim);
  font-size: 14px;
  pointer-events: none;
}

/* ── STEP NAVIGATION ────────────────────────────────────────── */
.thor-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--thor-border);
}

.thor-step-nav .thor-step-counter {
  font-size: 12px;
  color: var(--thor-text-dim);
  font-weight: 500;
}

.thor-step-nav-actions {
  display: flex;
  gap: 10px;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.thor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s var(--thor-ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.thor-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s ease;
}

.thor-btn:hover::after { background: rgba(255,255,255,0.07); }

/* Primary — gold */
.thor-btn--primary {
  background: linear-gradient(135deg, var(--thor-gold) 0%, #d97706 100%);
  color: #000;
  box-shadow: 0 2px 12px rgba(245,158,11,0.35);
}

.thor-btn--primary:hover {
  box-shadow: 0 4px 20px rgba(245,158,11,0.5);
  transform: translateY(-1px);
}

.thor-btn--primary:active { transform: translateY(0); }

.thor-btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary — ghost dark */
.thor-btn--secondary {
  background: var(--thor-card);
  border: 1.5px solid var(--thor-border-2);
  color: var(--thor-text-muted);
}

.thor-btn--secondary:hover {
  border-color: var(--thor-gold-border);
  color: var(--thor-text);
}

/* Submit — large gold */
.thor-btn--submit {
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--thor-gold-light) 0%, var(--thor-gold) 50%, #d97706 100%);
  background-size: 200% auto;
  color: #000;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(245,158,11,0.4);
  transition: background-position 0.4s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.thor-btn--submit:hover {
  background-position: right center;
  box-shadow: 0 6px 32px rgba(245,158,11,0.55);
  transform: translateY(-2px);
}

.thor-btn--submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.thor-btn--sm { padding: 8px 16px; font-size: 12px; border-radius: 8px; }
.thor-btn--lg { padding: 15px 32px; font-size: 15px; }

.thor-btn--ghost {
  background: transparent;
  border: 1.5px solid var(--thor-border-2);
  color: var(--thor-text-muted);
}
.thor-btn--ghost:hover {
  border-color: var(--thor-gold-border);
  color: var(--thor-gold-light);
}

/* Loading spinner inside button */
.thor-btn .btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: rgba(0,0,0,0.9);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── HABEAS DATA ─────────────────────────────────────────────── */
.thor-habeas {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: rgba(245,158,11,0.05);
  border: 1.5px solid var(--thor-gold-border);
  border-radius: var(--thor-radius);
  margin-top: 28px;
}

.thor-habeas__checkbox {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.thor-habeas__checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.thor-habeas__check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--thor-gold-border);
  border-radius: 6px;
  background: var(--thor-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--thor-ease);
}

.thor-habeas__checkbox input:checked + .thor-habeas__check {
  background: var(--thor-gold);
  border-color: var(--thor-gold);
}

.thor-habeas__checkbox input:checked + .thor-habeas__check::after {
  content: '✓';
  font-size: 13px;
  font-weight: 900;
  color: #000;
}

.thor-habeas__text {
  font-size: 13px;
  color: var(--thor-text-muted);
  line-height: 1.6;
}

.thor-habeas__text a {
  color: var(--thor-gold);
  text-decoration: none;
  border-bottom: 1px solid var(--thor-gold-border);
}

.thor-habeas__text a:hover { color: var(--thor-gold-light); }

.thor-habeas__text strong { color: var(--thor-text); }

/* ── FORM FOOTER NOTES ──────────────────────────────────────── */
.thor-form-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.thor-form-note span {
  font-size: 12px;
  color: var(--thor-text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.thor-form-note .ok { color: var(--thor-bajo); }

/* ── DRAFT BANNER ───────────────────────────────────────────── */
.thor-draft-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(59,130,246,0.08);
  border-bottom: 1px solid rgba(59,130,246,0.2);
  font-size: 13px;
  color: #93c5fd;
}

.thor-draft-banner.visible { display: flex; }

/* ── PROCESSING SCREEN ──────────────────────────────────────── */
.thor-wrap #thor-processing {
  display: none;
  padding: 64px 40px;
  text-align: center;
  background: var(--thor-surface) !important;
}

/* Radar animation */
.thor-radar {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  position: relative;
}

.thor-radar__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--thor-gold-dim);
  border: 2px solid var(--thor-gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.thor-radar__ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--thor-gold);
  opacity: 0;
  animation: radar-ring 2.4s ease-out infinite;
}

.thor-radar__ring:nth-child(1) { inset: -12px; animation-delay: 0s; }
.thor-radar__ring:nth-child(2) { inset: -28px; animation-delay: 0.6s; }
.thor-radar__ring:nth-child(3) { inset: -44px; animation-delay: 1.2s; }

@keyframes radar-ring {
  0%   { opacity: 0.8; transform: scale(0.6); }
  100% { opacity: 0;   transform: scale(1);   }
}

.thor-processing__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--thor-text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.thor-processing__msg {
  font-size: 14px;
  color: var(--thor-text-muted);
  margin: 0 0 36px;
  min-height: 20px;
}

/* Animated steps list during processing */
.thor-processing-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}

.thor-proc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--thor-text-dim);
  transition: all 0.4s var(--thor-ease);
}

.thor-proc-step.active {
  border-color: var(--thor-gold-border);
  color: var(--thor-text-muted);
  background: var(--thor-gold-dim);
}

.thor-proc-step.done {
  border-color: rgba(34,197,94,0.3);
  color: var(--thor-text);
  background: rgba(34,197,94,0.06);
}

.thor-proc-step__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--thor-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.thor-proc-step.active .thor-proc-step__icon {
  background: var(--thor-gold-dim);
  border: 1px solid var(--thor-gold-border);
  animation: spin 1s linear infinite;
}

.thor-proc-step.done .thor-proc-step__icon {
  background: rgba(34,197,94,0.15);
  color: var(--thor-bajo);
}

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

/* ── RESULTS DASHBOARD ──────────────────────────────────────── */
.thor-wrap #thor-results {
  display: none;
  background: var(--thor-surface) !important;
}

.thor-results-header {
  padding: 32px 40px 0;
  border-bottom: 1px solid var(--thor-border);
}

.thor-results-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.thor-results-title h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--thor-text);
  margin: 0;
}

.thor-results-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--thor-bajo);
}

/* Tabs */
.thor-tabs {
  display: flex;
  gap: 0;
  position: relative;
}

.thor-tab {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--thor-text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.thor-tab:hover { color: var(--thor-text-muted); }

.thor-tab.active {
  color: var(--thor-gold-light);
  border-bottom-color: var(--thor-gold);
}

/* ── TAB PANELS ─────────────────────────────────────────────── */
.thor-tab-panels {
  padding: 32px 40px;
}

.thor-tab-panel { display: none; }
.thor-tab-panel.active {
  display: block;
  animation: panel-in 0.3s var(--thor-ease) forwards;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCORE PANEL ────────────────────────────────────────────── */
.thor-score-panel {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.thor-score-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.thor-gauge {
  position: relative;
  width: 180px;
  height: 180px;
}

.thor-gauge svg { transform: rotate(-90deg); }

.thor-gauge__track {
  fill: none;
  stroke: var(--thor-border-2);
  stroke-width: 10;
}

.thor-gauge__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.thor-gauge__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.thor-gauge__num {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.thor-gauge__unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--thor-text-muted);
}

.thor-gauge__label {
  font-size: 12px;
  color: var(--thor-text-dim);
  font-weight: 500;
}

/* Risk summary chips */
.thor-risk-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.thor-risk-summary h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--thor-text-muted);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.thor-risk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.thor-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid;
}

.thor-chip--critico { background: var(--thor-critico-bg); border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.thor-chip--alto    { background: var(--thor-alto-bg);    border-color: rgba(249,115,22,0.3); color: #fdba74; }
.thor-chip--medio   { background: var(--thor-medio-bg);   border-color: rgba(234,179,8,0.3);  color: #fde047; }
.thor-chip--bajo    { background: var(--thor-bajo-bg);    border-color: rgba(34,197,94,0.3);  color: #86efac; }

.thor-chip__count {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

/* Top urgent risks */
.thor-urgent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thor-urgent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-left: 3px solid var(--thor-critico);
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--thor-text);
}

.thor-urgent-item.alto   { border-left-color: var(--thor-alto); }
.thor-urgent-item.medio  { border-left-color: var(--thor-medio); }

.thor-urgent-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Chart placeholder */
.thor-donut-wrap {
  min-height: 200px;
  margin: 20px 0;
}

/* ── RISK CARDS ─────────────────────────────────────────────── */
.thor-risk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thor-risk-card {
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-radius: var(--thor-radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thor-risk-card:hover {
  border-color: var(--thor-border-2);
}

.thor-risk-card--critico { border-left: 3px solid var(--thor-critico); }
.thor-risk-card--alto    { border-left: 3px solid var(--thor-alto); }
.thor-risk-card--medio   { border-left: 3px solid var(--thor-medio); }
.thor-risk-card--bajo    { border-left: 3px solid var(--thor-bajo); }

.thor-risk-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}

.thor-risk-card__badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--critico { background: var(--thor-critico-bg); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.badge--alto    { background: var(--thor-alto-bg);    color: #fdba74; border: 1px solid rgba(249,115,22,0.25); }
.badge--medio   { background: var(--thor-medio-bg);   color: #fde047; border: 1px solid rgba(234,179,8,0.25); }
.badge--bajo    { background: var(--thor-bajo-bg);    color: #86efac; border: 1px solid rgba(34,197,94,0.25); }

.thor-risk-card__name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--thor-text);
  line-height: 1.4;
}

.thor-risk-card__cat {
  font-size: 11px;
  color: var(--thor-text-dim);
  flex-shrink: 0;
}

.thor-risk-card__toggle {
  color: var(--thor-text-dim);
  font-size: 11px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.thor-risk-card.open .thor-risk-card__toggle {
  transform: rotate(180deg);
}

.thor-risk-card__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--thor-ease);
}

.thor-risk-card.open .thor-risk-card__body {
  grid-template-rows: 1fr;
}

.thor-risk-card__inner {
  overflow: hidden;
}

.thor-risk-card__content {
  padding: 0 18px 18px;
  border-top: 1px solid var(--thor-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  padding-top: 16px;
}

.thor-risk-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thor-risk-row--full { grid-column: 1 / -1; }

.thor-risk-row__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--thor-text-dim);
}

.thor-risk-row__val {
  font-size: 13px;
  color: var(--thor-text-muted);
  line-height: 1.5;
}

.thor-risk-row__val strong {
  color: var(--thor-text);
  font-weight: 600;
}

/* Probability bar */
.thor-prob-bar {
  height: 4px;
  background: var(--thor-border-2);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}

.thor-prob-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--thor-gold), var(--thor-critico));
  transition: width 0.8s var(--thor-ease);
}

/* ── MATRIX ─────────────────────────────────────────────────── */
.thor-matrix-section {
  overflow-x: auto;
  padding-bottom: 8px;
}

.thor-matrix-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--thor-text-muted);
  margin: 0 0 16px;
}

.thor-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  min-width: 480px;
}

.thor-matrix th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--thor-text-dim);
  background: var(--thor-card);
  border-radius: 8px;
  text-align: center;
}

.thor-matrix td {
  padding: 14px;
  text-align: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease;
  cursor: default;
  min-width: 80px;
}

.thor-matrix td:hover { transform: scale(1.04); }

.thor-matrix td.empty { background: var(--thor-card); opacity: 0.3; }
.thor-matrix td.cell-critico { background: rgba(239,68,68,0.18);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.thor-matrix td.cell-alto    { background: rgba(249,115,22,0.18); color: #fdba74; border: 1px solid rgba(249,115,22,0.25); }
.thor-matrix td.cell-medio   { background: rgba(234,179,8,0.18);  color: #fde047; border: 1px solid rgba(234,179,8,0.25); }
.thor-matrix td.cell-bajo    { background: rgba(34,197,94,0.18);  color: #86efac; border: 1px solid rgba(34,197,94,0.25); }

/* ── RECOMMENDATIONS ─────────────────────────────────────────── */
.thor-recos {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.thor-reco-group h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.thor-reco-group h4::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--thor-border);
}

.thor-reco-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thor-reco-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-radius: var(--thor-radius);
  font-size: 13px;
}

.thor-reco-card__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--thor-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--thor-text-muted);
  flex-shrink: 0;
}

.thor-reco-card__body { flex: 1; }

.thor-reco-card__name {
  font-weight: 600;
  color: var(--thor-text);
  margin-bottom: 4px;
}

.thor-reco-card__text {
  color: var(--thor-text-muted);
  line-height: 1.5;
}

.thor-reco-card__meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.thor-meta-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--thor-text-dim);
  background: var(--thor-border);
  padding: 3px 10px;
  border-radius: 99px;
}

/* ── CTA CERTIFICATION ──────────────────────────────────────── */
.thor-cta {
  margin: 0 40px 40px;
  border-radius: var(--thor-radius-lg);
  background: linear-gradient(135deg, #111827 0%, #1a2235 60%, #0f1923 100%);
  border: 1px solid var(--thor-gold-border);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
}

.thor-cta::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.thor-cta__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.thor-cta h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--thor-gold-light);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.thor-cta p {
  font-size: 14px;
  color: var(--thor-text-muted);
  margin: 0;
  max-width: 420px;
  line-height: 1.6;
}

.thor-cta__includes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}

.thor-cta__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--thor-text-muted);
}

.thor-cta__feature .ok { color: var(--thor-bajo); font-weight: 700; }

.thor-cta__bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.thor-cta__price {
  display: flex;
  flex-direction: column;
}

.thor-cta__price-val {
  font-size: 30px;
  font-weight: 900;
  color: var(--thor-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.thor-cta__price-note {
  font-size: 12px;
  color: var(--thor-text-dim);
  margin-top: 4px;
}

/* ── PDF DOWNLOAD ───────────────────────────────────────────── */
.thor-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  border-top: 1px solid var(--thor-border);
  gap: 12px;
  font-size: 13px;
  color: var(--thor-text-muted);
}

/* ── VERIFICATION PAGE ──────────────────────────────────────── */
.thor-verify-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px;
}

.thor-verify-card {
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-radius: var(--thor-radius-xl);
  overflow: hidden;
  box-shadow: var(--thor-shadow);
}

.thor-verify-header {
  padding: 32px;
  text-align: center;
  border-bottom: 1px solid var(--thor-border);
}

.thor-verify-status {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}

.thor-verify-status--valido   { filter: drop-shadow(0 0 20px rgba(34,197,94,0.5)); }
.thor-verify-status--revocado { filter: drop-shadow(0 0 20px rgba(239,68,68,0.5)); }

.thor-verify-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}

.thor-verify-title--valido   { color: var(--thor-bajo); }
.thor-verify-title--revocado { color: var(--thor-critico); }

.thor-verify-subtitle {
  font-size: 14px;
  color: var(--thor-text-muted);
  margin: 0;
}

.thor-verify-body {
  padding: 28px 32px;
}

.thor-verify-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--thor-border);
  gap: 16px;
}

.thor-verify-row:last-child { border-bottom: none; }

.thor-verify-key {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--thor-text-dim);
  flex-shrink: 0;
}

.thor-verify-val {
  font-size: 14px;
  color: var(--thor-text);
  font-weight: 500;
  text-align: right;
}

.thor-verify-hash {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--thor-gold);
  word-break: break-all;
  text-align: right;
}

/* ── HISTORIAL ──────────────────────────────────────────────── */
.thor-historial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.thor-audit-card {
  background: var(--thor-card);
  border: 1px solid var(--thor-border);
  border-radius: var(--thor-radius);
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.thor-audit-card:hover {
  border-color: var(--thor-gold-border);
  transform: translateY(-2px);
}

.thor-audit-card__tipo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--thor-gold);
  margin-bottom: 8px;
}

.thor-audit-card__nombre {
  font-size: 16px;
  font-weight: 700;
  color: var(--thor-text);
  margin-bottom: 4px;
}

.thor-audit-card__fecha {
  font-size: 12px;
  color: var(--thor-text-dim);
  margin-bottom: 16px;
}

.thor-score-bar {
  background: var(--thor-border-2);
  border-radius: 99px;
  height: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.thor-score-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--thor-gold), var(--thor-gold-light));
}

.thor-score-pct {
  font-size: 11px;
  color: var(--thor-text-muted);
  text-align: right;
  margin-bottom: 14px;
}

.thor-audit-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thor-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.thor-badge--green { background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.25); }
.thor-badge--gold  { background: var(--thor-gold-dim);  color: var(--thor-gold-light); border: 1px solid var(--thor-gold-border); }

.thor-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--thor-text-dim);
}

.thor-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .thor-hero,
  .thor-form-body,
  .thor-tab-panels,
  .thor-cta { padding: 24px 20px; }

  .thor-steps-wrap { padding: 20px 20px 0; }
  .thor-step__label { display: none; }
  .thor-step__circle { width: 30px; height: 30px; font-size: 12px; }

  .thor-field-row { grid-template-columns: 1fr; }
  .thor-hero__title { font-size: 22px; }
  .thor-score-panel { grid-template-columns: 1fr; }
  .thor-risk-card__content { grid-template-columns: 1fr; }
  .thor-cta__top { flex-direction: column; }
  .thor-cta__includes { grid-template-columns: 1fr; }
  .thor-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .thor-cta { margin: 0 20px 24px; }
  .thor-pdf-bar { padding: 16px 20px; flex-direction: column; }

  .thor-gauge { width: 140px; height: 140px; }
  .thor-gauge__num { font-size: 32px; }
}

@media (max-width: 480px) {
  .thor-trust-bar { gap: 10px; }
  .thor-trust-item { font-size: 11px; }
  .thor-pills--grid { grid-template-columns: 1fr; }
  .thor-step-nav { flex-direction: column; gap: 12px; align-items: stretch; }
  .thor-step-nav-actions { justify-content: flex-end; }
}
