/* ============================================
   MentorRS — Sistema visual
   Identidade: vinho/bordô + neutro editorial
   Tipografia: Fraunces (display serif) + Inter (sans)
   ============================================ */

:root {
  /* Vinho / bordô — cor primária */
  --forest-900: #10241f;
  --forest-800: #163329;
  --forest-700: #1c4034;
  --forest-600: #245046;
  --forest-500: #3a6d5a;
  --forest-400: #6fa68f;
  --forest-100: #c4e0d4;
  --forest-50:  #e8f2ec;

  /* Neutros quentes */
  --paper:    #f9f7f4;
  --surface:  #ffffff;
  --surface2: #f3f0eb;
  --border:   #e2ddd4;
  --border-strong: #c9c2b5;
  --ink:      #23201d;
  --sub:      #504a44;
  --muted:    #8a827a;
  --faint:    #b3aca2;

  /* Accent secundário — dourado envelhecido (usar com muita parcimônia) */
  --gold:     #9a7b3f;
  --gold-bg:  #f5efe2;

  /* Semânticas */
  --ok:       #3d6b4a;
  --ok-bg:    #e8f1ea;
  --ok-border:#a8c9b3;
  --warn:     #96692a;
  --warn-bg:  #f7eeda;
  --warn-border:#dcc088;
  --alert:    #9c3535;
  --alert-bg: #f7e6e6;
  --alert-border:#dca5a5;

  /* Tipografia */
  --serif: 'Fraunces', 'Georgia', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(16,36,31,0.06);
  --shadow: 0 2px 12px rgba(16,36,31,0.08);
  --shadow-lg: 0 8px 30px rgba(16,36,31,0.12);

  /* Aliases de compatibilidade (módulos legados) */
  --accent: var(--forest-600);
  --accent-bg: var(--forest-50);
  --accent-border: var(--forest-400);
  --green-bg: var(--ok-bg);
  --amber-bg: var(--warn-bg);
  --red-bg: var(--alert-bg);
  --green-border: var(--ok-border);
  --amber-border: var(--warn-border);
  --red-border: var(--alert-border);
  --danger: var(--alert);
  --green: var(--ok);
  --amber: var(--warn);
  --red: var(--alert);
  --faint: var(--faint);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ============ TOPBAR ============ */
.topbar {
  background: var(--forest-900);
  color: var(--forest-50);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--forest-600);
  gap: 1rem;
}
.topbar-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 11px;
}
.topbar-brand .mark { color: #fff; font-size: 1.25rem; }
.topbar-brand .divider-v {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.18);
  margin: 0 2px;
}
.topbar-brand .tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--forest-400);
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar-project {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
  white-space: nowrap;
}
.topbar-code {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  padding: 3px 9px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #fff;
}
.topbar-tier {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--forest-600);
  color: var(--forest-50);
}

/* ============ LAYOUT ============ */
.page { max-width: 880px; margin: 0 auto; padding: 2.2rem 1.5rem 5rem; }
.page-narrow { max-width: 680px; margin: 0 auto; padding: 2.2rem 1.5rem 5rem; }
.page-wide { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1.5rem 5rem; }


/* ============ MODULE HERO ============ */
.module-hero {
  background: linear-gradient(160deg, var(--forest-900) 0%, var(--forest-800) 55%, var(--forest-700) 100%);
  color: var(--forest-50);
  padding: 2.6rem 1.5rem 2.4rem;
  position: relative;
  overflow: hidden;
}
.module-hero::before {
  content: '';
  position: absolute;
  top: -45%;
  right: -8%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(111,166,143,0.18) 0%, transparent 68%);
  pointer-events: none;
}
.module-hero-inner { max-width: 880px; margin: 0 auto; position: relative; }
.module-hero .eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-400);
  margin-bottom: 0.7rem;
}
.module-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}
.module-hero h1 .accent { color: var(--forest-400); }
.module-hero p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(232,242,236,0.72);
  max-width: 60ch;
}
.module-hero .hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}
.module-hero .hero-chip {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--forest-50);
}
.module-hero .hero-chip.active {
  background: var(--forest-50);
  color: var(--forest-800);
  border-color: var(--forest-50);
}

/* ============ MODULE NAV (STEPPER) ============ */
.module-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 2rem;
  padding: 6px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.module-nav a {
  flex: 1;
  min-width: max-content;
  padding: 11px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: var(--sub);
  border-radius: 8px;
  transition: all .14s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.module-nav a .step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .14s;
}
.module-nav a.active {
  background: var(--forest-700);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.module-nav a.active .step-n {
  background: var(--forest-400);
  color: var(--forest-900);
}
.module-nav a:hover:not(.active) {
  background: var(--forest-50);
  color: var(--forest-700);
}
.module-nav a:hover:not(.active) .step-n {
  background: var(--forest-100);
  color: var(--forest-700);
}
.module-nav a.done:not(.active) { color: var(--ok); }
.module-nav a.done:not(.active) .step-n {
  background: var(--ok-bg);
  color: var(--ok);
}

/* ============ STEP HEADER ============ */
.step-header { margin-bottom: 1.6rem; }
.step-header .eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest-500);
  margin-bottom: 0.4rem;
}
.step-header h1, .step-header h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}
.step-header p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 60ch;
}

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.7rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* ============ SECTION LABEL ============ */
.section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--forest-500);
  margin: 1.8rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============ FORM ============ */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 0.35rem;
}
.field .hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-style: italic;
}
input[type=text], input[type=number], input[type=email],
input[type=password], select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--forest-500);
  box-shadow: 0 0 0 3px var(--forest-50);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }

/* ============ RADIO / CHECK ============ */
.radio-group, .check-group { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.radio-group label, .check-group label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all .12s;
}
.radio-group label:hover, .check-group label:hover {
  border-color: var(--forest-400);
  background: var(--forest-50);
}
.radio-group input, .check-group input {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--forest-600);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--sans);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .14s;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--forest-700); color: #fff; }
.btn-primary:hover { background: var(--forest-800); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border-strong); color: var(--sub); }
.btn-secondary:hover { background: var(--surface2); border-color: var(--forest-400); color: var(--forest-700); }
.btn-ghost { background: none; color: var(--forest-600); padding: 10px 12px; }
.btn-ghost:hover { background: var(--forest-50); }
.btn-row { display: flex; gap: 11px; margin-top: 1.5rem; flex-wrap: wrap; align-items: center; }

/* ============ ALERTS ============ */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 0.81rem;
  margin-bottom: 0.8rem;
  border-left: 4px solid;
  line-height: 1.55;
}
.alert strong { display: block; margin-bottom: 3px; font-size: 0.83rem; }
.alert-ok    { background: var(--ok-bg);    border-color: var(--ok);    color: #2c5238; }
.alert-warn  { background: var(--warn-bg);  border-color: var(--warn);  color: #6e4d1e; }
.alert-alert { background: var(--alert-bg); border-color: var(--alert); color: #742828; }
.alert-info  { background: var(--forest-50);  border-color: var(--forest-500); color: var(--forest-800); }

/* ============ SEMAPHORE ============ */
.semaphore { display: flex; flex-direction: column; gap: 8px; margin: 1rem 0; }
.sem-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.83rem;
}
.sem-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.sem-dot.green { background: var(--ok); }
.sem-dot.amber { background: #c99a35; }
.sem-dot.red   { background: var(--alert); }
.sem-dot.gray  { background: var(--faint); }
.sem-label { font-weight: 600; }
.sem-detail { color: var(--sub); margin-top: 2px; font-size: 0.79rem; }
.sem-tip {
  font-size: 0.76rem;
  color: var(--forest-700);
  margin-top: 5px;
  padding: 5px 9px;
  background: var(--forest-50);
  border-radius: 5px;
  border-left: 2px solid var(--forest-500);
}

/* ============ TOOLTIP ============ */
.tip-wrap { position: relative; display: inline-flex; align-items: center; }
.tip-icon {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-style: italic; font-family: var(--serif);
  cursor: help; color: var(--muted); margin-left: 6px; flex-shrink: 0;
}
.tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest-900);
  color: var(--forest-50);
  font-size: 0.73rem;
  line-height: 1.55;
  padding: 11px 14px;
  border-radius: var(--radius);
  width: 265px;
  z-index: 200;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  font-weight: 400;
}
.tooltip strong { color: #fff; }
.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--forest-900);
}
.tip-wrap:hover .tooltip { display: block; }

/* ============ PROGRESS ============ */
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 1.8rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest-600), var(--forest-400));
  border-radius: 3px;
  transition: width .35s ease;
}

/* ============ PILLS ============ */
.pill {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-alert { background: var(--alert-bg); color: var(--alert); }
.pill-pending { background: var(--surface2); color: var(--muted); }

/* ============ PROJECT CODE ============ */
.project-code-display {
  font-family: 'SF Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--forest-700);
  background: var(--forest-50);
  border: 1.5px dashed var(--forest-400);
  border-radius: var(--radius);
  padding: 14px 22px;
  text-align: center;
  margin: 1rem 0;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ============ LOCK / TIER ============ */
.locked { position: relative; opacity: 0.55; pointer-events: none; }
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .page, .page-narrow, .page-wide { padding: 1.2rem 1rem 4rem; }
  .module-nav { overflow-x: auto; }
  .module-nav a { font-size: 0.64rem; padding: 8px 6px; }
  .topbar-project { display: none; }
  .step-header h1, .step-header h2 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
