/* ICF Connect — Corporate Design (July 2026).
   Base: black / white. Signal accent: Mint (swap --icf-signal).
   Type: Flama Semicondensed. Icons: Font Awesome (Sharp when kit available).
   Light theme forced for Telegram WebView contrast. */

@font-face {
  font-family: "Flama Semicondensed";
  src: url("fonts/flama/FlamaSemicondensed-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Flama Semicondensed";
  src: url("fonts/flama/FlamaSemicondensed-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Flama Semicondensed";
  src: url("fonts/flama/FlamaSemicondensed-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --icf-black: #000000;
  --icf-white: #ffffff;
  --icf-text: #000000;
  --icf-muted: #4a4a4a;
  --icf-surface: #ffffff;
  --icf-bg: #f5f5f5;
  --icf-border: #e0e0e0;

  /* Signal / trend (brand book). Primary accent = Mint; dark for text on white. */
  --icf-signal: #4affd4;
  --icf-signal-dark: #1dbf94;
  --icf-rose: #ffbecd;
  --icf-rose-dark: #dc8196;
  --icf-orange: #ffa14a;
  --icf-orange-dark: #ca680e;
  --icf-lime: #cfff48;
  --icf-lime-dark: #a6d02f;
  --icf-purple: #bc9cff;
  --icf-purple-dark: #8362e0;

  --icf-primary: var(--icf-black);
  --icf-accent: var(--icf-signal-dark);
  --icf-radius: 4px;
  --icf-radius-sm: 2px;

  --bs-primary: #000000;
  --bs-primary-rgb: 0, 0, 0;
  --bs-link-color: #1dbf94;
  --bs-link-hover-color: #000000;
  --bs-body-font-family: "Flama Semicondensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --bs-body-color: #000000;
  --bs-border-radius: 2px;
  --bs-border-radius-sm: 2px;
  --bs-focus-ring-color: rgba(77, 255, 212, 0.45);
}

html, body {
  background: var(--icf-bg);
  color: var(--icf-text);
}

body {
  font-family: "Flama Semicondensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

/* Titles — Look: Medium, +100 tracking, all caps where used as display */
.icf-display {
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--icf-black);
}
.icf-section-title {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.icf-card {
  background: var(--icf-surface);
  border: 1px solid var(--icf-border);
  border-radius: var(--icf-radius);
  padding: 20px 18px;
}
.icf-card + .icf-card { margin-top: 12px; }

.form-control, .form-select {
  border-radius: var(--icf-radius-sm);
  border-color: var(--icf-border);
  padding: 10px 12px;
  font-weight: 400;
}
.form-control:focus, .form-select:focus {
  border-color: var(--icf-black);
  box-shadow: 0 0 0 0.2rem rgba(74, 255, 212, 0.35);
}

.form-check-input:checked {
  background-color: var(--icf-black);
  border-color: var(--icf-black);
}
.form-check-input:focus {
  border-color: var(--icf-signal-dark);
  box-shadow: 0 0 0 0.2rem rgba(74, 255, 212, 0.35);
}

/* Buttons — black primary, mint accent outline */
.btn {
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--icf-radius-sm);
}
.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #000000;
  --bs-btn-border-color: #000000;
  --bs-btn-hover-color: #000000;
  --bs-btn-hover-bg: var(--icf-orange);
  --bs-btn-hover-border-color: var(--icf-orange);
  --bs-btn-active-color: #000000;
  --bs-btn-active-bg: var(--icf-orange);
  --bs-btn-active-border-color: var(--icf-orange-dark);
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #888888;
  --bs-btn-disabled-border-color: #888888;
  color: #fff;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-outline-primary {
  --bs-btn-color: #000000;
  --bs-btn-border-color: #000000;
  --bs-btn-bg: transparent;
  --bs-btn-hover-bg: var(--icf-orange);
  --bs-btn-hover-border-color: var(--icf-orange);
  --bs-btn-hover-color: #000000;
  --bs-btn-active-bg: var(--icf-orange);
  --bs-btn-active-border-color: var(--icf-orange-dark);
  --bs-btn-active-color: #000000;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Touch: :active paints orange; :hover mainly for desktop preview */
.btn-primary:active:not(:disabled),
.btn-outline-primary:active:not(:disabled) {
  background-color: var(--icf-orange) !important;
  border-color: var(--icf-orange-dark) !important;
  color: #000 !important;
}
.btn-link {
  color: var(--icf-accent);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-link:hover { color: var(--icf-black); }

.btn-cta {
  width: 100%;
  padding: 12px 16px;
  font-weight: 500;
  border-radius: var(--icf-radius-sm);
}
.btn-cta .fa-solid,
.btn-cta .fa-brands,
.hero-cta .fa-solid,
.btn-cta .icf-ico,
.hero-cta .icf-ico {
  margin-right: 0.45em;
}

/* Brand book icons (slide 15) — mask so color follows button text / hover orange */
.icf-ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.icf-ico-new-here {
  -webkit-mask-image: url("icons/new-here.png");
  mask-image: url("icons/new-here.png");
}
.icf-ico-small-groups {
  -webkit-mask-image: url("icons/small-groups.svg");
  mask-image: url("icons/small-groups.svg");
}
.icf-ico-teams {
  -webkit-mask-image: url("icons/teams.svg");
  mask-image: url("icons/teams.svg");
}

.hero-cta { font-size: 16px; padding: 14px 16px; letter-spacing: 0.06em; }

/* Status / track badges — muted signal colors */
.badge-new         { background: #e8e8e8; color: #000; }
.badge-contacted   { background: #ffe8d0; color: var(--icf-orange-dark); }
.badge-met         { background: #d8faf0; color: #0a6b52; }
.badge-no_response { background: #fce4ea; color: #8a3048; }
.badge-track { font-weight: 500; letter-spacing: 0.04em; }
.badge-track-new_here     { background: #d8faf0; color: #0a6b52; }
.badge-track-small_groups { background: #f0e8ff; color: var(--icf-purple-dark); }
.badge-track-teams        { background: #ffe8d0; color: var(--icf-orange-dark); }

.track-cta + .track-cta { margin-top: 8px; }

.status-chart-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
}
.status-chart-label {
  flex: 0 0 7.5rem;
  color: var(--icf-muted);
}
.status-chart-bar-wrap {
  flex: 1;
  min-width: 0;
  height: 1.1rem;
  background: #ebebeb;
  border-radius: var(--icf-radius-sm);
  overflow: hidden;
}
.status-chart-bar {
  height: 100%;
  border-radius: var(--icf-radius-sm);
  min-width: 2px;
  transition: width 0.25s ease;
}
.status-chart-count {
  flex: 0 0 auto;
  min-width: 2.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--icf-muted);
}

.admin-dash-tabs {
  display: flex;
  width: 100%;
  gap: 2px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: var(--icf-radius);
  background: #e8e8e8;
  box-sizing: border-box;
}
.admin-dash-tab {
  flex: 1;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--icf-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 9px 10px;
  border-radius: var(--icf-radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.admin-dash-tab:hover:not(.active) {
  color: var(--icf-text);
  background: rgba(255, 255, 255, 0.45);
}
.admin-dash-tab.active {
  background: var(--icf-surface);
  color: var(--icf-text);
  box-shadow: none;
  border-bottom: 2px solid var(--icf-signal);
}
.admin-dash-tab:focus-visible {
  outline: 2px solid var(--icf-signal-dark);
  outline-offset: 2px;
  z-index: 1;
}

.status-chart-row.status-chart-total {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--icf-border);
  font-weight: 500;
}
.status-chart-row.status-chart-total .status-chart-label,
.status-chart-row.status-chart-total .status-chart-count {
  color: var(--icf-text);
}
.status-chart-total .status-chart-bar {
  background: #888 !important;
  width: 100% !important;
}

.icf-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.request-row-main { min-width: 0; flex: 1; }
.request-row-badges {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status-btn { min-width: 92px; }
.status-btn.active {
  background: var(--icf-black) !important;
  border-color: var(--icf-black) !important;
  color: #fff !important;
}

.request-row {
  padding: 12px;
  border-radius: var(--icf-radius);
  border: 1px solid var(--icf-border);
  background: var(--icf-surface);
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease;
}
.request-row:hover {
  background: #fafafa;
  border-color: #ccc;
}
.request-row + .request-row { margin-top: 8px; }
.request-row .meta {
  color: var(--icf-muted);
  font-size: 13px;
}

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-pill {
  border: 1px solid var(--icf-border);
  background: var(--icf-surface);
  border-radius: 2px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--icf-text);
  cursor: pointer;
  font-family: inherit;
}
.filter-pill.active {
  background: var(--icf-black);
  color: #fff;
  border-color: var(--icf-black);
}
.filter-pill .count {
  margin-left: 6px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.text-helper { color: var(--icf-muted); font-size: 13px; font-weight: 300; }

.consent-block {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--icf-border);
}
.consent-block .form-check {
  min-height: 0;
  padding-left: 1.4em;
}
.consent-block .form-check-input {
  width: 0.95em;
  height: 0.95em;
  margin-top: 0.2em;
  margin-left: -1.4em;
}
.consent-block .form-check-label {
  font-size: 11px;
  color: #5a5a5a;
  line-height: 1.35;
  min-height: 0;
  font-weight: 300;
}
.consent-required {
  color: #5a5a5a;
  font-weight: 500;
}

.success-info-card {
  background: #f0fffb;
  border-color: #b8f5e4;
  text-align: center;
}

.start-bot-card {
  background: #fff8f0;
  border-color: #ffd4a8;
  text-align: center;
  margin-top: 12px;
}

.icf-icon-hero {
  font-size: 1.75rem;
  color: var(--icf-signal-dark);
  line-height: 1;
}

.featured-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.featured-link-row,
.explore-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--icf-border);
  border-radius: var(--icf-radius);
  background: var(--icf-surface);
  color: var(--icf-text);
  text-decoration: none;
  transition: background 80ms ease, border-color 80ms ease;
}
.featured-link-row:hover,
.explore-link-row:hover {
  background: #fafafa;
  border-color: #ccc;
  color: var(--icf-text);
}
.featured-link-row .fa-solid,
.featured-link-row .fa-brands,
.explore-link-row .fa-solid:first-child {
  color: var(--icf-accent);
  font-size: 15px;
  flex-shrink: 0;
  width: 1.15em;
  text-align: center;
}
.featured-link-label,
.explore-link-label {
  flex: 1;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.3;
}
.featured-link-row .fa-chevron-right,
.explore-link-row .fa-chevron-right {
  color: var(--icf-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.explore-entry-block { padding-top: 4px; }
.explore-entry-hint {
  font-size: 13px;
  color: var(--icf-muted);
  margin-bottom: 4px;
  font-weight: 300;
}
.explore-entry-link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--icf-accent);
  text-decoration: none;
}
.explore-entry-link:hover {
  color: var(--icf-black);
  text-decoration: underline;
}

.explore-section + .explore-section { margin-top: 16px; }
.explore-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--icf-muted);
  margin-bottom: 8px;
}
.explore-section-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#f-i-other-wrap .form-control { margin-top: 2px; }

.form-label {
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--icf-text);
  margin-bottom: 8px;
}

.btn, .form-check-label, .filter-pill { min-height: 36px; }
.btn-cta, .hero-cta { min-height: 48px; }

.screen { display: none; }
.screen.active { display: block; }

#screen-welcome.active,
#screen-success.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
}

#screen-welcome .icf-display {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}
#screen-welcome #welcome-lead {
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--icf-muted);
}

.loader { display: flex; align-items: center; justify-content: center; padding: 32px; }

.toast-stack {
  position: fixed;
  top: 12px; left: 12px; right: 12px;
  z-index: 1080;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast-stack .toast-msg {
  background: var(--icf-black);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--icf-radius);
  font-size: 14px;
  font-weight: 400;
  pointer-events: auto;
  animation: fadeInOut 4s ease forwards;
}
.toast-stack .toast-msg.error { background: #8a3048; }
.toast-stack .toast-msg.success { background: #0a6b52; }
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-6px); }
  10%, 85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

.icf-debug-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  max-height: 42vh;
  background: #111;
  color: #e8eaed;
  border-top: 2px solid var(--icf-signal);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}
.icf-debug-panel[hidden] { display: none !important; }
.icf-debug-panel.icf-debug-collapsed {
  max-height: none;
}
.icf-debug-panel.icf-debug-collapsed .icf-debug-toolbar {
  border-bottom: none;
}
.icf-debug-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid #333;
}
.icf-debug-log[hidden] { display: none !important; }
.icf-debug-badge {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--icf-signal);
  margin-right: auto;
}
.icf-debug-log {
  margin: 0;
  padding: 8px 10px 12px;
  overflow: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  color: #c8ccd4;
}
