/*
 * Brevli marketing styles
 * Based on docs/ui_spec.md
 */
:root {
  --color-primary: #316cff;
  --color-primary-light: #7aa9ff;
  --color-secondary: #d6e4ff;
  --color-accent: #ff7a59;
  --color-graphite: #1f1f1f;
  --color-slate: #6b7280;
  --color-mist: #f3f4f6;
  --color-success: #27c499;
  --color-warning: #fbbf24;
  --color-error: #ef4444;
  --radius-card: 16px;
  --shadow-card: 0 6px 18px rgba(31, 31, 31, 0.08);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-graphite);
  background: #fff;
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 40%);
}

.container {
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  z-index: 10;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--color-slate);
  font-weight: 500;
}

.nav-links a.active {
  color: var(--color-primary);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--color-primary), var(--color-primary-light));
  color: white;
  box-shadow: 0 10px 20px rgba(49, 108, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(31, 31, 31, 0.2);
  color: var(--color-graphite);
}

.hero {
  padding: 80px 0 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin: 0 0 20px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-slate);
  margin-bottom: 24px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  background: var(--color-secondary);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(30px);
}

.hero-visual img {
  border-radius: 16px;
  filter: blur(6px);
}

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-slate);
  margin-bottom: 40px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: white;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(31, 31, 31, 0.08);
  padding: 24px;
}

.card h3 {
  margin-top: 0;
}

.testimonial-card {
  background: var(--color-mist);
}

.footer {
  margin-top: auto;
  padding: 60px 0 40px;
  background: #0f172a;
  color: #cbd5f5;
}

.footer a {
  color: #e0e7ff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.footer-bottom {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .navbar-inner {
    flex-direction: column;
    gap: 16px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero {
    padding-top: 60px;
  }
  .hero-cta {
    justify-content: center;
  }
}

/* Dashboard */
.dashboard-body {
  background: #f8fafc;
  font-family: var(--font-family);
  margin: 0;
}
.dashboard-shell {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.dashboard-shell .row {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.dashboard-shell button,
.dashboard-shell select {
  padding:8px 10px;
  font-size:14px;
  border-radius:8px;
  border:1px solid #d1d5db;
}
.dashboard-shell select {
  background:#fff;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.dashboard-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  padding: 24px;
  margin-bottom: 20px;
}
.dashboard-section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
}
.dashboard-pill {
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:500;
}
.dashboard-pill.ok { background:#ecfdf5; color:#065f46; }
.dashboard-pill.bad { background:#fef2f2; color:#991b1b; }
.dashboard-grid {
  display:grid;
  gap:20px;
}
.dashboard-grid.two {
  grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
}
.dashboard-card h3 {
  margin-top:0;
}
.dashboard-select,
.dashboard-select select,
.dashboard-select button {
  width:100%;
}
.dashboard-select select {
  padding:10px;
  border-radius:8px;
  border:1px solid #d1d5db;
}
.dashboard-select button {
  margin-top:12px;
  border-radius:8px;
}
.dashboard-chart-meta {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.dashboard-chart-meta span {
  color:var(--color-slate);
}
.dashboard-error {
  color:#b91c1c;
  font-size:0.9rem;
  margin-top:8px;
}
.spacer {height:12px;}
.muted {color:#6b7280;font-size:12px;}
.dashboard-calendar-list,
.dashboard-gmail-list {
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.dashboard-calendar-list li,
.dashboard-gmail-list li {
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  background:#fff;
}
.dashboard-tabs {
  display:flex;
  gap:12px;
  margin-bottom:24px;
  overflow-x:auto;
}
.dashboard-tabs a {
  border:none;
  background:transparent;
  padding:10px 18px;
  border-radius:999px;
  font-weight:600;
  color:var(--color-slate);
  cursor:pointer;
  text-decoration:none;
  transition:background 0.2s, color 0.2s;
}
.dashboard-tabs .tab-count {
  margin-left:8px;
  font-size:0.8rem;
  color:var(--color-primary);
  font-weight:600;
}
.dashboard-tabs a:hover {
  background:rgba(15,23,42,0.05);
}
.dashboard-tabs a.active {
  background:rgba(49,108,255,0.15);
  color:var(--color-primary);
}
.dashboard-section {
  margin-bottom:24px;
}
.dashboard-section.hidden {
  display:none;
}
.dashboard-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.dashboard-brand {
  display:flex;
  gap:16px;
  align-items:center;
}
.dashboard-logo {
  display:flex;
  gap:8px;
  align-items:center;
  text-decoration:none;
  color:inherit;
  font-weight:600;
}
.logo-mark {
  width:40px;
  height:40px;
  border-radius:14px;
  background:linear-gradient(135deg,#316cff,#7aa9ff);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:1rem;
}
.logo-type {
  font-size:1.15rem;
  text-transform:lowercase;
  letter-spacing:0.04em;
}
.dashboard-title {
  margin:0;
  font-size:1.5rem;
}
.btn-sm {
  padding:8px 16px;
  font-size:0.85rem;
}
.dashboard-card-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}
.dashboard-action-row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}
.dashboard-action-stack {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.revenue-metrics {
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
  gap:16px;
}
.revenue-metrics .label {
  text-transform:uppercase;
  font-size:0.7rem;
  letter-spacing:0.08em;
  color:#6b7280;
}
.metric-large {
  font-size:1.3rem;
  font-weight:600;
}
.briefing-snippet {
  min-height:96px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
  background:#f9fafb;
  font-size:0.9rem;
  margin-bottom:16px;
}
.briefing-meta {
  list-style:none;
  margin:0 0 16px;
  padding:0;
  display:flex;
  gap:24px;
  flex-wrap:wrap;
}
.briefing-meta li {
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:0.9rem;
}
.briefing-meta .label {
  text-transform:uppercase;
  letter-spacing:0.08em;
  font-size:0.7rem;
}
.channel-tag {
  margin-left:6px;
  font-size:0.85rem;
}
.small-link {
  font-size:0.85rem;
  text-decoration:none;
  color:var(--color-primary);
}
.connection-card .dashboard-select select {
  width:100%;
}
.connection-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:16px;
}
.connection-inline-actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.integrations-checklist {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.integrations-checklist li {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:12px;
}
.check-icon {
  width:16px;
  height:16px;
  border-radius:50%;
  display:inline-block;
  margin-right:8px;
}
.check-icon.ok {
  background:#10b981;
}
.check-icon.pending {
  background:#fcd34d;
}
.connection-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.connection-meta {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:8px;
  font-size:0.85rem;
  color:#4b5563;
}
.connection-meta div {
  min-width:140px;
}
.crm-columns {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-top:8px;
}
.crm-column {
  flex:1 1 240px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  background:#f9fafb;
}
.crm-column-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  font-size:0.9rem;
  color:#111827;
}
.crm-column ul {
  margin:0;
  padding-left:18px;
}
.crm-column .btn-sm {
  margin-top:6px;
}
.helper-text {
  font-size:0.85rem;
  color:#6b7280;
  margin:6px 0 0;
}
.connection-group {
  margin-bottom:24px;
}
.connection-group-title {
  margin:0 0 12px;
  font-size:1rem;
  color:#374151;
}
.setup-card {
  padding:18px;
}
.setup-card-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
  cursor:pointer;
}
.setup-progress {
  font-weight:600;
  color:var(--color-primary);
  font-size:0.9rem;
}
.setup-head-actions {
  display:flex;
  align-items:center;
  gap:8px;
}
.collapse-icon {
  width:16px;
  height:16px;
  border:1px solid #d1d5db;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  color:#6b7280;
}
.setup-missing {
  list-style:none;
  padding:0;
  margin:12px 0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.setup-missing li {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid #e5e7eb;
}
.setup-missing li:last-child {
  border-bottom:none;
}
.setup-missing strong {
  display:block;
  font-size:0.95rem;
}
.setup-connect-link {
  font-weight:600;
  color:var(--color-primary);
}
.setup-all-good {
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:500;
  color:#065f46;
  margin-bottom:12px;
}
.setup-card.collapsed .setup-card-body {
  display:none;
}
.sync-label {
  font-size:0.8rem;
  color:#6b7280;
  margin-top:4px;
}
.sync-warning {
  font-size:0.75rem;
  color:#b45309;
  margin-top:2px;
}
.sync-warning[hidden] {
  display:none !important;
}
.dashboard-shell .sync-btn {
  border:none;
  background:transparent;
  border-radius:50%;
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  margin-left:8px;
  background-image:url('/assets/img/sync-button.png');
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
}
.dashboard-shell .sync-btn:disabled {
  opacity:0.5;
  cursor:not-allowed;
}
.dashboard-shell .sync-btn.spinning {
  animation:spin 1s linear infinite;
}
@keyframes spin {
  from { transform:rotate(0deg); }
  to { transform:rotate(360deg); }
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}
.dashboard-footer {
  margin-top:32px;
  padding:24px 0;
  border-top:1px solid #e5e7eb;
}
.dashboard-footer-inner {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}
.dashboard-footer-links {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  align-items:center;
  font-size:0.9rem;
}
.dashboard-footer-links a {
  color:var(--color-primary);
  text-decoration:none;
}
.dashboard-toast {
  position:relative;
  margin-bottom:16px;
  padding:10px 14px;
  border-radius:10px;
  background:#f1f5f9;
  color:#0f172a;
  font-size:0.9rem;
  display:none;
}
.dashboard-toast.show {
  display:block;
}
.dashboard-toast.success {
  background:#ecfdf5;
  color:#065f46;
}
.dashboard-toast.error {
  background:#fef2f2;
  color:#991b1b;
}
.table-wrapper {
  width:100%;
  overflow-x:auto;
}
.history-table {
  width:100%;
  border-collapse:collapse;
}
.history-table th,
.history-table td {
  padding:10px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
  font-size:0.9rem;
}
.history-table th {
  text-transform:uppercase;
  font-size:0.75rem;
  letter-spacing:0.08em;
  color:#6b7280;
}
.modal-backdrop {
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.5);
  backdrop-filter:blur(2px);
  opacity:0;
  pointer-events:none;
  transition:opacity 0.2s;
  z-index:1000;
}
.modal-backdrop.show {
  opacity:1;
  pointer-events:auto;
}
.dashboard-modal {
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:1001;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.2s;
}
.dashboard-modal.show {
  opacity:1;
  pointer-events:auto;
}
.dashboard-modal .modal-card {
  background:#fff;
  border-radius:16px;
  max-width:420px;
  width:100%;
  box-shadow:0 25px 50px rgba(15,23,42,0.2);
  padding:24px;
  position:relative;
}
.modal-card h3 {
  margin:0 0 8px;
}
.modal-card p {
  margin:0 0 16px;
  color:#475569;
}
.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.modal-close {
  position:absolute;
  top:12px;
  right:12px;
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:1.2rem;
  color:#94a3b8;
}
