/*
 * ZiniApps marketing site — global styles.
 * Design tokens mirror the ZiniApps app design system (see prompts/architecture.md).
 * Layered on top of Bootstrap 5; overrides Bootstrap defaults where the token differs.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --danger: #d93025;
  --success: #1e8e3e;
  --warning: #f9ab00;

  --text-primary: #202124;
  --text-body: #3c4043;
  --text-secondary: #5f6368;

  --border: #dadce0;
  --bg-light: #f8f9fa;
  --bg: #ffffff;

  --radius-card: 8px;
  --radius-btn: 4px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(60, 64, 67, .3);
  --shadow-card-hover: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);

  --header-height: 64px;
}

/* -------------------------------------------------------------------- base */

body {
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -.01em;
}

h1 { font-size: 2.75rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.25; }
h3 { font-size: 1.25rem; }

@media (max-width: 767.98px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}

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

a:hover { color: var(--primary-dark); text-decoration: underline; }

code {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .875em;
  color: var(--text-primary);
}

/*
 * Code blocks (question-JSON samples on product.html).
 * The `code` rule above is for *inline* code; inside a `pre` it would draw a second
 * box around the whole sample, so the nested element is reset back to plain text and
 * the `pre` owns the card. Long JSON lines scroll horizontally inside the block rather
 * than widening the page — see prompts/architecture.md on responsiveness.
 */
pre {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--text-primary);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

/*
 * Highlighted line inside a code sample — used on product.html to draw the eye to
 * `correctAnswer`, whose 1-based numbering is the field authors most often get wrong.
 * Bootstrap's default `mark` is a yellow highlighter with its own padding, which breaks
 * the monospace grid, so it is restyled to a tinted band in the brand palette.
 */
pre code mark {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 3px;
  padding: .05em .3em;
  margin: 0 -.3em;
  font-weight: 600;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  border-radius: var(--radius-btn);
  font-weight: 500;
  padding: .5rem 1.25rem;
}

.btn-primary,
.btn-primary:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:active {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--border);
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
  background-color: var(--primary-light) !important;
  border-color: var(--border) !important;
  color: var(--primary-dark) !important;
}

.btn-lg {
  padding: .75rem 1.75rem;
  font-size: 1rem;
}

/* Pill CTAs — hero and closing banners only (see architecture.md). */
.btn-pill { border-radius: var(--radius-pill); }

.btn-white {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
}

.btn-white:hover { background: var(--primary-light); color: var(--primary-dark); }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .7);
}

.btn-outline-white:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .35);
  outline: none;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header .navbar { min-height: var(--header-height); }

.brand-wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.brand-wordmark:hover { color: var(--text-primary); text-decoration: none; }

.site-header .nav-link {
  color: var(--text-body);
  font-size: .95rem;
  font-weight: 500;
  padding: .5rem .85rem;
}

.site-header .nav-link:hover { color: var(--primary); }

.site-header .nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  font-size: .925rem;
}

.site-footer h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.site-footer a { color: var(--text-body); }
.site-footer a:hover { color: var(--primary); }

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  color: var(--text-secondary);
  font-size: .875rem;
}

/* ---------------------------------------------------------------- sections */

.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-light { background: var(--bg-light); }

@media (max-width: 767.98px) {
  .section { padding: 3rem 0; }
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .75rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 720px;
}

.lead-sm { font-size: 1.05rem; color: var(--text-secondary); }

/* -------------------------------------------------------------------- hero */

.hero {
  background: linear-gradient(160deg, #f8fbff 0%, #eef4fd 55%, #e6eefb 100%);
  border-bottom: 1px solid var(--border);
  padding: 5.5rem 0;
}

.hero h1 { margin-bottom: 1.25rem; }

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-body);
  max-width: 620px;
  margin-bottom: 2rem;
}

.hero-compact {
  padding: 3.5rem 0;
  background: linear-gradient(160deg, #f8fbff 0%, #eef4fd 100%);
}

@media (max-width: 767.98px) {
  .hero { padding: 3rem 0; }
  .hero-compact { padding: 2.5rem 0; }
  .hero-subtitle { font-size: 1.05rem; }
}

/* ------------------------------------------------------------------- cards */

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  height: 100%;
  transition: box-shadow .15s ease;
}

.feature-card:hover { box-shadow: var(--shadow-card-hover); }

.feature-card h3 {
  font-size: 1.125rem;
  margin: 1rem 0 .5rem;
}

.feature-card p { margin-bottom: 0; color: var(--text-secondary); font-size: .95rem; }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-card);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.5rem;
}

/* --------------------------------------------------------------- step list */

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ------------------------------------------------------- alternating rows */

.highlight-row { padding: 3rem 0; }

.highlight-visual {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 4rem;
  padding: 1.5rem;
}

/* SVG illustrations sit inside .highlight-visual and scale with the column. */
.highlight-visual img {
  width: 100%;
  max-width: 460px;
  height: auto;
}

/* ------------------------------------------------------------------ callout */

.callout {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-btn);
  padding: 1.25rem 1.5rem;
  color: var(--text-primary);
}

.callout-warning {
  background: #fef7e0;
  border-left-color: var(--warning);
}

.callout p:last-child { margin-bottom: 0; }

/* Editorial placeholder — content awaiting real data. Deliberately visible. */
.placeholder-note {
  background: #fef7e0;
  border: 1px dashed var(--warning);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  color: var(--text-body);
  font-size: .95rem;
}

/* ------------------------------------------------------------- CTA banner */

.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #174ea6 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255, 255, 255, .9); font-size: 1.1rem; }

/* --------------------------------------------------------------- fact strip */

.fact-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 2.5rem 0;
}

.fact-item { text-align: center; }

.fact-item i {
  font-size: 1.75rem;
  color: var(--primary);
  display: block;
  margin-bottom: .5rem;
}

.fact-item strong { display: block; color: var(--text-primary); font-size: 1rem; }
.fact-item span { color: var(--text-secondary); font-size: .875rem; }

/* ------------------------------------------------------------------ tables */

.table thead th {
  background: var(--bg-light);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.table td, .table th { border-color: var(--border); }

/* ------------------------------------------------------------------ badges */

.badge-soft {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-success-soft { background: #e6f4ea; color: var(--success); }
.badge-warning-soft { background: #fef7e0; color: #b06000; }

/* ----------------------------------------------------------------- pricing */

.pricing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  height: 100%;
  position: relative;
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-card-hover);
}

.pricing-ribbon {
  position: absolute;
  top: -.85rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem 1rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.price-amount {
  font-size: 3rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.price-unit { color: var(--text-secondary); font-size: 1rem; }

.check-list { list-style: none; padding: 0; margin: 0; }

.check-list li {
  padding: .4rem 0 .4rem 1.85rem;
  position: relative;
  font-size: .95rem;
}

.check-list li::before {
  content: "\F26E"; /* bi-check-circle-fill */
  font-family: "bootstrap-icons";
  position: absolute;
  left: 0;
  top: .4rem;
  color: var(--success);
  font-size: 1rem;
}

/* --------------------------------------------------------------- accordion */

.accordion-button {
  font-weight: 500;
  color: var(--text-primary);
}

.accordion-button:not(.collapsed) {
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 2px rgba(26, 115, 232, .25);
  border-color: var(--border);
}

.accordion-item { border-color: var(--border); }

/* ------------------------------------------------------------------- timeline */

.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
  margin-left: .5rem;
}

.timeline-item { position: relative; padding-bottom: 1.75rem; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2rem - 6px);
  top: .45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}

.timeline-time {
  font-size: .8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.timeline-item:last-child { padding-bottom: 0; }

/* ------------------------------------------------------------------- legal */

.legal-body {
  max-width: 800px;
  font-size: .975rem;
}

.legal-body h2 {
  font-size: 1.375rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.legal-body h3 {
  font-size: 1.05rem;
  margin-top: 1.75rem;
  margin-bottom: .75rem;
}

.legal-body p, .legal-body li { color: var(--text-body); }
.legal-body ul, .legal-body ol { padding-left: 1.35rem; }
.legal-body li { margin-bottom: .4rem; }

.legal-toc {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  font-size: .9rem;
  max-height: calc(100vh - var(--header-height) - 3rem);
  overflow-y: auto;
}

.legal-toc h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
  margin-bottom: .75rem;
}

.legal-toc ul { list-style: none; padding: 0; margin: 0; }

.legal-toc a {
  display: block;
  padding: .35rem .75rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
}

.legal-toc a:hover { color: var(--primary); text-decoration: none; }

.legal-toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-light);
  font-weight: 500;
}

.legal-callout {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: .95rem;
}

.legal-callout p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- forms */

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, .25);
}

.form-label { font-weight: 500; font-size: .925rem; color: var(--text-primary); }

/* ------------------------------------------------------------------ in-page nav */

.page-nav {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  font-size: .9rem;
}

.page-nav ul { list-style: none; padding: 0; margin: 0; }

.page-nav a {
  display: block;
  padding: .35rem .75rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
}

.page-nav a:hover { color: var(--primary); text-decoration: none; }

.page-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------- 404 */

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* ------------------------------------------------------------------- misc */

.anchor-offset { scroll-margin-top: calc(var(--header-height) + 1.5rem); }

.text-secondary-custom { color: var(--text-secondary); }

.team-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.team-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 2.5rem;
}

/* -------------------------------------------------------------- zoho desk */

/*
 * Zoho Desk injects a fixed "Feedback" tab (#feedbacklabel / .zsfbleft) at
 * z-index 999999998. It hid support behind an unlabelled launcher and overlapped the
 * hero subtitle at 390 px. We hide the tab and drive the same widget from our own
 * "Submit a ticket" button instead — see js/contact.js.
 *
 * The dialog Zoho opens on click is a different element and is deliberately untouched.
 * Keep visibility/opacity rather than display:none: their script measures the element,
 * and removing it from layout can stop the widget initialising.
 */
#feedbacklabel,
.zsfbleft {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* -------------------------------------------------------- cookie consent */

/*
 * Self-hosted consent banner — see prompts/features/consent.md.
 * Injected into a #consent host that js/loader.js appends to <body>.
 *
 * The z-index clears Zoho's launcher (999999998, hidden above but still stacked) so the
 * banner is never buried by a third-party widget on contact.html.
 */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999999;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(60, 64, 67, .15);
  padding: 1rem 0;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-consent[hidden] { display: none; }

.consent-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.cookie-consent p {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.consent-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.consent-copy { flex: 1 1 auto; }

.consent-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 auto;
}

/*
 * "Reject" carries the same size and prominence as "Accept" — a reject path that is harder
 * to reach than accept is not freely given consent. Do not shrink or de-emphasise it.
 */
.consent-actions .btn {
  white-space: nowrap;
  font-size: .875rem;
}

.consent-manage {
  color: var(--primary);
  text-decoration: underline;
}

/* Panel and bar are alternate views of the same banner; .is-managing swaps them. */
.consent-panel { display: none; }
.cookie-consent.is-managing .consent-bar { display: none; }
.cookie-consent.is-managing .consent-panel { display: block; }

.consent-category {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}

.consent-category:last-of-type { border-bottom: 0; }

.consent-category .form-check-label { color: var(--text-primary); }

.consent-category p { margin-top: .25rem; }

.consent-required {
  font-size: .75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.consent-panel .consent-actions { padding-top: 1rem; }

@media (max-width: 767.98px) {
  .consent-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .consent-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
