@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* MezFlow visual refresh. Loaded last so it restyles every page without touching APIs. */

:root {
  --mf-ink: #0c1222;
  --mf-text: #121826;
  --mf-muted: #5c6b80;
  --mf-line: rgba(15, 23, 42, 0.08);
  --mf-canvas: #f4f6fb;
  --mf-card: #ffffff;
  --mf-brand: #4f46e5;
  --mf-brand-2: #4338ca;
  --mf-accent: #06b6d4;
  --mf-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --mf-radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif !important;
  color: var(--mf-text) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.12), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.1), transparent 24%),
    linear-gradient(180deg, #f8f9fd 0%, var(--mf-canvas) 100%) !important;
  letter-spacing: -0.011em;
}

h1, h2, h3, h4, .mfx-title, .logo, .header-brand-copy strong {
  letter-spacing: -0.035em;
}

/* Restore modern radii over the old square-corner rule. */
.btn,
a.btn,
button,
input,
select,
textarea,
.card,
.panel,
.auth-card,
.mfx-hero,
.mfx-block,
.mfx-card,
.mfx-step-card,
.mfx-testimonial-card,
.mfx-hero-card,
.pricing-card,
.nav-link,
.nav-link-item,
.menu-toggle,
.kpi-card,
.split-pill,
.mini-metric-grid > div,
.about-hero,
.about-section,
.about-cta,
.about-delivery-card,
.contact-hero,
.contact-form-section,
.contact-info-cards article,
.profile-menu,
.nav-links,
.app-footer,
.demo-banner,
.sidebar-brand,
.funnel-step,
.automation-grid article {
  border-radius: var(--mf-radius) !important;
}

.btn,
a.btn,
button.btn,
.menu-toggle,
.nav-link,
.nav-link-item,
input,
select,
textarea,
.pricing-label,
.mfx-brand-row span,
.profile-toggle {
  border-radius: 12px !important;
}

.mfx-person img,
.profile-image,
.mfx-step-index {
  border-radius: 50% !important;
}

.header-brand-mark,
.sidebar-mark {
  border-radius: 12px !important;
}

.pricing-label,
.mfx-brand-row span,
.demo-mode-badge,
.pill {
  border-radius: 999px !important;
}

/* Public navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 249, 253, 0.78) !important;
  border-bottom: 1px solid var(--mf-line) !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.top-nav .row {
  min-height: 72px;
}

.top-nav .logo,
.footer-brand h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mf-ink) !important;
  font-weight: 800;
  text-decoration: none;
}

.top-nav .logo::before,
.footer-brand h3::before,
.sidebar-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px !important;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(145deg, #6366f1, #4f46e5 45%, #0891b2);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}

.top-nav .logo::before,
.footer-brand h3::before {
  content: "M";
}

.nav-link-item {
  color: #334155 !important;
  font-weight: 600;
  border-radius: 999px !important;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link-item:hover,
.nav-link-item.active {
  background: rgba(79, 70, 229, 0.1) !important;
  color: #312e81 !important;
  transform: translateY(-1px);
}

.menu-toggle {
  border: 1px solid var(--mf-line) !important;
  background: #fff !important;
  border-radius: 12px !important;
}

.nav-links.open {
  animation: mf-drop 0.28s ease both;
}

/* Buttons */
.btn,
a.btn,
button.btn {
  border: 0 !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.28) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}

.btn:hover,
a.btn:hover,
button.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.34) !important;
}

.btn.secondary,
a.btn.secondary,
button.btn.secondary {
  background: #fff !important;
  color: #312e81 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05) !important;
}

.btn-sm.danger,
.top-nav-action.danger,
button.danger {
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
  box-shadow: none !important;
}

.action-icon,
.mf-ico {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -3px;
}

.action-icon svg,
.menu-icon .mf-ico {
  width: 16px;
  height: 16px;
  display: block;
}

/* Landing */
.landing-v2,
.mfx-page {
  gap: 22px !important;
}

.mfx-hero,
.mfx-block,
.about-hero,
.about-section,
.about-cta,
.contact-hero,
.contact-form-section {
  border: 1px solid var(--mf-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--mf-shadow) !important;
  padding: 28px !important;
}

.mfx-hero {
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(6, 182, 212, 0.16), transparent 26%),
    radial-gradient(circle at 8% 90%, rgba(79, 70, 229, 0.14), transparent 28%),
    #fff !important;
}

.mfx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px !important;
  background: rgba(79, 70, 229, 0.1);
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mfx-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50% !important;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15);
  animation: mf-pulse 1.8s ease-in-out infinite;
}

.mfx-hero-copy h1,
.about-hero-copy h1,
.contact-hero-copy h1 {
  font-size: clamp(2.4rem, 4.4vw, 4.1rem) !important;
  line-height: 1.02 !important;
  font-weight: 800;
}

.mfx-hero-copy h1 span,
.mfx-title span,
.about-hero-copy h1 span,
.contact-hero-copy h1 span {
  background: linear-gradient(120deg, #4f46e5, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.mfx-hero-orb {
  display: block !important;
  position: absolute;
  border-radius: 50% !important;
  filter: blur(2px);
  animation: mf-drift 14s ease-in-out infinite;
}

.mfx-hero-card {
  border: 1px solid var(--mf-line) !important;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12) !important;
  animation: mf-float 5.5s ease-in-out infinite;
}

.mfx-card,
.mfx-step-card,
.mfx-testimonial-card,
.pricing-card,
.about-delivery-card,
.contact-info-cards article {
  border: 1px solid var(--mf-line) !important;
  background: #fff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04) !important;
  padding: 18px !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.mfx-card:hover,
.mfx-step-card:hover,
.mfx-testimonial-card:hover,
.pricing-card:hover,
.about-delivery-card:hover,
.contact-info-cards article:hover,
.kpi-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 70, 229, 0.28) !important;
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.12) !important;
}

.mfx-card-icon {
  width: 48px;
  height: 48px;
  border: 0 !important;
  border-radius: 14px !important;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #0891b2) !important;
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.28);
}

.mfx-card-icon svg {
  width: 22px;
  height: 22px;
}

.mfx-step-index {
  background: linear-gradient(145deg, #6366f1, #4f46e5) !important;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.pricing-card.featured {
  background: linear-gradient(180deg, #2a3548, #3730a3) !important;
  color: #e2e8f0;
  border-color: transparent !important;
  transform: translateY(-8px);
}

.pricing-card.featured h3,
.pricing-card.featured li,
.pricing-card.featured .pricing-label {
  color: #fff !important;
}

.pricing-card.featured .pricing-label {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.pricing-card.featured h3 span,
.pricing-card.featured li {
  color: #cbd5e1 !important;
}

.pricing-card li::before {
  width: 14px;
  height: 14px;
  top: 3px;
  border-radius: 50% !important;
  background: #4f46e5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat !important;
}

.footer {
  margin-top: 28px !important;
  border-top: 0 !important;
  background: #2a3548 !important;
  color: #cbd5e1;
}

.footer h3,
.footer h4,
.footer a,
.footer p,
.footer-bottom {
  color: #e2e8f0 !important;
}

.footer a:hover {
  color: #fff !important;
}

.footer-bottom,
.footer > .container:only-child {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 18px 24px 22px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1 !important;
  font-size: 0.92rem !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

/* Auth */
.auth-page,
.checkout-page {
  min-height: calc(100vh - 150px);
  padding: 36px 16px 56px !important;
  background:
    radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.16), transparent 26%),
    radial-gradient(circle at 88% 80%, rgba(6, 182, 212, 0.14), transparent 28%) !important;
}

.auth-card,
.checkout-page .card {
  width: min(460px, 100%);
  padding: 28px !important;
  border: 1px solid var(--mf-line) !important;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.1) !important;
  animation: mf-rise 0.6s ease both;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.auth-lead {
  margin: 0 0 8px;
  color: var(--mf-muted);
}

.auth-card input,
.contact-form input,
.contact-form select,
.contact-form textarea,
input,
select,
textarea {
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  min-height: 46px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: #fff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16) !important;
}

/* App shell */
body.app-shell {
  background: #f3f5fa !important;
}

body.app-shell .app-page-header {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid var(--mf-line) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
  backdrop-filter: blur(16px);
}

body.app-shell .header-brand-copy strong {
  color: var(--mf-ink) !important;
}

body.app-shell .header-brand-copy span {
  color: var(--mf-muted) !important;
}

body.app-shell .header-brand-mark {
  border-radius: 12px !important;
  color: #fff !important;
  background: linear-gradient(145deg, #6366f1, #0891b2) !important;
}

body.app-shell .dashboard,
.dashboard {
  grid-template-columns: 272px minmax(0, 1fr) !important;
}

body.app-shell .dashboard .sidebar,
.dashboard .sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(99, 102, 241, 0.35), transparent 28%),
    #2a3548 !important;
  color: #cbd5e1 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  padding: 18px 12px !important;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 6px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
}

.sidebar-brand span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-mark {
  flex: 0 0 auto;
}

.dashboard .nav-link {
  color: #dbe4f0 !important;
  border-radius: 12px !important;
  margin-bottom: 4px;
  font-weight: 600;
}

.dashboard .menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e0e7ff;
}

.dashboard .nav-link:hover,
.dashboard .nav-link.active,
.dashboard .has-submenu.submenu-open {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(255, 255, 255, 0.04)) !important;
  box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.35) !important;
  color: #fff !important;
}

.dashboard .nav-link.active .menu-icon,
.dashboard .nav-link:hover .menu-icon {
  background: rgba(255, 255, 255, 0.16) !important;
}

body.app-shell .dashboard .main,
.dashboard .main {
  background:
    radial-gradient(circle at 100% 0%, rgba(79, 70, 229, 0.08), transparent 24%),
    #f3f5fa !important;
  padding: 22px !important;
}

body.app-shell .page-title-stack h1,
#pageContentTitle {
  font-size: 1.7rem;
  font-weight: 800;
}

.dashboard .card,
.dashboard .panel,
.main .card,
#moduleSection,
#agentManageSection,
#agentHistoryPanel {
  background: #fff !important;
  border: 1px solid var(--mf-line) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  animation: mf-rise 0.55s ease both;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.16), transparent 68%);
}

.kpi-card h3 {
  font-size: 1.7rem !important;
  letter-spacing: -0.04em;
}

.kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.04s; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.08s; }
.kpi-grid .kpi-card:nth-child(4) { animation-delay: 0.12s; }
.kpi-grid .kpi-card:nth-child(5) { animation-delay: 0.16s; }
.kpi-grid .kpi-card:nth-child(6) { animation-delay: 0.2s; }

.split-pill,
.mini-metric-grid > div,
.automation-grid article,
.funnel-step {
  border: 1px solid var(--mf-line) !important;
  background: #f8fafc !important;
}

body.app-shell .profile-toggle,
body.app-shell #appHeader .profile-toggle {
  background: #fff !important;
  border: 1px solid var(--mf-line) !important;
  color: var(--mf-text) !important;
  border-radius: 999px !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

body.app-shell .profile-menu {
  border: 1px solid var(--mf-line) !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12) !important;
  overflow: hidden;
}

body.app-shell .app-footer,
.app-footer {
  background: #ffffff !important;
  color: #64748b !important;
  text-align: center !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding: 16px 20px 18px !important;
}

.app-footer-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 4px !important;
}

.app-footer-brand,
.app-footer-copy {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.app-footer-copy {
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mf-muted) !important;
}

tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(79, 70, 229, 0.04);
}

/* Demo */
.demo-shell .card,
.demo-banner,
.tour-stepper {
  border-radius: 18px !important;
}

.demo-cta-group a,
.tour-actions button,
.chat-form button {
  border-radius: 12px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-cta-group a:hover,
.tour-actions button:hover,
.chat-form button:hover {
  transform: translateY(-1px);
}

/* Motion */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.show {
  opacity: 1;
  transform: none;
}

.mfx-feature-grid .mfx-card:nth-child(2),
.mfx-step-grid .mfx-step-card:nth-child(2),
.mfx-testimonial-grid .mfx-testimonial-card:nth-child(2) {
  transition-delay: 0.08s;
}

.mfx-feature-grid .mfx-card:nth-child(3),
.mfx-step-grid .mfx-step-card:nth-child(3),
.mfx-testimonial-grid .mfx-testimonial-card:nth-child(3) {
  transition-delay: 0.16s;
}

@keyframes mf-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes mf-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes mf-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -12px); }
}

@keyframes mf-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}

@keyframes mf-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  body.app-shell .dashboard,
  .dashboard {
    grid-template-columns: 1fr !important;
  }

  .mfx-hero,
  .about-hero,
  .contact-hero {
    grid-template-columns: 1fr !important;
  }

  .pricing-card.featured {
    transform: none;
  }
}

/* Full-bleed page width */
.container,
.about-container,
.contact-container,
.checkout-wrap,
.demo-shell,
.landing-v2,
.mfx-page,
.about-page,
.contact-page {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.container,
.about-container,
.contact-container,
.checkout-wrap {
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

.top-nav .container,
.footer .container {
  padding-left: 28px !important;
  padding-right: 28px !important;
}

.mfx-hero,
.mfx-block,
.about-hero,
.about-section,
.about-cta,
.contact-hero,
.contact-form-section {
  border-radius: 0 !important;
}

.demo-shell {
  max-width: none !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

.mfx-hero-copy p,
.about-hero-sub,
.contact-hero-copy p,
.footer-brand p {
  max-width: none !important;
}

body.app-shell .dashboard .main,
.dashboard .main {
  width: 100%;
  max-width: none !important;
}

#moduleSection,
body[data-page-title="Subscriptions"] #moduleSection,
body[data-page-title="Integrations"] #integrationModal.integration-editor,
body[data-layout-module="create-agent"] #moduleSection {
  width: 100% !important;
  max-width: none !important;
}

@media (max-width: 760px) {
  .top-nav .container,
  .footer .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

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

html body [class][class],
html body [class][class]::before,
html body [class][class]::after,
html body [class][class] *,
html body [class][class] *::before,
html body [class][class] *::after {
  border-radius: 0 !important;
}
