/* aiBridge demo site - single stylesheet, no external assets or fonts. */

:root {
  --ink: #0b1220;
  --ink-2: #1d2942;
  --muted: #5b6b83;
  --line: #e2e8f2;
  --bg: #f5f7fc;
  --card: #ffffff;
  --brand: #2f6df6;
  --brand-dark: #1f4fc4;
  --green: #0f9d76;
  --violet: #a259ff;
  --amber: #b7791f;
  --red: #c0392b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 30, 60, .08);
  --shadow-sm: 0 2px 10px rgba(15, 30, 60, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6rem; color: var(--ink); }
h1 { font-size: 2.35rem; letter-spacing: -.02em; }
h2 { font-size: 1.7rem; letter-spacing: -.01em; margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.wrap { width: min(1120px, 100% - 2.5rem); margin: 0 auto; }
.section { padding: 3.2rem 0; }
.section.tight { padding: 2rem 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mt2 { margin-top: 1.6rem; }

/* ---------------------------------------------------------------- top chrome */
.demo-banner {
  background: #1b2233;
  color: #e8eefc;
  font-size: .86rem;
  padding: .45rem 1.25rem;
  display: flex;
  gap: .6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.demo-banner strong {
  background: #f0b429;
  color: #23180a;
  border-radius: 4px;
  padding: 0 .4rem;
  letter-spacing: .08em;
  font-size: .74rem;
}

.site-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(140deg, var(--brand), #6f9bff);
  color: #fff; font-weight: 700; display: grid; place-items: center; letter-spacing: -.03em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.06rem; }
.brand-text small { color: var(--muted); font-size: .74rem; }
.site-nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-2); padding: .42rem .7rem; border-radius: 9px; font-size: .94rem;
}
.site-nav a:hover { background: #eef3ff; text-decoration: none; }
.site-nav a.on { background: #e7efff; color: var(--brand-dark); font-weight: 600; }
.site-nav a.nav-admin { border: 1px solid var(--line); }

/* ---------------------------------------------------------------- hero */
.hero {
  background:
    radial-gradient(1000px 420px at 12% -10%, rgba(47, 109, 246, .34), transparent 60%),
    radial-gradient(760px 380px at 92% 8%, rgba(162, 89, 255, .26), transparent 62%),
    linear-gradient(160deg, #0b1220, #16203a 60%, #101a30);
  color: #eaf0ff;
  padding: 4rem 0 3.4rem;
}
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lede { font-size: 1.12rem; color: #c3d1ef; max-width: 62ch; }
.hero .eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .16em;
  font-size: .72rem; color: #9db6ea; margin-bottom: .9rem;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr .95fr; gap: 2.2rem; align-items: start; }
.hero-panel {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  backdrop-filter: blur(3px);
}
.hero-panel h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; }
.hero-panel ul { margin: 0; padding-left: 1.1rem; color: #cfdcf7; font-size: .94rem; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.9rem; }
.hero-stats div { font-size: .84rem; color: #a9bde6; }
.hero-stats b { display: block; font-size: 1.5rem; color: #fff; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 10px; padding: .68rem 1.15rem;
  font: inherit; font-weight: 600; cursor: pointer; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #eef3ff; }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-danger { background: #fdeceb; color: #9c2b21; border-color: #f6cdc8; }
.btn-sm { padding: .42rem .7rem; font-size: .86rem; border-radius: 8px; }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: 1.4rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 1.8rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.card h3 { margin-bottom: .35rem; }
.card .price { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; }
.card .price small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.card-accent { border-top: 4px solid var(--brand); }
.pill {
  display: inline-block; background: #eef3ff; color: var(--brand-dark);
  border-radius: 999px; padding: .2rem .65rem; font-size: .76rem; font-weight: 600;
}
.feature-list { list-style: none; margin: .9rem 0 0; padding: 0; }
.feature-list li { padding-left: 1.5rem; position: relative; margin-bottom: .4rem; font-size: .93rem; }
.feature-list li::before {
  content: ""; position: absolute; left: .25rem; top: .55rem;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--green);
}
.tick-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.tick-list li { padding-left: 1.6rem; position: relative; margin-bottom: .5rem; }
.tick-list li::before {
  content: "\2713"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700;
}

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fe; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-block; border-radius: 999px; padding: .16rem .6rem;
  font-size: .76rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.chip.ok { background: #e6f7f1; color: #0a6f53; border-color: #bfe8da; }
.chip.info { background: #e8f0ff; color: #1f4fc4; border-color: #c9daff; }
.chip.warn { background: #fdf5e3; color: #8a5c10; border-color: #f2e0b6; }
.chip.bad { background: #fdeceb; color: #9c2b21; border-color: #f6cdc8; }
.chip.muted { background: #eef1f6; color: #56637a; border-color: #dfe4ee; }

/* ---------------------------------------------------------------- forms */
label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: .62rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c9daff; border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.choice {
  display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--line);
  border-radius: 12px; padding: .8rem .95rem; margin-bottom: .6rem; cursor: pointer; background: #fff;
}
.choice:hover { border-color: #c9daff; }
.choice input { margin-top: .28rem; }
.choice .choice-body { flex: 1; }
.choice .choice-title { font-weight: 600; }
.choice .choice-note { font-size: .84rem; color: var(--muted); }
.choice .choice-price { font-weight: 700; white-space: nowrap; }
.choice.on { border-color: var(--brand); background: #f6f9ff; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }

/* ---------------------------------------------------------------- summary */
.summary { position: sticky; top: 88px; }
.summary table { font-size: .92rem; }
.summary .total-row td { font-size: 1.05rem; font-weight: 700; border-bottom: 0; }
.summary .sub td { color: var(--muted); }

/* ---------------------------------------------------------------- misc */
.flash {
  border-radius: 10px; padding: .75rem 1rem; margin: 1rem 0; font-size: .94rem;
  border: 1px solid var(--line); background: #fff;
}
.flash.ok { background: #e9f8f2; border-color: #bfe8da; color: #0a6f53; }
.flash.err { background: #fdeceb; border-color: #f6cdc8; color: #9c2b21; }
.flash.info { background: #eef3ff; border-color: #c9daff; color: #1f4fc4; }

.callout { border-left: 4px solid var(--brand); background: #f4f8ff; border-radius: 0 10px 10px 0; padding: 1rem 1.2rem; }
.callout.warn { border-left-color: #d9a13b; background: #fdf8ec; }
.callout.small { font-size: .92rem; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: .45rem 1rem; font-size: .94rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.ascii {
  background: #0d1526; color: #c9d8f5; border-radius: var(--radius); padding: 1.2rem;
  overflow-x: auto; font-family: var(--mono); font-size: .8rem; line-height: 1.45; margin: 0;
}
.flow { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.flow li { position: relative; padding-left: 3rem; margin-bottom: 1.1rem; }
.flow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -.15rem;
  width: 2rem; height: 2rem; border-radius: 50%; background: #e7efff; color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.flow li b { display: block; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.stack { display: grid; gap: 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.searchbar input { max-width: 320px; }

/* admin */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 1.6rem; align-items: start; }.admin-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; position: sticky; top: 88px; }
.admin-nav a { display: block; padding: .55rem .7rem; border-radius: 9px; color: var(--ink-2); font-size: .94rem; }
.admin-nav a:hover { background: #eef3ff; text-decoration: none; }
.admin-nav a.on { background: #e7efff; color: var(--brand-dark); font-weight: 600; }
.admin-nav .sep { height: 1px; background: var(--line); margin: .55rem .3rem; }

/* product briefs: switcher strip */
.product-switch {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: .5rem .6rem; margin: 1.4rem 0 0;
}
.product-switch-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 .5rem 0 .3rem;
}
.product-tab {
  padding: .42rem .8rem; border-radius: 9px; font-size: .92rem; color: var(--ink-2);
  border: 1px solid transparent;
}
.product-tab:hover { background: #eef3ff; text-decoration: none; }
.product-tab.on {
  background: color-mix(in srgb, var(--tab-accent) 12%, #fff);
  border-color: color-mix(in srgb, var(--tab-accent) 40%, #fff);
  color: var(--tab-accent); font-weight: 600;
}
.product-tab.all { margin-left: auto; border-color: var(--line); }

/* tabs (server-side, ?tab=...) */
.tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin: 1.2rem 0 1.5rem;
}
.tabs a.tab {
  padding: .55rem .95rem; border: 1px solid transparent; border-bottom: 0;
  border-radius: 10px 10px 0 0; color: var(--ink-2); font-size: .94rem; margin-bottom: -1px;
}
.tabs a.tab:hover { background: #eef3ff; text-decoration: none; }
.tabs a.tab.on {
  background: #fff; border-color: var(--line); color: var(--brand-dark);
  font-weight: 600; border-bottom: 1px solid #fff;
}
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat b { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .84rem; }
.login-card { max-width: 430px; margin: 4rem auto; }

/* footer */
.site-foot { background: #0d1526; color: #b9c7e2; margin-top: 3.5rem; padding: 2.6rem 0 1.4rem; }
.site-foot a { color: #dce6fb; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 1.6rem; }
.foot-brand { font-weight: 700; color: #fff; margin-bottom: .4rem; }
.foot-head { color: #fff; font-weight: 600; font-size: .86rem; text-transform: uppercase; letter-spacing: .09em; margin-bottom: .5rem; }
.foot-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.foot-list li { margin-bottom: .35rem; }
.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: #93a4c4;
}
.foot-demo { color: #f0b429; }

/* print */
@media print {
  .site-head, .site-foot, .demo-banner, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

@media (max-width: 900px) {
  .hero-grid, .split, .grid.three, .grid.four, .grid.two { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.9rem; }
  .summary { position: static; }
}
