/* ============================================================
   Connecfy — light SaaS design system
   Palette: white/soft-gray surfaces, brand blue accent (from logo), mono for data
   ============================================================ */

:root{
  --bg:        #FFFFFF;
  --bg-soft:   #F6F7F9;
  --surface:   #FFFFFF;
  --surface-2: #F1F3F5;
  --border:    #E5E8EB;
  --text:      #15191E;
  --text-dim:  #5B6470;
  --text-faint:#94A0AC;
  --accent:    #2563EB;
  --accent-dim:#1D4ED8;
  --accent-bg: rgba(37,99,235,0.10);
  --accent-ink:#FFFFFF;
  --teal:      #2DD4BF;
  --teal-bg:   rgba(45,212,191,0.12);
  --success:   #0EA56B;
  --success-bg:rgba(14,165,107,0.10);
  --warn:      #B45309;
  --warn-bg:   rgba(217,119,6,0.10);
  --danger:    #DC2626;
  --danger-bg: rgba(220,38,38,0.08);
  --radius:    10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.04);
  --shadow-md: 0 4px 14px rgba(16,24,40,0.07);
  --shadow-lg: 0 16px 36px rgba(16,24,40,0.10);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration: underline; }
h1,h2,h3{ font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
code, .mono{ font-family: var(--font-mono); }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell layout ---------- */
.shell{ display:flex; min-height:100vh; }
.sidebar{
  width: 220px; flex-shrink:0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display:flex; flex-direction:column;
  padding: 20px 14px;
  position: sticky; top:0; height:100vh;
}
.brand{ display:flex; align-items:center; gap:10px; padding: 4px 8px 24px; }
.brand-logo{ height:30px; width:auto; display:block; }
.brand-mark{ width:28px; height:28px; flex-shrink:0; }
.brand-name{ font-family: var(--font-display); font-weight:700; font-size:16px; letter-spacing:-0.01em; }
.nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav a{
  color: var(--text-dim); text-decoration:none;
  padding: 9px 12px; border-radius: 8px; font-size:14px; font-weight:500;
  display:flex; align-items:center; gap:10px;
}
.nav a:hover{ background: var(--surface-2); color: var(--text); }
.nav a.active{ background: var(--accent-bg); color: var(--accent); }
.nav-icon{ width:16px; height:16px; flex-shrink:0; opacity:0.85; }
.sidebar-foot{ padding: 8px; font-size:12px; color: var(--text-faint); }
.sidebar-foot .user-email{ color: var(--text-dim); display:block; margin-bottom:6px; font-family: var(--font-mono); font-size:11px; word-break:break-all; }

.main{ flex:1; min-width:0; padding: 28px 36px 60px; max-width: 1200px; }
.page-head{ display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-bottom: 24px; flex-wrap:wrap; }
.page-head p{ color: var(--text-dim); margin: 2px 0 0; font-size: 14px; }

/* ---------- Auth screens (no sidebar) ---------- */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding: 24px; background: var(--bg-soft); }
.auth-card{ width: 100%; max-width: 380px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md); }
.auth-card .brand{ padding: 0 0 22px; justify-content:center; }
.auth-card h1{ font-size:18px; text-align:center; margin-bottom: 22px; }
.auth-foot{ text-align:center; margin-top:16px; font-size:13px; color: var(--text-dim); }

/* ---------- Cards / grid ---------- */
.card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.grid{ display:grid; gap:16px; }
.grid-stats{ grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); margin-bottom: 24px; }
.stat-card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-label{ font-size:12px; color: var(--text-faint); text-transform:uppercase; letter-spacing:.06em; margin-bottom:8px; }
.stat-value{ font-family: var(--font-display); font-size: 30px; font-weight:700; line-height:1; }
.stat-value.accent{ color: var(--accent); }
.stat-value.warn{ color: var(--warn); }
.stat-sub{ font-size:12px; color: var(--text-faint); margin-top:6px; }

/* ---------- Signal-bars status mark ---------- */
.signal{ display:inline-flex; align-items:flex-end; gap:2px; height:14px; width:16px; flex-shrink:0; }
.signal i{ display:block; width:3px; background: var(--text-faint); border-radius:1px; }
.signal i:nth-child(1){ height:30%; } .signal i:nth-child(2){ height:55%; }
.signal i:nth-child(3){ height:78%; } .signal i:nth-child(4){ height:100%; }
.signal.online i{ background: var(--success); animation: pulse 1.8s ease-in-out infinite; }
.signal.online i:nth-child(2){ animation-delay:.15s; }
.signal.online i:nth-child(3){ animation-delay:.3s; }
.signal.online i:nth-child(4){ animation-delay:.45s; }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.35; } }
@media (prefers-reduced-motion: reduce){ .signal.online i{ animation:none; } }

.status-pill{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding: 4px 10px; border-radius: 999px; }
.status-pill.online{ background: var(--success-bg); color: var(--success); }
.status-pill.offline{ background: var(--surface-2); color: var(--text-faint); }
.status-pill.queued{ background: var(--surface-2); color: var(--text-dim); }
.status-pill.sending{ background: var(--warn-bg); color: var(--warn); }
.status-pill.sent, .status-pill.delivered{ background: var(--success-bg); color: var(--success); }
.status-pill.failed{ background: var(--danger-bg); color: var(--danger); }

/* ---------- Tables ---------- */
table.data{ width:100%; border-collapse: collapse; font-size:14px; }
table.data th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-faint); font-weight:600; padding: 0 12px 10px; border-bottom:1px solid var(--border); }
table.data td{ padding: 12px 12px; border-bottom:1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td{ border-bottom:none; }
table.data td.num, table.data td.mono{ font-family: var(--font-mono); font-size:13px; color: var(--text-dim); }

/* ---------- Forms ---------- */
label{ display:block; font-size:13px; font-weight:600; color: var(--text-dim); margin-bottom:6px; }
input, select, textarea{
  width:100%; background: var(--surface-2); border:1px solid var(--border); color: var(--text);
  border-radius:8px; padding:10px 12px; font-size:14px; font-family: var(--font-body);
}
input[type="radio"], input[type="checkbox"]{
  width:auto; padding:0; margin-top:3px; accent-color: var(--accent); flex-shrink:0;
}
textarea{ resize: vertical; min-height: 110px; font-family: var(--font-mono); }
input:focus, select:focus, textarea:focus{ outline:none; border-color: var(--accent); }
.field{ margin-bottom:16px; }
.field-row{ display:flex; gap:14px; flex-wrap:wrap; }
.field-row > .field{ flex:1; min-width:180px; }
.help{ font-size:12px; color: var(--text-faint); margin-top:5px; }
.char-count{ font-size:12px; color: var(--text-faint); text-align:right; margin-top:4px; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  font-family: var(--font-body); font-weight:600; font-size:14px; cursor:pointer;
  border-radius:8px; padding:10px 18px; border:1px solid transparent;
  background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn:hover{ border-color: var(--text-faint); }
.btn.primary{ background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover{ background: #4EE595; }
.btn.danger{ background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover{ background: var(--danger-bg); }
.btn.full{ width:100%; }
.btn.sm{ padding:6px 12px; font-size:13px; }

/* ---------- Misc ---------- */
.empty{ text-align:center; padding: 50px 20px; color: var(--text-faint); }
.empty .empty-icon{ margin-bottom:14px; opacity:.5; }
.muted{ color: var(--text-faint); }
.divider{ border:none; border-top:1px solid var(--border); margin: 20px 0; }
.flash{ padding:12px 16px; border-radius:8px; margin-bottom:18px; font-size:14px; }
.flash.success{ background: var(--success-bg); color: var(--success); }
.flash.error{ background: var(--danger-bg); color: var(--danger); }
.code-box{ font-family: var(--font-mono); background: var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:14px; font-size:14px; text-align:center; letter-spacing:.05em; word-break:break-all; }
.qr-box{ display:flex; justify-content:center; padding: 18px; background:#fff; border-radius: var(--radius); }
.qr-box img{ width:200px; height:200px; image-rendering:pixelated; }
.copy-btn{ cursor:pointer; }

.pagination{ display:flex; gap:6px; margin-top:18px; justify-content:flex-end; }
.pagination a, .pagination span{ padding:6px 11px; border-radius:6px; font-size:13px; border:1px solid var(--border); color: var(--text-dim); }
.pagination .current{ background: var(--surface-2); color: var(--text); }

@media (max-width: 780px){
  .shell{ flex-direction:column; }
  .sidebar{ position:static; width:100%; height:auto; flex-direction:row; align-items:center; padding:12px 16px; overflow-x:auto; }
  .sidebar .brand{ padding:0 12px 0 0; }
  .nav{ flex-direction:row; }
  .sidebar-foot{ display:none; }
  .main{ padding: 20px; }
}

/* ============================================================
   Marketing / public pages (landing, pricing, docs)
   ============================================================ */
.pub-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 40px; border-bottom:1px solid var(--border);
  position:sticky; top:0; background: rgba(255,255,255,0.88); backdrop-filter: blur(8px); box-shadow: var(--shadow-sm); z-index:50;
}
.pub-nav{ display:flex; align-items:center; gap:28px; }
.pub-nav a{ color: var(--text-dim); font-size:14px; font-weight:500; text-decoration:none; }
.pub-nav a:hover{ color: var(--text); }
.pub-actions{ display:flex; align-items:center; gap:12px; }

.lang-switch{ display:flex; gap:2px; background: var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:2px; }
.lang-switch button{
  background:none; border:none; color: var(--text-faint); font-size:12px; font-weight:600;
  padding:5px 9px; border-radius:6px; cursor:pointer; font-family: var(--font-body);
}
.lang-switch button.active{ background: var(--surface); color: var(--accent); }

.hero{ padding: 90px 40px 60px; max-width: 980px; margin: 0 auto; text-align:center; }
.hero .eyebrow{
  display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:600; color: var(--accent);
  background: var(--accent-bg); padding:6px 14px; border-radius:999px; margin-bottom:22px;
}
.hero h1{ font-size: 52px; line-height:1.08; margin-bottom:18px; }
.hero h1 .accent-text{ color: var(--accent); }
.hero p.lead{ font-size:18px; color: var(--text-dim); max-width:620px; margin:0 auto 32px; line-height:1.55; }
.hero-actions{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.btn.lg{ padding:14px 26px; font-size:15.5px; border-radius:10px; }

.section{ padding: 70px 40px; max-width: 1180px; margin:0 auto; }
.section-alt{ background: var(--bg-soft); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.section-head{ text-align:center; max-width:640px; margin: 0 auto 48px; }
.section-head h2{ font-size:34px; margin-bottom:12px; }
.section-head p{ color: var(--text-dim); font-size:15.5px; }

.split{ display:grid; grid-template-columns: 1fr 1fr; gap:24px; }
.split-card{
  background: var(--surface); border:1px solid var(--border); border-radius:16px; padding:32px;
  display:flex; flex-direction:column; gap:16px;
}
.split-card .icon-badge{
  width:46px; height:46px; border-radius:12px; background: var(--accent-bg); color: var(--accent);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.split-card h3{ font-size:21px; }
.split-card p{ color: var(--text-dim); font-size:14.5px; line-height:1.55; margin:0; }
.split-card ul{ list-style:none; padding:0; margin:6px 0 0; display:flex; flex-direction:column; gap:9px; }
.split-card li{ font-size:14px; color: var(--text-dim); display:flex; gap:8px; align-items:flex-start; }
.split-card li::before{ content:"✓"; color: var(--accent); font-weight:700; flex-shrink:0; }

.feature-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:20px; }
.feature-card{ background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:24px; box-shadow: var(--shadow-sm); }
.feature-card .icon-badge{ width:36px; height:36px; border-radius:10px; background: var(--accent-bg); color: var(--accent); display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.feature-card h4{ font-size:16px; margin-bottom:6px; }
.feature-card p{ font-size:13.5px; color: var(--text-faint); margin:0; line-height:1.5; }

.cta-band{
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border:1px solid var(--border); border-radius:20px; padding:56px 40px; text-align:center; margin: 70px auto; max-width:1180px;
}
.cta-band h2{ font-size:30px; margin-bottom:10px; }
.cta-band p{ color: var(--text-dim); margin-bottom:26px; }

.pub-footer{ border-top:1px solid var(--border); padding: 48px 40px 0; background: var(--bg-soft); }
.pub-footer a{ color: var(--text-dim); text-decoration:none; }
.pub-footer a:hover{ color: var(--accent); text-decoration:underline; }
.footer-contact{ display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap:32px; max-width:1180px; margin:0 auto; padding-bottom:32px; }
.footer-contact-brand p{ color: var(--text-faint); font-size:13.5px; max-width:260px; }
.footer-contact-block h4{ font-size:13px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-faint); margin-bottom:12px; }
.footer-contact-block p{ margin:0 0 8px; font-size:14px; }
.pub-footer-bottom{ border-top:1px solid var(--border); padding:18px 40px; text-align:center; color: var(--text-faint); font-size:12.5px; }
@media (max-width: 700px){
  .footer-contact{ grid-template-columns:1fr; gap:24px; }
}

/* ---------- Pricing ---------- */
.billing-toggle{ display:inline-flex; align-items:center; gap:14px; margin: 0 auto 44px; background: var(--surface); border:1px solid var(--border); border-radius:999px; padding:6px; }
.billing-toggle button{
  background:none; border:none; color: var(--text-dim); font-size:14px; font-weight:600; padding:9px 20px;
  border-radius:999px; cursor:pointer; font-family: var(--font-body); display:flex; align-items:center; gap:7px;
}
.billing-toggle button.active{ background: var(--accent); color: var(--accent-ink); }
.billing-toggle .save-badge{ background: var(--accent-bg); color: var(--accent); font-size:11px; font-weight:700; padding:2px 7px; border-radius:999px; }
.billing-toggle button.active .save-badge{ background: rgba(255,255,255,0.25); color: var(--accent-ink); }

.kind-toggle{ display:flex; justify-content:center; gap:10px; margin-bottom:36px; }
.kind-toggle button{ background: var(--surface); border:1px solid var(--border); color: var(--text-dim); font-weight:600; font-size:14px; padding:10px 18px; border-radius:10px; cursor:pointer; font-family:var(--font-body); }
.kind-toggle button.active{ border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.pricing-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:20px; max-width:1000px; margin:0 auto; }
.price-card{ background: var(--surface); border:1px solid var(--border); border-radius:16px; padding:30px; display:flex; flex-direction:column; box-shadow: var(--shadow-sm); }
.price-card.featured{ border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); position:relative; }
.price-card.featured::before{ content:"Most popular"; position:absolute; top:-12px; left:50%; transform:translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size:11px; font-weight:700; padding:4px 12px; border-radius:999px; }
.price-card h3{ font-size:19px; margin-bottom:4px; }
.price-card .tagline{ font-size:13px; color: var(--text-faint); margin-bottom:20px; min-height:18px; }
.price-card .price{ font-family: var(--font-display); font-size:38px; font-weight:700; margin-bottom:2px; }
.price-card .price small{ font-size:14px; color: var(--text-faint); font-weight:500; font-family: var(--font-body); }
.price-card .price-period{ font-size:12.5px; color: var(--text-faint); margin-bottom:22px; }
.price-card ul{ list-style:none; padding:0; margin:0 0 24px; display:flex; flex-direction:column; gap:10px; flex:1; }
.price-card li{ font-size:13.5px; color: var(--text-dim); display:flex; gap:8px; }
.price-card li::before{ content:"✓"; color: var(--accent); font-weight:700; }

/* ---------- Staff console ---------- */
.staff-badge{ display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color: var(--warn); background: var(--warn-bg); padding:4px 10px; border-radius:6px; }
.client-card{ display:flex; align-items:center; justify-content:space-between; padding:16px 18px; }
.client-card .client-email{ font-weight:600; }
.client-card .client-meta{ font-size:12.5px; color: var(--text-faint); margin-top:2px; }

/* ---------- Docs ---------- */
.docs-layout{ display:grid; grid-template-columns: 220px 1fr; gap:40px; align-items:start; }
.docs-toc{ position:sticky; top:90px; display:flex; flex-direction:column; gap:4px; }
.docs-toc a{ font-size:13.5px; color: var(--text-dim); padding:6px 10px; border-radius:6px; }
.docs-toc a:hover{ background: var(--surface); color: var(--text); }
.docs-endpoint{ display:flex; align-items:center; gap:10px; margin: 36px 0 10px; }
.http-verb{ font-family: var(--font-mono); font-size:12px; font-weight:700; padding:3px 9px; border-radius:6px; }
.http-verb.get{ background: var(--accent-bg); color: var(--accent); }
.http-verb.post{ background: var(--warn-bg); color: var(--warn); }
.docs-path{ font-family: var(--font-mono); font-size:14.5px; }
pre.code-block{ background: var(--surface-2); border:1px solid var(--border); border-radius:10px; padding:16px; font-family: var(--font-mono); font-size:12.5px; overflow-x:auto; line-height:1.6; }

@media (max-width: 900px){
  .hero h1{ font-size:36px; }
  .split{ grid-template-columns:1fr; }
  .docs-layout{ grid-template-columns:1fr; }
  .docs-toc{ position:static; flex-direction:row; flex-wrap:wrap; }
  .pub-header{ padding:14px 18px; }
  .pub-nav{ display:none; }
  .section{ padding:50px 20px; }
}

