/* ============================================================
   FINANCEL — CONTATO / SUPORTE V4 PREMIUM
   "Problema bem explicado é meio resolvido"
   Mobile-first, guided UX
   ============================================================ */

:root {
  --ct-bg: #020617;
  --ct-text: #e5e7eb;
  --ct-muted: #94a3b8;
  --ct-gold: rgba(250, 204, 21, 0.85);
  --ct-gold-solid: #facc15;
  --ct-green: #22c55e;
  --ct-red: #ef4444;
  --ct-blue: #38bdf8;
  --ct-card: rgba(15, 23, 42, 0.96);
  --ct-border: rgba(148, 163, 184, 0.2);
  --ct-radius: 1.2rem;
  --ct-radius-sm: 0.75rem;
  --ct-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --ct-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body.ct-v4 {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--ct-bg);
  color: var(--ct-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Aurora bg ──────────────────────────────────────────────── */
.ct-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(56,189,248,.2), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(250,204,21,.18), transparent 55%);
  mix-blend-mode: screen;
  animation: ctAurora 18s ease-in-out infinite alternate;
}

@keyframes ctAurora {
  0%   { transform: translate3d(0,0,0) scale(1) }
  50%  { transform: translate3d(20px,-20px,0) scale(1.05) }
  100% { transform: translate3d(-20px,20px,0) scale(1.02) }
}

/* ── Page wrapper ───────────────────────────────────────────── */
.ct-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  position: relative;
  z-index: 1;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.ct-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ct-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ct-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  overflow: hidden;
  flex-shrink: 0;
}

.ct-brand-badge img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ct-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ct-brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-brand-name img {
  height: 16px;
  width: auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.4));
}

.ct-brand-tag {
  font-size: 0.72rem;
  color: var(--ct-muted);
  font-weight: 600;
}

.ct-session {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,.2);
  background: rgba(56,189,248,.06);
  font-size: 0.72rem;
  color: var(--ct-blue);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.ct-session.visible { display: inline-flex; }

.ct-session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ct-blue);
  box-shadow: 0 0 0 3px rgba(56,189,248,.15);
  flex-shrink: 0;
}

.ct-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ct-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--ct-border);
  background: rgba(255,255,255,.02);
  color: var(--ct-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--ct-transition);
  font-family: inherit;
}

.ct-btn-ghost:hover {
  border-color: rgba(250,204,21,.4);
  transform: translateY(-1px);
}

/* ── Hero / Acolhimento ─────────────────────────────────────── */
.ct-hero {
  text-align: center;
  margin-bottom: 20px;
  animation: ctFadeUp .5s ease both;
}

.ct-hero-emoji {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.ct-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ct-gold-solid);
  letter-spacing: -0.02em;
}

.ct-hero p {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--ct-muted);
  line-height: 1.55;
  max-width: 500px;
  margin-inline: auto;
}

/* ── Main Card ──────────────────────────────────────────────── */
.ct-card {
  background: var(--ct-card);
  border-radius: var(--ct-radius);
  padding: 1.3rem;
  border: 1px solid var(--ct-border);
  box-shadow: var(--ct-shadow);
  animation: ctFadeUp .5s ease both;
  animation-delay: 0.08s;
}

/* ── Step indicator ─────────────────────────────────────────── */
.ct-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.1rem;
}

.ct-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

.ct-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ct-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ct-muted);
  flex-shrink: 0;
  transition: all var(--ct-transition);
}

.ct-step-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ct-muted);
  white-space: nowrap;
  transition: color var(--ct-transition);
}

.ct-step-line {
  flex: 1;
  height: 2px;
  background: var(--ct-border);
  margin: 0 8px;
  border-radius: 2px;
  transition: background var(--ct-transition);
}

.ct-step.active .ct-step-num {
  border-color: var(--ct-gold);
  background: rgba(250,204,21,.1);
  color: var(--ct-gold-solid);
}

.ct-step.active .ct-step-label {
  color: var(--ct-gold-solid);
}

.ct-step.done .ct-step-num {
  border-color: var(--ct-green);
  background: rgba(34,197,94,.1);
  color: var(--ct-green);
}

.ct-step.done .ct-step-label {
  color: var(--ct-green);
}

.ct-step.done + .ct-step-line,
.ct-step-line.done {
  background: var(--ct-green);
}

/* ── Form sections ──────────────────────────────────────────── */
.ct-form-section {
  display: none;
}

.ct-form-section.active {
  display: block;
  animation: ctFadeUp .3s ease both;
}

.ct-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 4px;
}

.ct-section-sub {
  font-size: 0.76rem;
  color: var(--ct-muted);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

/* ── Problem type cards ─────────────────────────────────────── */
.ct-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.4rem;
}

.ct-type-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  background: transparent;
  color: var(--ct-muted);
  cursor: pointer;
  transition: all var(--ct-transition);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}

.ct-type-card:hover {
  border-color: rgba(148,163,184,.4);
  color: var(--ct-text);
}

.ct-type-card.active {
  border-color: rgba(250,204,21,.4);
  background: rgba(250,204,21,.05);
  color: #fde68a;
  box-shadow: 0 0 0 2px rgba(250,204,21,.08);
}

.ct-type-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Form fields ────────────────────────────────────────────── */
.ct-field {
  margin-bottom: 0.85rem;
}

.ct-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ct-muted);
  margin-bottom: 4px;
}

.ct-field-label strong {
  color: #fde68a;
}

.ct-field-hint {
  font-size: 0.7rem;
  color: rgba(148,163,184,.7);
  margin-top: 3px;
  line-height: 1.3;
}

.ct-input,
.ct-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  background: rgba(255,255,255,.02);
  color: var(--ct-text);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--ct-transition);
}

.ct-input:focus,
.ct-textarea:focus {
  outline: none;
  border-color: rgba(250,204,21,.4);
  box-shadow: 0 0 0 3px rgba(250,204,21,.08);
}

.ct-textarea {
  min-height: 80px;
  resize: vertical;
}

.ct-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* ── File upload ────────────────────────────────────────────── */
.ct-upload-zone {
  border: 2px dashed rgba(148,163,184,.25);
  border-radius: var(--ct-radius-sm);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--ct-transition);
  position: relative;
}

.ct-upload-zone:hover,
.ct-upload-zone.dragover {
  border-color: rgba(250,204,21,.4);
  background: rgba(250,204,21,.02);
}

.ct-upload-zone input[type="file"] {
  display: none;
}

.ct-upload-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.ct-upload-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ct-muted);
}

.ct-upload-text strong {
  color: #fde68a;
}

.ct-upload-hint {
  font-size: 0.7rem;
  color: rgba(148,163,184,.6);
  margin-top: 3px;
}

.ct-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ct-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ct-border);
}

.ct-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ct-preview-file {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,.8);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ct-muted);
  text-align: center;
  padding: 4px;
  word-break: break-all;
}

.ct-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239,68,68,.9);
  color: #fff;
  border: none;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Nav buttons ────────────────────────────────────────────── */
.ct-nav {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
}

.ct-btn-back {
  padding: 10px 18px;
  border-radius: var(--ct-radius-sm);
  border: 1px solid var(--ct-border);
  background: transparent;
  color: var(--ct-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ct-transition);
  font-family: inherit;
}

.ct-btn-back:hover {
  border-color: rgba(148,163,184,.4);
  color: var(--ct-text);
}

.ct-btn-next {
  flex: 1;
  padding: 10px 18px;
  border-radius: var(--ct-radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--ct-gold), #d97706);
  color: #1a1500;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--ct-transition);
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(250,204,21,.2);
}

.ct-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(250,204,21,.35);
}

.ct-btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ct-btn-submit {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--ct-radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--ct-gold), #d97706);
  color: #1a1500;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--ct-transition);
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(250,204,21,.25);
}

.ct-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(250,204,21,.4);
}

.ct-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Success overlay ────────────────────────────────────────── */
.ct-success {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
  animation: ctFadeUp .4s ease both;
}

.ct-success.visible {
  display: block;
}

.ct-success-emoji {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.ct-success h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ct-green);
}

.ct-success p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--ct-muted);
  line-height: 1.5;
}

.ct-protocol-box {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--ct-radius-sm);
  border: 1px solid rgba(34,197,94,.2);
  background: rgba(34,197,94,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.02em;
  margin: 10px 0 14px;
  word-break: break-all;
}

.ct-success-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── Aside tips ─────────────────────────────────────────────── */
.ct-aside {
  margin-top: 14px;
  animation: ctFadeUp .5s ease both;
  animation-delay: 0.15s;
}

.ct-aside-card {
  background: var(--ct-card);
  border-radius: var(--ct-radius);
  padding: 1rem 1.2rem;
  border: 1px solid var(--ct-border);
  box-shadow: var(--ct-shadow);
}

.ct-aside-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ct-faq-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(148,163,184,.08);
}

.ct-faq-item:last-child { border-bottom: none; }

.ct-faq-q {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ct-faq-q::after {
  content: '▸';
  font-size: 0.7rem;
  color: var(--ct-muted);
  transition: transform var(--ct-transition);
}

.ct-faq-item.open .ct-faq-q::after {
  transform: rotate(90deg);
}

.ct-faq-a {
  font-size: 0.74rem;
  color: var(--ct-muted);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  padding: 0;
}

.ct-faq-item.open .ct-faq-a {
  max-height: 200px;
  padding-top: 6px;
}

.ct-contact-info {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--ct-radius-sm);
  border: 1px solid rgba(56,189,248,.12);
  background: rgba(14,25,40,.6);
  font-size: 0.76rem;
  color: var(--ct-muted);
  line-height: 1.6;
}

.ct-contact-info strong {
  color: var(--ct-text);
}

/* ── Error message ──────────────────────────────────────────── */
.ct-error-msg {
  font-size: 0.78rem;
  color: var(--ct-red);
  margin-top: 6px;
  min-height: 1em;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes ctFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ct-page {
    padding: 14px 12px 32px;
  }

  .ct-hero h1 {
    font-size: 1.15rem;
  }

  .ct-card {
    padding: 1rem;
  }

  .ct-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ct-row {
    grid-template-columns: 1fr;
  }

  .ct-step-label {
    display: none;
  }

  .ct-step-num {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .ct-upload-zone {
    padding: 0.85rem;
  }
}

@media (max-width: 400px) {
  .ct-type-grid {
    grid-template-columns: 1fr;
  }

  .ct-brand-tag { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   KB Link (hero + aside)
   ═══════════════════════════════════════════════════════════ */
.ct-kb-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 1rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(250,204,21,0.12), rgba(56,189,248,0.10));
  border: 1px solid rgba(250,204,21,0.25);
  color: var(--ct-gold, #facc15);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
}
.ct-kb-link:hover {
  background: linear-gradient(135deg, rgba(250,204,21,0.22), rgba(56,189,248,0.18));
  border-color: rgba(250,204,21,0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(250,204,21,0.15);
}
.ct-kb-link-sub {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--ct-muted, #94a3b8);
  letter-spacing: 0.02em;
}

.ct-aside-kb {
  display: block;
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(250,204,21,0.08), rgba(56,189,248,0.06));
  border: 1px solid rgba(250,204,21,0.18);
  color: var(--ct-gold, #facc15);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
  transition: all 0.25s ease;
}
.ct-aside-kb:hover {
  background: linear-gradient(135deg, rgba(250,204,21,0.16), rgba(56,189,248,0.12));
  border-color: rgba(250,204,21,0.35);
  transform: translateY(-1px);
}
