/* ============================================================
   FINANCEL — CONFIGS V4 PREMIUM
   "Configuração não é ajuste técnico, é personalização de valor"

   Redesign decision-first, mobile-first
   Layer sobre configs-v3.css — reorganiza visualmente
   ============================================================ */

:root {
  --cf-radius: 1.2rem;
  --cf-radius-sm: 0.75rem;
  --cf-border: rgba(148, 163, 184, 0.18);
  --cf-gold: rgba(250, 204, 21, 0.85);
  --cf-green: #22c55e;
  --cf-red: #ef4444;
  --cf-amber: #f59e0b;
  --cf-blue: #38bdf8;
  --cf-purple: #a78bfa;
  --cf-surface: rgba(15, 23, 42, 0.92);
  --cf-surface-elevated: rgba(17, 25, 45, 0.95);
  --cf-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --cf-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
  --cf-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   HIDE LEGACY GRID — the v4 shell reorganizes everything
   ============================================================ */

.configs-grid {
  display: none !important;
}

.configs-full-width {
  display: none !important;
}

/* Hide the inspirational phrase — we have our own */
.page.dashboard-container > div[style*="max-width: 1400px"][style*="opacity: 0.7"] {
  display: none !important;
}

/* ============================================================
   V4 WRAPPER
   ============================================================ */

#cfV4Wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ============================================================
   PROFILE HERO — Welcome card with completion %
   ============================================================ */

.cf-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--cf-radius);
  background: var(--cf-surface);
  border: 1px solid rgba(250, 204, 21, 0.12);
  box-shadow: var(--cf-shadow);
  position: relative;
  overflow: hidden;
  animation: cfFadeUp 0.5s ease both;
}

.cf-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cf-gold);
  border-radius: var(--cf-radius) 0 0 var(--cf-radius);
}

.cf-hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.05));
  border: 2px solid rgba(250, 204, 21, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cf-hero-body {
  flex: 1;
  min-width: 0;
}

.cf-hero-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
}

.cf-hero-sub {
  font-size: 0.78rem;
  color: var(--fin-slate-400, #94a3b8);
  margin-top: 2px;
}

.cf-hero-right {
  text-align: center;
  flex-shrink: 0;
}

.cf-hero-pct {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--cf-gold);
}

.cf-hero-pct-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fin-slate-400, #94a3b8);
}

/* ============================================================
   IMPACT TIPS — Quick contextual hint
   ============================================================ */

.cf-tip {
  margin-top: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: var(--cf-radius);
  background: var(--cf-surface);
  border: 1px solid var(--cf-border);
  font-size: 0.78rem;
  color: #e2e8f0;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--cf-shadow);
  animation: cfFadeUp 0.5s ease both;
  animation-delay: 0.05s;
}

.cf-tip strong { color: #fde68a; }

/* ============================================================
   CTA BANNER — Assine Agora
   ============================================================ */

.cf-cta-banner {
  display: none;
  margin-top: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--cf-radius);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08) 0%, rgba(217, 119, 6, 0.12) 100%);
  border: 1px solid rgba(250, 204, 21, 0.25);
  box-shadow: 0 4px 24px rgba(250, 204, 21, 0.08);
  animation: cfFadeUp 0.4s ease both;
  animation-delay: 0.06s;
  position: relative;
  overflow: hidden;
}

.cf-cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cf-gold), #d97706, var(--cf-gold));
  background-size: 200% 100%;
  animation: cfCtaShimmer 3s ease infinite;
}

@keyframes cfCtaShimmer {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 0%; }
}

.cf-cta-banner.visible {
  display: block;
}

.cf-cta-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.cf-cta-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cf-cta-text {
  flex: 1;
  min-width: 0;
}

.cf-cta-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fde68a;
}

.cf-cta-sub {
  font-size: 0.74rem;
  color: #e2e8f0;
  margin-top: 2px;
  line-height: 1.35;
}

.cf-cta-btn {
  width: 100%;
  padding: 11px 18px;
  border-radius: var(--cf-radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--cf-gold), #d97706);
  color: #1a1500;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}

.cf-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(250, 204, 21, 0.4);
}

.cf-cta-dismiss {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.5);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color var(--cf-transition);
}

.cf-cta-dismiss:hover {
  color: #e2e8f0;
}

/* ============================================================
   SECTIONS — Collapsible groups
   ============================================================ */

.cf-section {
  margin-top: 0.65rem;
  border-radius: var(--cf-radius);
  background: var(--cf-surface);
  border: 1px solid var(--cf-border);
  box-shadow: var(--cf-shadow);
  overflow: hidden;
  animation: cfFadeUp 0.5s ease both;
}

.cf-section:nth-child(3) { animation-delay: 0.08s; }
.cf-section:nth-child(4) { animation-delay: 0.12s; }
.cf-section:nth-child(5) { animation-delay: 0.16s; }
.cf-section:nth-child(6) { animation-delay: 0.2s; }
.cf-section:nth-child(7) { animation-delay: 0.24s; }
.cf-section:nth-child(8) { animation-delay: 0.28s; }

.cf-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--cf-transition);
}

.cf-section-header:hover {
  background: rgba(148, 163, 184, 0.04);
}

.cf-section-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.cf-section-title-group {
  flex: 1;
  min-width: 0;
}

.cf-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cf-section-subtitle {
  font-size: 0.72rem;
  color: var(--fin-slate-400, #94a3b8);
  margin-top: 1px;
}

.cf-section-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cf-section-badge--complete {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.cf-section-badge--pending {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.cf-section-badge--new {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.cf-section-chevron {
  font-size: 0.8rem;
  color: var(--fin-slate-400, #94a3b8);
  transition: transform var(--cf-transition);
  flex-shrink: 0;
}

.cf-section.open .cf-section-chevron {
  transform: rotate(180deg);
}

.cf-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.3s ease;
  padding: 0 1.1rem;
}

.cf-section.open .cf-section-body {
  max-height: 2000px;
  padding: 0 1.1rem 1.1rem;
}

/* ============================================================
   FORM ELEMENTS — V4 styled
   ============================================================ */

.cf-field {
  margin-bottom: 0.75rem;
}

.cf-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fin-slate-400, #94a3b8);
  margin-bottom: 0.35rem;
}

.cf-field-hint {
  font-size: 0.7rem;
  color: var(--fin-slate-400, #94a3b8);
  margin-top: 3px;
  line-height: 1.35;
}

.cf-field-hint strong { color: #fde68a; }

.cf-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--cf-radius-sm);
  border: 1px solid var(--cf-border);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--cf-transition);
  box-sizing: border-box;
}

.cf-input:focus {
  outline: none;
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.1);
}

.cf-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cf-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--cf-radius-sm);
  border: 1px solid var(--cf-border);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--cf-transition);
  box-sizing: border-box;
  appearance: none;
  cursor: pointer;
}

.cf-select:focus {
  outline: none;
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.1);
}

.cf-select option {
  background: #0f172a;
  color: #e2e8f0;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* ============================================================
   PROFESSION PICKER — Visual selection cards
   ============================================================ */

.cf-prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 0.35rem;
}

.cf-prof-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.3rem;
  border-radius: var(--cf-radius-sm);
  border: 1px solid var(--cf-border);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  text-align: center;
}

.cf-prof-card:hover {
  border-color: rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.04);
}

.cf-prof-card.active {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.06);
  color: #fde68a;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.08);
}

.cf-prof-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.cf-prof-label {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
}

/* ============================================================
   IMPACT NOTE — show what changes with selection
   ============================================================ */

.cf-impact-note {
  margin-top: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.12);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(14, 25, 40, 0.9));
  font-size: 0.75rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.cf-impact-note strong {
  color: var(--cf-blue);
}

.cf-impact-note em {
  color: #fde68a;
  font-style: normal;
  font-weight: 700;
}

/* ============================================================
   LEGACY RESET — Kill btn-main gigantism inside V4 wrapper
   ============================================================ */

#cfV4Wrapper .btn-main,
#cfV4Wrapper .btn-secondary,
#cfV4Wrapper .btn-danger,
#cfV4Wrapper button[type="submit"],
#cfV4Wrapper .lanc-save-btn {
  height: auto !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 10px 18px !important;
  font-size: 0.84rem !important;
  width: 100%;
  box-sizing: border-box;
}

#cfV4Wrapper .btn-main svg,
#cfV4Wrapper .btn-secondary svg,
#cfV4Wrapper .btn-danger svg,
#cfV4Wrapper button svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}

/* ============================================================
   SAVE BUTTONS V4
   ============================================================ */

.cf-btn-save {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 18px;
  border-radius: var(--cf-radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--cf-gold), #d97706);
  color: #1a1500;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(250, 204, 21, 0.2);
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}

.cf-btn-save svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}

.cf-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.35);
}

.cf-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cf-btn-secondary {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 18px;
  border-radius: var(--cf-radius-sm);
  border: 1px solid var(--cf-border);
  background: transparent;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.cf-btn-secondary:hover {
  border-color: rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
}

.cf-btn-danger {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 18px;
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  color: #f87171;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  margin-top: 0.75rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cf-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ============================================================
   USER CARDS (for user list inside section)
   ============================================================ */

.cf-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--cf-radius-sm);
  border: 1px solid var(--cf-border);
  margin-bottom: 0.4rem;
}

.cf-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cf-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-user-email {
  font-size: 0.72rem;
  color: var(--fin-slate-400, #94a3b8);
}

.cf-user-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.cf-user-role {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(250, 204, 21, 0.06);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.15);
}

.cf-btn-sm {
  padding: 4px 10px;
  border-radius: var(--cf-radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--cf-border);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
}

.cf-btn-sm:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ============================================================
   STATUS DISPLAY
   ============================================================ */

.cf-status {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  min-height: 1.1em;
}

.cf-status--success { color: var(--cf-green); }
.cf-status--error   { color: var(--cf-red); }
.cf-status--info    { color: var(--fin-slate-400, #94a3b8); }

/* ============================================================
   PLAN CARD — special styling
   ============================================================ */

.cf-plan-info {
  padding: 0.7rem 0.85rem;
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.12);
  background: rgba(14, 25, 40, 0.7);
  margin-bottom: 0.75rem;
}

.cf-plan-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.cf-plan-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f1f5f9;
}

.cf-plan-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.cf-plan-badge--trial {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.cf-plan-badge--expired {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.cf-plan-detail {
  font-size: 0.75rem;
  color: var(--fin-slate-400, #94a3b8);
  margin-top: 4px;
}

/* ============================================================
   SUPPORT BAR — always visible at bottom
   ============================================================ */

.cf-support-bar {
  margin-top: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--cf-radius);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: var(--cf-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  animation: cfFadeUp 0.5s ease both;
  animation-delay: 0.3s;
}

.cf-support-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.cf-support-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cf-support-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f1f5f9;
}

.cf-support-sub {
  font-size: 0.72rem;
  color: var(--fin-slate-400, #94a3b8);
  margin-top: 1px;
}

.cf-support-btn {
  padding: 9px 22px;
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--cf-transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  flex-shrink: 0;
}

.cf-support-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #bae6fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
}

@media (max-width: 480px) {
  .cf-support-bar {
    flex-direction: column;
    text-align: center;
  }

  .cf-support-text {
    flex-direction: column;
    gap: 0.3rem;
  }

  .cf-support-btn {
    width: 100%;
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes cfFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE — 768px
   ============================================================ */

@media (max-width: 768px) {
  #cfV4Wrapper {
    padding: 0 0.65rem 2rem;
  }

  .cf-hero {
    padding: 0.9rem 1rem;
    gap: 0.75rem;
  }

  .cf-hero-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .cf-hero-name {
    font-size: 0.95rem;
  }

  .cf-row {
    grid-template-columns: 1fr;
  }

  .cf-prof-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cf-section-header {
    padding: 0.75rem 0.9rem;
  }

  .cf-section.open .cf-section-body {
    padding: 0 0.9rem 0.9rem;
  }
}

/* ============================================================
   MOBILE — 480px
   ============================================================ */

@media (max-width: 480px) {
  .cf-hero-right {
    display: none;
  }

  .cf-prof-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cf-section-subtitle {
    display: none;
  }

  .cf-btn-save,
  .cf-btn-secondary,
  .cf-btn-danger {
    font-size: 0.82rem;
  }
}
