/* =================================================================
   C2 — Perfil Comportamental
   Design: verde escuro + branco, editorial, corporativo
   ================================================================= */

:root {
  --green-900: #062B21;
  --green-800: #0B3D2E;
  --green-700: #0E4B3A;
  --green-600: #13624B;
  --green-500: #1E7E60;
  --green-100: #E4F0EB;
  --green-50:  #F3F9F6;

  --ink:          #0A1A14;
  --ink-secondary: #3F5148;
  --ink-muted:    #7F8F87;

  --canvas:       #FFFFFF;
  --canvas-soft:  #F5F7F5;
  --surface:      #FFFFFF;

  --hairline:        #E4E9E6;
  --hairline-strong: #C9D3CC;

  --accent-gold: #C4A253;
  --danger:      #C0503A;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --sh-xs: 0 1px 2px rgba(11, 61, 46, 0.06);
  --sh-sm: 0 2px 8px rgba(11, 61, 46, 0.08);
  --sh-md: 0 6px 24px rgba(11, 61, 46, 0.10);
  --sh-lg: 0 12px 48px rgba(11, 61, 46, 0.14);
  --sh-focus: 0 0 0 3px rgba(30, 126, 96, 0.25);

  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Touch targets */
button, input, select, textarea, a.opt {
  min-height: 44px;
  touch-action: manipulation;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Typography */
h1 { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -1.2px; margin: 0; }
h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.6px; margin: 0; }
h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -0.3px; margin: 0; }
p  { margin: 0; }

.overline { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-700); }
.body-sm { font-size: 13px; color: var(--ink-secondary); }
.body-lg { font-size: 17px; line-height: 1.65; color: var(--ink-secondary); }

/* Loader */
.loading-screen { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.loader { width: 40px; height: 40px; border: 3px solid var(--green-100); border-top-color: var(--green-700); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ LAYOUT SHELL ============ */
.shell {
  display: flex; flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.topbar .brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.topbar .brand .brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(140deg, var(--green-700), var(--green-800));
  color: white;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  box-shadow: 0 2px 6px rgba(11, 61, 46, 0.25);
}
.topbar .brand strong { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.topbar .step-count { font-size: 12px; color: var(--ink-muted); font-weight: 600; letter-spacing: 0.04em; }

.progress-track { height: 3px; background: var(--hairline); position: sticky; top: 72px; z-index: 9; }
.progress-fill { height: 100%; background: var(--green-700); transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1); }

.main {
  flex: 1;
  padding: 40px 32px 56px;
  display: flex; align-items: flex-start; justify-content: center;
}
.container {
  width: 100%; max-width: 620px;
  padding: 0 8px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
  border: 1px solid transparent;
  transition: all 150ms ease;
  cursor: pointer;
}
.btn:focus-visible { outline: none; box-shadow: var(--sh-focus); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--green-700);
  color: white;
  box-shadow: var(--sh-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--green-800);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--green-700);
  border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--green-50); border-color: var(--green-700); }

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: none;
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); }

.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============ FIELDS ============ */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-secondary); margin-bottom: 6px; }
.field small { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

.input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  background: var(--canvas);
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus { outline: none; border-color: var(--green-700); box-shadow: var(--sh-focus); }
.input::placeholder { color: var(--ink-muted); }

/* ============ TOPBAR LOGO + BRAND TEXT ============ */
.topbar .brand-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(11, 61, 46, 0.15);
  flex-shrink: 0;
}
.topbar .brand { align-items: center; gap: 12px; }
.topbar .brand-text {
  display: flex; flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.topbar .brand-text strong {
  font-size: 15px; font-weight: 800; letter-spacing: -0.2px;
  color: var(--ink);
}
.topbar .brand-text .brand-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ WELCOME (branco + detalhes verdes) ============ */
.welcome {
  text-align: center;
  padding: 12px 0;
}

.welcome-badge-wrap {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.welcome-badge {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.welcome-free {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: fit-content;
  margin: 16px auto 0;
  padding: 6px 14px;
  background: #FBF6E9;
  color: #8A6A20;
  border: 1px solid #EFDDA6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.welcome-free .free-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #C4A253;
  box-shadow: 0 0 0 3px rgba(196, 162, 83, 0.2);
}

.welcome-title {
  color: var(--ink);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.1px;
  margin-bottom: 20px;
}
.welcome-title em {
  font-style: normal;
  color: var(--green-700);
  font-weight: 800;
  position: relative;
  display: inline-block;
}
.welcome-title em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 6px;
  background: var(--green-100);
  z-index: -1;
  border-radius: 2px;
}

.welcome-subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
}

/* 3 pills lado a lado — sempre, mesmo mobile */
.stat-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 36px;
}
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  text-align: center;
  transition: all 200ms ease;
}
.stat-pill:hover {
  border-color: var(--green-700);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.stat-pill-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: 10px;
  margin-bottom: 10px;
}
.stat-pill-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.2px;
  line-height: 1.15;
}
.stat-pill-label {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.welcome-hint {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ============ CONTACT STEP ============ */
.contact-form { max-width: 460px; margin: 0 auto; }
.contact-form h2 { margin-bottom: 8px; text-align: center; }
.contact-form .subtitle { text-align: center; color: var(--ink-secondary); margin-bottom: 32px; }

/* ============ QUESTION STEP ============ */
.question {
  animation: fadeInUp 300ms ease-out;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.question .q-number {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--green-700); text-transform: uppercase; margin-bottom: 12px;
}
.question .q-text {
  font-size: 22px; font-weight: 700; line-height: 1.35;
  color: var(--ink); margin-bottom: 28px; letter-spacing: -0.3px;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--canvas);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 120ms ease;
  text-align: left;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: auto;
}
.opt:hover {
  border-color: var(--green-700);
  background: var(--green-50);
}
.opt.selected {
  border-color: var(--green-700);
  background: var(--green-50);
  box-shadow: var(--sh-sm);
}
.opt .letter {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--canvas-soft);
  border: 1.5px solid var(--hairline-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: all 120ms;
}
.opt.selected .letter {
  background: var(--green-700);
  color: white;
  border-color: var(--green-700);
}

.nav-buttons { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 12px; }

/* ============ RESULT STEP ============ */
.result {
  animation: fadeInUp 400ms ease-out;
}
.result-hero {
  background: linear-gradient(140deg, var(--green-800), var(--green-700));
  color: white;
  padding: 40px 32px;
  border-radius: var(--r-xl);
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.result-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  border-radius: 50%;
}
.result-hero .overline { color: rgba(255,255,255,0.75); }
.result-hero h1 { color: white; margin: 12px 0 8px; font-size: 40px; }
.result-hero .tagline { color: rgba(255,255,255,0.9); font-size: 18px; font-weight: 500; }
.result-hero .code-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}

.result-section {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--sh-xs);
}
.result-section h3 { color: var(--green-800); margin-bottom: 12px; }
.result-section .body-lg { font-size: 16px; }
.result-section ul { padding-left: 0; list-style: none; margin: 0; }
.result-section li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--ink);
}
.result-section li::before {
  content: '';
  flex-shrink: 0;
  width: 6px; height: 6px;
  background: var(--green-700);
  border-radius: 50%;
  margin-top: 9px;
}

.scores-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 20px 0;
}
.score-cell {
  padding: 14px 8px;
  text-align: center;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas-soft);
}
.score-cell.dominant {
  border-color: var(--green-700);
  background: var(--green-50);
}
.score-cell .code {
  font-size: 20px; font-weight: 800; color: var(--green-700);
  font-family: var(--font-display);
}
.score-cell .label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; font-weight: 600; }
.score-cell .val { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.score-cell.dominant .val { color: var(--green-800); }

.cta-group {
  margin-top: 32px;
  padding: 32px 28px;
  background: linear-gradient(140deg, var(--green-50), var(--green-100));
  border: 1px solid var(--green-100);
  border-radius: var(--r-lg);
  text-align: center;
}
.cta-group h3 { color: var(--green-800); margin-bottom: 8px; }
.cta-group .body-lg { margin-bottom: 24px; }
.cta-group .btn-primary svg { color: white; }

/* ============ FOOTER ============ */
.footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--hairline);
  background: var(--canvas-soft);
  color: var(--ink-muted);
  font-size: 13px;
}
.footer .cartfy-badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 150ms;
}
.footer .cartfy-badge:hover { color: var(--green-700); }
.footer .cartfy-badge img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.footer .cartfy-badge span { font-size: 12px; }

/* ============ ADMIN ============ */
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 20px; }
.stat-card .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--green-800); margin-top: 4px; font-family: var(--font-display); }
.stat-card .hint { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.admin-table th { background: var(--canvas-soft); padding: 12px 16px; text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; border-bottom: 1px solid var(--hairline); }
.admin-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--hairline); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--canvas-soft); }
.profile-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; background: var(--green-50); color: var(--green-800); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  padding: 12px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--sh-lg);
  animation: slideUp 200ms ease-out;
  z-index: 100;
}
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } }
.toast.error { background: var(--danger); }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  h1 { font-size: 28px; }
  .topbar { padding: 12px 18px; }
  .topbar .brand-logo { width: 36px; height: 36px; }
  .topbar .brand { gap: 10px; }
  .topbar .brand-text strong { font-size: 13px; line-height: 1.2; }
  .topbar .brand-text .brand-subtitle {
    font-size: 10px;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    margin-top: 2px;
  }
  .topbar .step-count { display: none; }
  .progress-track { top: 62px; }
  .main { padding: 28px 24px 40px; }
  .container { padding: 0; }
  .welcome-title { font-size: 26px; letter-spacing: -0.5px; padding: 0 4px; }
  .welcome-subtitle { font-size: 15px; padding: 0 4px; }
  /* 3 pills lado a lado no mobile — mais compactos */
  .stat-pills { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-pill { padding: 12px 6px; }
  .stat-pill-icon { width: 30px; height: 30px; margin-bottom: 6px; }
  .stat-pill-value { font-size: 12px; }
  .stat-pill-label { font-size: 9px; letter-spacing: 0.04em; }
  .contact-form { padding: 0 4px; }
  .contact-form h2 { font-size: 22px; }
  .question .q-text { font-size: 19px; padding: 0 4px; }
  .question .q-number { padding: 0 4px; }
  .opt { padding: 14px 16px; font-size: 14px; }
  .result-hero { padding: 36px 24px; }
  .result-hero h1 { font-size: 28px; }
  .result-hero .tagline { font-size: 15px; padding: 0 8px; }
  .result-section { padding: 20px 20px; }
  .scores-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-group { padding: 28px 22px; }
  .admin-shell { padding: 20px 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 10px 14px; }
  .footer { padding: 24px 22px; }
}
