﻿/* =====================================================================================================
   Franchising Corp design system (working name â€” brand text comes from configuration)
   Bootstrap 5.3 foundation + custom tokens. No inline styles are used anywhere (strict CSP).
   ===================================================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fc-violet-900: #2a1a72;
  --fc-violet-700: #4a2fc0;
  --fc-violet-600: #5b3fd9;   /* primary â€” 7:1 on white */
  --fc-violet-500: #7158e6;
  --fc-violet-100: #eeeafd;
  --fc-violet-50:  #f6f4fe;
  --fc-ink:        #15131f;
  --fc-ink-2:      #34303f;
  --fc-muted:      #5c5869;   /* 6.6:1 on white */
  --fc-line:       #e5e3eb;
  --fc-surface:    #ffffff;
  --fc-surface-2:  #f7f6fa;
  --fc-success:    #1f7a4d;
  --fc-warning-bg: #fff6e0;
  --fc-warning:    #8a5a00;
  --fc-danger:     #b42318;
  --fc-radius:     1rem;
  --fc-radius-sm:  .625rem;
  --fc-shadow:     0 1px 2px rgba(21, 19, 31, .05), 0 8px 24px rgba(21, 19, 31, .06);
  --fc-shadow-lg:  0 2px 4px rgba(21, 19, 31, .06), 0 16px 40px rgba(21, 19, 31, .10);
  --fc-focus:      0 0 0 3px #fff, 0 0 0 6px var(--fc-violet-600);

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--fc-ink-2);
  --bs-body-bg: var(--fc-surface);
  --bs-primary: var(--fc-violet-600);
  --bs-primary-rgb: 91, 63, 217;
  --bs-link-color: var(--fc-violet-700);
  --bs-link-color-rgb: 74, 47, 192;
  --bs-link-hover-color: var(--fc-violet-900);
  --bs-border-color: var(--fc-line);
  --bs-border-radius: var(--fc-radius-sm);
  --bs-border-radius-lg: var(--fc-radius);
  --bs-secondary-color: var(--fc-muted);
}

body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4, .h1, .h2, .h3, .h4 { color: var(--fc-ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.display-hero { font-size: clamp(2.25rem, 3.5vw + 1rem, 3.75rem); letter-spacing: -0.035em; font-weight: 750; }
.lead { color: var(--fc-muted); font-size: 1.15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 650; color: var(--fc-violet-700); }
.text-muted, .text-body-secondary { color: var(--fc-muted) !important; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.bg-soft { background: var(--fc-surface-2); }
.bg-violet-soft { background: var(--fc-violet-50); }

/* ---- Focus & accessibility --------------------------------------------------------------------- */
:focus-visible { outline: none; box-shadow: var(--fc-focus) !important; border-radius: .4rem; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 2000; background: var(--fc-ink); color: #fff; padding: .6rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; color: #fff; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- Buttons ------------------------------------------------------------------------------------ */
.btn { font-weight: 600; border-radius: 999px; padding: .65rem 1.25rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; padding: .35rem .9rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn-primary {
  --bs-btn-bg: var(--fc-violet-600); --bs-btn-border-color: var(--fc-violet-600);
  --bs-btn-hover-bg: var(--fc-violet-700); --bs-btn-hover-border-color: var(--fc-violet-700);
  --bs-btn-active-bg: var(--fc-violet-900); --bs-btn-active-border-color: var(--fc-violet-900);
  --bs-btn-disabled-bg: var(--fc-violet-500); --bs-btn-disabled-border-color: var(--fc-violet-500);
}
.btn-outline-primary {
  --bs-btn-color: var(--fc-violet-700); --bs-btn-border-color: #cfc6f7;
  --bs-btn-hover-bg: var(--fc-violet-50); --bs-btn-hover-color: var(--fc-violet-900); --bs-btn-hover-border-color: var(--fc-violet-600);
  --bs-btn-active-bg: var(--fc-violet-100); --bs-btn-active-color: var(--fc-violet-900); --bs-btn-active-border-color: var(--fc-violet-600);
}
.btn-ghost { color: var(--fc-ink-2); background: transparent; border: 1px solid var(--fc-line); }
.btn-ghost:hover { background: var(--fc-surface-2); color: var(--fc-ink); }
.btn-ghost[aria-pressed="true"] { background: var(--fc-violet-50); border-color: var(--fc-violet-600); color: var(--fc-violet-900); }

/* ---- Header / footer ---------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--fc-line); }
.site-header .navbar { min-height: 68px; }
.brand-mark { font-weight: 750; letter-spacing: -0.03em; color: var(--fc-ink); font-size: 1.2rem; display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-mark svg { width: 30px; height: 30px; }
.brand-mark .brand-owner { font-weight: 500; font-size: .7em; letter-spacing: 0; opacity: .7; }
.site-header .nav-link { color: var(--fc-ink-2); font-weight: 550; padding-inline: .85rem !important; border-radius: 999px; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--fc-violet-700); background: var(--fc-violet-50); }
.demo-banner { background: var(--fc-warning-bg); color: var(--fc-warning); font-size: .875rem; border-bottom: 1px solid #f1e2b8; }
.site-footer { background: var(--fc-ink); color: #c9c6d3; padding-block: 3.5rem 2rem; margin-top: 4rem; }
.site-footer a { color: #e9e7f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2 { color: #fff; font-size: .95rem; letter-spacing: 0; }
.site-footer .fine-print { color: #a29fae; font-size: .825rem; }

/* ---- Hero & search ------------------------------------------------------------------------------ */
.hero { background: radial-gradient(1200px 400px at 85% -10%, var(--fc-violet-100), transparent 60%), linear-gradient(180deg, var(--fc-violet-50), #fff 70%); }
.search-panel { background: #fff; border: 1px solid var(--fc-line); border-radius: 1.25rem; box-shadow: var(--fc-shadow-lg); padding: 1rem; }
.search-panel .form-select, .search-panel .form-control { min-height: 52px; border-radius: .8rem; }
.search-panel .form-label { font-size: .8rem; font-weight: 650; color: var(--fc-muted); margin-bottom: .25rem; }

/* ---- Cards -------------------------------------------------------------------------------------- */
.fc-card { background: #fff; border: 1px solid var(--fc-line); border-radius: var(--fc-radius); box-shadow: var(--fc-shadow); }
.fc-card-pad { padding: clamp(1.25rem, 2.5vw, 2rem); }
.brand-card { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.brand-card:hover { box-shadow: var(--fc-shadow-lg); transform: translateY(-2px); }
.brand-card .media { position: relative; aspect-ratio: 16 / 10; background: var(--fc-violet-50); overflow: hidden; }
.brand-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-card .logo { position: absolute; left: 1rem; bottom: -22px; width: 52px; height: 52px; border-radius: .9rem; background: #fff; border: 1px solid var(--fc-line); box-shadow: var(--fc-shadow); overflow: hidden; }
.brand-card .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-card .body { padding: 2rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.brand-card h3 { font-size: 1.125rem; margin: 0; }
.brand-card h3 a { color: var(--fc-ink); text-decoration: none; }
.brand-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.brand-card .actions { position: relative; z-index: 2; }
.brand-card .summary { color: var(--fc-muted); font-size: .935rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brand-card .facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; border-top: 1px solid var(--fc-line); padding-top: .85rem; margin-top: auto; }
.fact-label { font-size: .75rem; color: var(--fc-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fact-value { font-weight: 700; color: var(--fc-ink); }
.media-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--fc-violet-700); font-weight: 700; font-size: 1.5rem; background: linear-gradient(135deg, var(--fc-violet-100), var(--fc-violet-50)); }

.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; background: var(--fc-surface-2); color: var(--fc-ink-2); border: 1px solid var(--fc-line); }
.chip-violet { background: var(--fc-violet-50); color: var(--fc-violet-900); border-color: #ddd5fb; }
.badge-demo { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .2rem .5rem; border-radius: .4rem; background: var(--fc-warning-bg); color: var(--fc-warning); border: 1px solid #f1e2b8; }
.brand-card .badge-demo { position: absolute; top: .75rem; right: .75rem; z-index: 2; }

.tile-link { display: block; padding: 1.25rem; border-radius: var(--fc-radius); border: 1px solid var(--fc-line); background: #fff; text-decoration: none; color: var(--fc-ink); height: 100%; transition: border-color .2s ease, box-shadow .2s ease; }
.tile-link:hover { border-color: #cfc6f7; box-shadow: var(--fc-shadow); color: var(--fc-ink); }
.tile-link .tile-title { font-weight: 700; display: block; }
.tile-link .tile-meta { color: var(--fc-muted); font-size: .9rem; }

.step-num { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--fc-violet-600); color: #fff; font-weight: 700; }

/* ---- Directory ---------------------------------------------------------------------------------- */
.filter-panel .form-label, .filter-panel legend { font-weight: 650; font-size: .875rem; color: var(--fc-ink); }
.filter-panel fieldset + fieldset, .filter-panel .filter-group + .filter-group { border-top: 1px solid var(--fc-line); padding-top: 1rem; margin-top: 1rem; }
.result-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.active-filters .chip { text-decoration: none; }
.active-filters .chip:hover { border-color: var(--fc-violet-600); }
@media (min-width: 992px) { .filter-sticky { position: sticky; top: 88px; } }

.empty-state { text-align: center; padding: 3rem 1.5rem; border: 1px dashed #d7d3e2; border-radius: var(--fc-radius); background: var(--fc-surface-2); }
.empty-state svg { width: 56px; height: 56px; color: var(--fc-violet-500); }

.pagination { --bs-pagination-color: var(--fc-violet-700); --bs-pagination-active-bg: var(--fc-violet-600); --bs-pagination-active-border-color: var(--fc-violet-600); --bs-pagination-focus-box-shadow: var(--fc-focus); gap: .25rem; }
.pagination .page-link { border-radius: .6rem !important; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* ---- Profile ------------------------------------------------------------------------------------ */
.profile-hero { background: linear-gradient(180deg, var(--fc-violet-50), #fff); border-bottom: 1px solid var(--fc-line); }
.profile-logo { width: 84px; height: 84px; border-radius: 1.1rem; border: 1px solid var(--fc-line); background: #fff; overflow: hidden; flex-shrink: 0; box-shadow: var(--fc-shadow); }
.profile-logo img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main { aspect-ratio: 16 / 10; border-radius: var(--fc-radius); overflow: hidden; background: var(--fc-violet-50); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.format-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.format-tabs .btn[aria-selected="true"] { background: var(--fc-violet-600); color: #fff; border-color: var(--fc-violet-600); }
.kv { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: .65rem 1rem; margin: 0; }
.kv dt { color: var(--fc-muted); font-weight: 600; font-size: .9rem; }
.kv dd { margin: 0; color: var(--fc-ink); font-weight: 600; }
.money-tile { padding: 1rem 1.1rem; border-radius: var(--fc-radius-sm); background: var(--fc-surface-2); border: 1px solid var(--fc-line); height: 100%; }
.money-tile .label { font-size: .78rem; color: var(--fc-muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.money-tile .value { font-size: 1.35rem; font-weight: 750; color: var(--fc-ink); letter-spacing: -0.02em; }
.money-tile .hint { font-size: .8rem; color: var(--fc-muted); }
.value-missing { color: var(--fc-muted); font-weight: 600; font-style: italic; }
.data-flag { display: flex; gap: .5rem; padding: .75rem 1rem; border-radius: var(--fc-radius-sm); background: var(--fc-warning-bg); color: var(--fc-warning); font-size: .9rem; }
.sticky-cta { position: sticky; top: 88px; }
.eligibility-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.elig { padding: .45rem .7rem; border-radius: .6rem; border: 1px solid var(--fc-line); font-size: .875rem; display: flex; justify-content: space-between; gap: .5rem; }
.elig-ok { background: #edf7f1; border-color: #cde7d8; }
.elig-no { background: #fdeeee; border-color: #f4cfcc; }
.elig-pending { background: var(--fc-warning-bg); border-color: #f1e2b8; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5rem; }
.prose li + li { margin-top: .35rem; }

.video-facade { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--fc-radius); overflow: hidden; background: var(--fc-ink); cursor: pointer; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video-facade .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .95); display: flex; align-items: center; justify-content: center; }
.video-facade .play::before { content: ""; border-left: 22px solid var(--fc-violet-600); border-top: 13px solid transparent; border-bottom: 13px solid transparent; margin-left: 6px; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--fc-radius); }

/* ---- Compare ------------------------------------------------------------------------------------ */
.compare-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.compare-table th, .compare-table td { padding: .9rem 1rem; border-bottom: 1px solid var(--fc-line); vertical-align: top; }
.compare-table thead th { position: sticky; top: 68px; background: #fff; z-index: 1; }
.compare-table tbody th { color: var(--fc-muted); font-weight: 600; font-size: .9rem; width: 22%; background: var(--fc-surface-2); }
.compare-table .group-row th { background: #fff; color: var(--fc-violet-700); text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; padding-top: 1.5rem; }

.compare-tray { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1040; width: min(720px, calc(100% - 2rem)); background: var(--fc-ink); color: #fff; border-radius: 1rem; box-shadow: var(--fc-shadow-lg); padding: .75rem 1rem; display: none; }
.compare-tray.is-visible { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.compare-tray .tray-items { flex: 1; display: flex; flex-wrap: wrap; gap: .4rem; }
.compare-tray .tray-chip { background: rgba(255, 255, 255, .12); border-radius: 999px; padding: .2rem .4rem .2rem .7rem; font-size: .85rem; display: inline-flex; align-items: center; gap: .25rem; }
.compare-tray .tray-chip button { background: transparent; border: 0; color: #fff; min-width: 28px; min-height: 28px; border-radius: 50%; }

/* ---- Questionnaire ------------------------------------------------------------------------------ */
.q-progress { height: .5rem; border-radius: 999px; background: var(--fc-violet-100); overflow: hidden; }
.q-progress-bar { height: 100%; background: var(--fc-violet-600); width: 0; transition: width .3s ease; }
.q-progress-bar[data-step="1"] { width: 20%; } .q-progress-bar[data-step="2"] { width: 40%; } .q-progress-bar[data-step="3"] { width: 60%; }
.q-progress-bar[data-step="4"] { width: 80%; } .q-progress-bar[data-step="5"] { width: 100%; }
.js .q-step { display: none; }
.js .q-step.is-active { display: block; }
.option-card { position: relative; }
.option-card input { position: absolute; opacity: 0; inset: 0; }
.option-card label { display: block; padding: 1rem 1.1rem; border: 1px solid var(--fc-line); border-radius: var(--fc-radius-sm); cursor: pointer; min-height: 44px; font-weight: 600; background: #fff; height: 100%; }
.option-card label small { display: block; font-weight: 400; color: var(--fc-muted); }
.option-card input:checked + label { border-color: var(--fc-violet-600); background: var(--fc-violet-50); box-shadow: inset 0 0 0 1px var(--fc-violet-600); }
.option-card input:focus-visible + label { box-shadow: var(--fc-focus); }
.match-result + .match-result { margin-top: 1rem; }
.reason-list, .gap-list { list-style: none; padding: 0; margin: 0; }
.reason-list li, .gap-list li { position: relative; padding-left: 1.6rem; margin-bottom: .4rem; font-size: .935rem; }
.reason-list li::before { content: "âœ“"; position: absolute; left: 0; color: var(--fc-success); font-weight: 800; }
.gap-list li::before { content: "?"; position: absolute; left: .15rem; color: var(--fc-warning); font-weight: 800; }

/* ---- Forms -------------------------------------------------------------------------------------- */
.form-control, .form-select { min-height: 46px; border-radius: .7rem; border-color: #d9d6e2; }
.form-control:focus, .form-select:focus { border-color: var(--fc-violet-600); box-shadow: 0 0 0 .2rem rgba(91, 63, 217, .2); }
.form-check-input { width: 1.25em; height: 1.25em; }
.form-check-input:checked { background-color: var(--fc-violet-600); border-color: var(--fc-violet-600); }
.form-text { color: var(--fc-muted); }
.validation-summary-errors, .error-summary { border: 1px solid #f4cfcc; background: #fdeeee; color: var(--fc-danger); border-radius: var(--fc-radius-sm); padding: 1rem 1.25rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none; }
.field-validation-error, .text-danger { color: var(--fc-danger) !important; font-size: .875rem; font-weight: 600; }
.input-validation-error { border-color: var(--fc-danger) !important; }
.consent-box { background: var(--fc-surface-2); border: 1px solid var(--fc-line); border-radius: var(--fc-radius-sm); padding: 1rem 1.25rem; }
.summary-pre { white-space: pre-line; background: var(--fc-surface-2); border-radius: var(--fc-radius-sm); padding: 1rem 1.25rem; border: 1px solid var(--fc-line); }
.btn[data-loading="true"] { pointer-events: none; opacity: .75; }

.breadcrumb { --bs-breadcrumb-divider-color: var(--fc-muted); font-size: .875rem; }
.breadcrumb a { color: var(--fc-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--fc-violet-700); text-decoration: underline; }

/* ---- Admin -------------------------------------------------------------------------------------- */
.admin-body { background: var(--fc-surface-2); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-nav { width: 248px; flex-shrink: 0; background: var(--fc-ink); color: #d6d3df; padding: 1.25rem .75rem; }
.admin-nav .brand-mark { color: #fff; padding: 0 .5rem 1rem; }
.admin-nav .nav-section { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #8f8b9e; padding: 1rem .75rem .35rem; }
.admin-nav a { display: block; color: #e3e1ea; text-decoration: none; padding: .5rem .75rem; border-radius: .55rem; font-size: .925rem; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.admin-main h1 { font-size: 1.6rem; }
.stat { padding: 1.1rem 1.25rem; }
.stat .num { font-size: 1.8rem; font-weight: 750; color: var(--fc-ink); }
.table-admin { background: #fff; border-radius: var(--fc-radius); overflow: hidden; }
.table-admin th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fc-muted); background: #fbfafd; }
.status-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; border: 1px solid var(--fc-line); }
.status-Published { background: #edf7f1; color: var(--fc-success); border-color: #cde7d8; }
.status-Approved { background: var(--fc-violet-50); color: var(--fc-violet-900); border-color: #ddd5fb; }
.status-NeedsReview { background: var(--fc-warning-bg); color: var(--fc-warning); border-color: #f1e2b8; }
.status-Imported { background: #eef2f7; color: #2b4a6f; }
.status-Archived { background: #f2f2f2; color: #555; }
.internal-panel { border: 2px dashed #e7b4b0; background: #fffafa; border-radius: var(--fc-radius); }
.internal-label { color: var(--fc-danger); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.code-json { background: #15131f; color: #e9e7f0; border-radius: var(--fc-radius-sm); padding: 1rem; font-size: .8rem; max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 991.98px) {
  .admin-shell { flex-direction: column; }
  .admin-nav { width: 100%; }
  .admin-nav nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .admin-nav .nav-section { width: 100%; padding-top: .5rem; }
}
