/* ============================================================================
   FronzaChat — Modern SaaS Design System
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core Brand Colors */
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-light: #eef2ff;
  --brand-muted: #e0e7ff;
  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
  --brand-glow: rgba(99, 102, 241, 0.25);

  /* Neutrals & Slate */
  --ink: #0f172a;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --muted: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  /* State Colors */
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  --err: #e11d48;
  --err-bg: #fff1f2;
  --err-border: #fecdd3;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;

  /* Radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 10px 30px -10px var(--brand-glow);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-hover);
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Topbar Header */
header.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.2s ease;
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

nav.links {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav.links a:not(.btn) {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 14.5px;
  transition: all 0.15s ease;
}

nav.links a:not(.btn):hover {
  color: var(--brand);
  background: var(--brand-light);
  text-decoration: none;
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-gradient);
  color: #ffffff !important;
  padding: 11px 22px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 14px 0 var(--brand-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.38);
  opacity: 0.95;
  color: #ffffff !important;
  background: var(--brand-gradient) !important;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn.ghost {
  background: #ffffff;
  color: var(--slate-800) !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn.ghost:hover {
  background: #f8fafc;
  border-color: var(--slate-300);
  color: var(--brand) !important;
  box-shadow: var(--shadow);
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn.danger:hover {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn.gray {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-700) !important;
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.gray:hover {
  background: var(--line);
  color: var(--slate-900) !important;
}

/* Landing Page Styles */
.hero {
  position: relative;
  padding: 88px 0 72px;
  text-align: center;
  background: radial-gradient(100% 70% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(248, 250, 252, 0) 100%), var(--bg);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  margin-bottom: 24px;
}

.pill-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.hero h1 {
  font-size: 52px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 22px;
  color: var(--slate-900);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 50%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Feature Highlights Strip */
.proof-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 48px;
  margin-top: 48px;
  border-top: 1px dashed var(--line);
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-600);
}

.proof-item svg, .proof-item .icon {
  color: var(--brand);
}

/* Section Headings */
section {
  padding: 72px 0;
  position: relative;
}

h2.sec {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
  color: var(--slate-900);
  margin: 0 0 10px;
}

p.sec-sub {
  text-align: center;
  color: var(--muted);
  font-size: 17px;
  max-width: 580px;
  margin: 0 auto 44px;
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-md);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 22px;
  margin-bottom: 18px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.card p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* Steps Cards */
.steps .step-num {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px var(--brand-glow);
}

/* Pricing Section */
.price-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line);
}

.price-card.featured {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}

.price-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px var(--brand-glow);
}

.price-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0 0 12px;
}

.price-card .amount {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--slate-900);
  margin: 4px 0 16px;
}

.price-card .amount span {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.price-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--slate-700);
  text-align: left;
}

.price-card li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Auth Cards */
.auth-box {
  max-width: 460px;
  margin: 64px auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.auth-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
}

.auth-box h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--slate-900);
}

.auth-box p.sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
}

/* Forms & Inputs */
label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--slate-800);
  margin: 16px 0 6px;
}

input[type=text],
input[type=email],
input[type=password],
input[type=url],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  color: var(--slate-900);
  transition: all 0.15s ease;
  outline: none;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=url]:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type=color] {
  width: 52px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  cursor: pointer;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Flash Messages */
.flash {
  padding: 14px 18px;
  border-radius: 12px;
  margin: 18px 0;
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flash-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.flash-error {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err-border);
}

/* Dashboard Layout */
.dash {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 32px 0 80px;
  align-items: start;
}

.side {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky;
  top: 92px;
  box-shadow: var(--shadow-sm);
}

.tenant-badge {
  padding: 6px 12px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.tenant-badge strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
}

.tenant-badge .badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.side a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 14.5px;
  transition: all 0.15s ease;
  margin-bottom: 3px;
}

.side a:hover {
  background: var(--line-light);
  color: var(--slate-900);
  text-decoration: none;
}

.side a.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.panel h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--slate-900);
}

.panel h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
  color: var(--slate-900);
}

.panel .sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
}

/* Stat Cards */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.stat {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow);
}

.stat .n {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--slate-900);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat .l {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 6px;
}

/* Modern Snippet Container with Copy Button */
.snippet-wrap {
  position: relative;
  margin: 14px 0;
}

code.snippet {
  display: block;
  background: #0f172a;
  color: #f8fafc;
  padding: 16px 20px;
  border-radius: 12px;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #1e293b;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Modern Tables */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 18px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: #ffffff;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: var(--bg);
  color: var(--slate-600);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafbfc;
}

.inline-form {
  display: inline;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.green {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.badge.green::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.badge.red {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err-border);
}

.badge.gray {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-700);
  border: 1px solid var(--line);
}

/* Modern Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
  background: #ffffff;
}

/* Responsive Queries */
@media (max-width: 860px) {
  .hero h1 {
    font-size: 38px;
  }
  .dash {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
  }
  .side nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
