/* AbbaAI shared stylesheet. Mobile first, professional SaaS aesthetic. */

:root {
  /* Clean, light SaaS chrome made crisp and confident. White and light grey
     only, with a deep, saturated cyan accent. No dark chrome, no gradients. */
  --bg: #F4F6F8;            /* app background, light grey for separation */
  --bg-soft: #eceff3;
  --surface: #ffffff;       /* cards, header, footer */
  --surface-2: #F4F6F8;     /* light grey panels against white */
  --ink: #14151A;           /* strong near-black body and heading text */
  --ink-soft: #3b4252;      /* secondary text */
  --muted: #667085;         /* muted grey text */
  --line: #dfe3ea;          /* hairline borders, a touch stronger */
  /* Deep cyan accent for buttons, links, active steps, focus rings, highlights. */
  --accent: #06B6D4;
  --accent-strong: #0596b0; /* hover / pressed */
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-2: #06B6D4;
  --accent-ink: #0A0A0F;    /* dark text on cyan for contrast */
  /* Aliases kept so existing rules pick up the cyan accent (no gradients). */
  --brand: #06B6D4;
  --brand-2: #06B6D4;
  --brand-ink: #0A0A0F;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.06), 0 1px 3px rgba(20, 21, 26, 0.06);
  --shadow: 0 6px 20px rgba(20, 21, 26, 0.08);
  --shadow-lg: 0 18px 44px rgba(20, 21, 26, 0.14);
  --maxw: 1080px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1rem; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* Light top bar (landing page): white background needs the dark "Abba" logo. */
.topbar--light {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.topbar__nav { display: flex; gap: 10px; align-items: center; }

.brandmark {
  display: inline-flex;
  align-items: center;
}
.brandmark:hover { text-decoration: none; }
.brandmark__img { display: block; height: 30px; width: auto; }

/* "powered by AbbaAI" co-branding lockup on the tenant dashboard. */
.powered-by {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 8px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.powered-by img { display: block; height: 14px; width: auto; opacity: 0.95; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(20,21,26,0.04);
}
.btn--primary:hover { background: var(--accent-strong); box-shadow: var(--shadow); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 24px; font-size: 1.05rem; }
.btn--sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Cards / panels. These are light surfaces, so text inside them is dark. */
.card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.panel {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 20px;
}
/* Inside light surfaces, muted text and links use the dark-friendly tones. */
.card .muted, .panel .muted, .table .muted { color: var(--muted); }
.card a:not(.btn), .panel a:not(.btn) { color: var(--accent-2); }

.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Forms */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.field .hint { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.20);
}
.textarea { min-height: 96px; resize: vertical; }
.row-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* Colour picker rows */
.colourfield { display: flex; align-items: center; gap: 10px; }
.colourfield input[type=color] {
  width: 46px; height: 46px; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; background: none; cursor: pointer; flex: 0 0 auto;
}
.colourfield .input { flex: 1; }

/* Steps */
.steps {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 26px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.steps__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 4px;
}
.steps__num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: 0 0 auto;
}
.steps__item--active { color: var(--ink); }
.steps__item--active .steps__num {
  background: var(--accent);
  color: var(--accent-ink); border-color: transparent;
}
.steps__item--done { color: var(--ink-soft); }
.steps__item--done .steps__num { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
@media (max-width: 560px) {
  .steps__label { display: none; }
}

/* Hero / marketing */
.hero {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 84px 0 96px;
}
.hero h1 { color: var(--ink); max-width: 18ch; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 56ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  background: rgba(6, 182, 212, 0.10);
  border: 1px solid rgba(6, 182, 212, 0.28);
  padding: 6px 12px; border-radius: 999px;
  margin-bottom: 18px;
}
.hero .row-actions { margin-top: 26px; }

.features { padding: 64px 0; }
.feature h3 { margin-bottom: 6px; }
.feature .ico {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid var(--line);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

/* Centred auth / flow shell */
.shell { flex: 1; padding: 36px 0 64px; }
.shell--narrow { max-width: 720px; }
.flow-head { margin-bottom: 22px; }
.flow-head .kicker { color: var(--brand); font-weight: 700; font-size: 0.85rem; letter-spacing: .04em; text-transform: uppercase; }

/* Alerts */
.alert { border-radius: 12px; padding: 12px 14px; font-size: 0.92rem; margin-bottom: 18px; border: 1px solid; }
.alert--info { background: #ecfdff; border-color: #b6ecf5; color: #075362; }
.alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert--success { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }

/* Loading / thinking state */
.thinking { text-align: center; padding: 48px 10px; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--brand);
  margin: 0 auto 20px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.thinking__lines { color: var(--muted); min-height: 1.5em; }

/* Swatches */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.swatch .dot { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); }

/* Connect list */
.connect-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.connect-row + .connect-row { margin-top: 12px; }
.connect-row .meta { display: flex; align-items: center; gap: 12px; }
.platform-ico {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 0.95rem;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
}
.badge--pending { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.badge--connected { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.badge--sample { background: #ecfdff; color: #075362; border-color: #b6ecf5; }
.badge--ok { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }

/* Post / sample card */
.post-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.post-card__media {
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 22px; color: var(--accent-ink);
  background: var(--accent);
}
.post-card__body { padding: 18px; }
.post-card__caption { white-space: pre-wrap; }

/* Dashboard */
.dash-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-logo {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--brand);
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; white-space: pre-wrap; }

.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-clean li:last-child { border-bottom: 0; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Logo strip on the dashboard and chips in the manager */
.logo-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.logo-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; }
.logo-chip img {
  width: 96px; height: 72px; object-fit: contain; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px;
}
.logo-chip span { font-size: 0.75rem; color: var(--muted); text-align: center; }
.logo-chip__img {
  width: 54px; height: 54px; object-fit: contain; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 4px;
}

/* Pin reveal */
.pin-box {
  display: inline-flex; gap: 8px; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.3em;
  background: #ecfdff; color: var(--ink); border: 1px solid #b6ecf5;
  padding: 14px 22px; border-radius: 14px;
}
.copy-field {
  display: flex; gap: 8px; align-items: center;
}
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Table (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.table a { color: var(--accent-2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 22px 0; background: var(--surface); margin-top: auto; color: var(--ink); }
.footer .container { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; flex-wrap: wrap; align-items: center; }
.footer .muted { color: var(--muted); }
.footer__logo { display: block; height: 20px; width: auto; }

/* Utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap-12 { gap: 12px; } .wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
