/* ===============================================
   KOVI – ANÁLISE DE PERFIL | CSS
   Mobile-first · Coral/Rosa gradient theme
   =============================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --kovi-start: #F4435A;
  --kovi-end:   #EC407A;
  --kovi-grad:  linear-gradient(135deg, #F4435A 0%, #EC407A 100%);
  --kovi-dark:  #C62550;
  --kovi-light: #fff0f3;

  --bg:         #f5f6fa;
  --card-bg:    #ffffff;
  --text-main:  #1a1a2e;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --input-bg:   #f9fafb;

  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 4px 24px rgba(244,67,90,.12), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(244,67,90,.18), 0 2px 8px rgba(0,0,0,.08);

  --font:       'Inter', sans-serif;
  --trans:      .28s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Screen System ---- */
.screen {
  display: none;
  min-height: 100dvh;
}
.screen.active { display: block; }

/* ---- App Shell ---- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-shell.centered {
  justify-content: center;
  align-items: stretch;
  padding: 24px 16px 40px;
}

/* ---- Header ---- */
.app-header {
  background: var(--kovi-grad);
  padding: 28px 24px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.app-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='25'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.logo-icon {
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
}
.logo-text {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}
.header-sub {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: .3px;
  position: relative;
}

/* ---- Hero Badge ---- */
.hero-badge {
  background: var(--kovi-light);
  border: 1px solid rgba(244,67,90,.2);
  border-radius: 0 0 12px 12px;
  text-align: center;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--kovi-start);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---- Card ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 16px;
  padding: 28px 24px;
}

/* ---- Form Card ---- */
.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---- Fields ---- */
.field-group {
  margin-bottom: 18px;
}
.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap > i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
  -webkit-appearance: none;
  appearance: none;
}
.input-wrap input::placeholder { color: #b0b7c3; }
.input-wrap input:focus {
  border-color: var(--kovi-start);
  box-shadow: 0 0 0 3px rgba(244,67,90,.12);
  background: #fff;
}
.input-wrap input.error { border-color: #f44336; }

.field-error {
  display: block;
  font-size: 12px;
  color: #f44336;
  margin-top: 4px;
  min-height: 16px;
}

/* ---- Chip Group ---- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans);
}
.chip.selected {
  border-color: var(--kovi-start);
  background: var(--kovi-light);
  color: var(--kovi-start);
  font-weight: 600;
}
.chip:active { transform: scale(.96); }

/* ---- Primary Button ---- */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--kovi-grad);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(244,67,90,.35);
  transition: transform var(--trans), box-shadow var(--trans), opacity var(--trans);
  margin-top: 8px;
  letter-spacing: .3px;
}
.btn-primary:hover { opacity: .92; box-shadow: 0 6px 20px rgba(244,67,90,.45); }
.btn-primary:active { transform: scale(.97); }

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 16px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ===============================================
   TELA DE ANÁLISE
   =============================================== */

/* ---- Analysis Card ---- */
.analysis-card {
  text-align: center;
  padding: 36px 24px;
}

/* ---- Phase visibility ---- */
.phase { display: none; }
.phase.active { display: block; }

/* ---- Spinner ---- */
.spinner-ring {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 24px;
}
.spinner-svg {
  width: 100px; height: 100px;
  transform: rotate(-90deg);
}
.spinner-track {
  fill: none;
  stroke: var(--kovi-light);
  stroke-width: 6;
}
.spinner-fill {
  fill: none;
  stroke: url(#koviGrad);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213;
  stroke-dashoffset: 213;
  animation: spinFill 5.5s ease forwards;
}
@keyframes spinFill {
  0%   { stroke-dashoffset: 213; }
  100% { stroke-dashoffset: 0; }
}
.spinner-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: var(--kovi-start);
}

/* SVG gradient def injected via JS */

.analysis-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.analysis-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ---- Check List ---- */
.check-list {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  opacity: .4;
  transition: opacity .3s;
}
.check-item.done { opacity: 1; color: var(--text-main); }

.check-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.check-dot.pending {
  background: var(--border);
  border: 2px solid #d1d5db;
}
.check-dot.checking {
  background: rgba(244,67,90,.1);
  border: 2px solid var(--kovi-start);
  animation: pulse 1s infinite;
}
.check-dot.ok {
  background: linear-gradient(135deg,#4CAF50,#2e7d32);
  border: 2px solid transparent;
}
.check-dot.ok::after { content: '✓'; color: #fff; font-weight: 700; font-size: 11px; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(244,67,90,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(244,67,90,0); }
}

/* ---- Approved Phase ---- */
.approved-badge {
  margin: 0 auto 20px;
}
.approved-circle {
  width: 100px; height: 100px;
  background: linear-gradient(135deg,#4CAF50,#2e7d32);
  border-radius: 50%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 50px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(76,175,80,.35);
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.approved-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}
.approved-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ---- Result Summary ---- */
.result-summary {
  background: var(--kovi-light);
  border: 1px solid rgba(244,67,90,.18);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(244,67,90,.1);
  font-size: 13.5px;
}
.result-row:last-child { border-bottom: none; }
.result-row i { color: var(--kovi-start); width: 16px; flex-shrink: 0; }
.result-row strong { color: var(--text-muted); font-weight: 500; min-width: 90px; }
.result-row span { color: var(--text-main); font-weight: 600; }

/* ---- Next Step Box ---- */
.next-step-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #2e7d32;
  line-height: 1.5;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
}
.next-step-box i { margin-top: 2px; flex-shrink: 0; }

/* ---- WhatsApp Button ---- */
.btn-whatsapp {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
  transition: transform var(--trans), box-shadow var(--trans), opacity var(--trans);
  text-decoration: none;
  letter-spacing: .3px;
  margin-bottom: 14px;
}
.btn-whatsapp:hover { opacity: .92; box-shadow: 0 6px 20px rgba(37,211,102,.45); }
.btn-whatsapp:active { transform: scale(.97); }
.btn-whatsapp i { font-size: 20px; }

.privacy-note {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ---- Responsive tweaks ---- */
@media (min-width: 480px) {
  .app-shell { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  body { background: #e8e9ef; }
}
