/* ============================================================
   Flotry Components
   Static component library. Class-based. No framework.
   Loaded AFTER flotry-tokens.css.
   ============================================================ */

/* ---------- Layout ---------- */
.fl-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.fl-shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 96px;
  flex: 1;
}
.fl-shell--wide { max-width: var(--maxw-wide); }
.fl-stack > * + * { margin-top: 16px; }
.fl-stack-lg > * + * { margin-top: 28px; }

/* ---------- Header ---------- */
.fl-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.fl-header__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}
.fl-lockup {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.fl-lockup__notch {
  width: 28px; height: 28px;
  background: var(--anchor-teal);
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
}
.fl-lockup__notch::before {
  content: ""; position: absolute; inset: auto 0 0 0;
  height: 38%;
  background: var(--paper);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.fl-lockup__word {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
  color: var(--teal-ink);
}
.fl-header__nav {
  display: flex; gap: 20px; align-items: center;
}
.fl-header__nav a {
  font-size: 14px; font-weight: 500;
  text-decoration: none; color: var(--ink-soft);
  padding: 8px 4px;
}
.fl-header__nav a.is-active { color: var(--anchor-teal); }
@media (max-width: 640px) {
  .fl-header__nav { display: none; }
  .fl-header__nav.is-mobile { display: flex; }
}

/* ---------- Pilot ribbon ---------- */
.fl-pilot-ribbon {
  background: var(--cream-warm);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  padding: 8px 16px;
  font-weight: 500;
}
.fl-pilot-ribbon b { color: var(--teal-ink); }

/* ---------- Buttons ---------- */
.fl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fl-btn--primary {
  background: var(--anchor-teal); color: #fff; border-color: var(--anchor-teal);
}
.fl-btn--primary:hover, .fl-btn--primary:focus { background: var(--teal-deep); border-color: var(--teal-deep); }
.fl-btn--ghost {
  background: transparent; color: var(--anchor-teal); border-color: var(--anchor-teal);
}
.fl-btn--ghost:hover { background: var(--teal-soft); }
.fl-btn--quiet {
  background: var(--paper); color: var(--ink); border-color: var(--line-strong);
}
.fl-btn--quiet:hover { border-color: var(--ink-muted); }
.fl-btn--danger-ghost {
  background: transparent; color: var(--danger); border-color: var(--danger);
}
.fl-btn--full { width: 100%; }
.fl-btn[disabled], .fl-btn.is-disabled {
  background: var(--line-strong); border-color: var(--line-strong); color: #fff;
  cursor: not-allowed; opacity: 0.7;
}
.fl-btn--google {
  background: #fff; color: var(--ink); border-color: var(--line-strong);
}
.fl-btn--google:hover { border-color: var(--ink-muted); }
.fl-btn--google .fl-gicon {
  width: 16px; height: 16px; border-radius: 999px;
  background: conic-gradient(from 0deg, #4285F4 0 25%, #34A853 25% 50%, #FBBC05 50% 75%, #EA4335 75% 100%);
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 10px; font-family: var(--font-display);
}
.fl-btn--google .fl-gicon::after { content: "G"; }

/* ---------- Card ---------- */
.fl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.fl-card--tinted { background: var(--teal-soft); border-color: #C8DED4; }
.fl-card--warm   { background: var(--cream-warm); border-color: var(--line); }
.fl-card__title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.fl-card__sub { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------- Help request card ---------- */
.fl-request {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: start;
}
.fl-request__avatar {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.fl-request__title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 16px; margin: 0 0 2px;
}
.fl-request__meta {
  font-size: 13px; color: var(--ink-muted); margin: 0;
}
.fl-request__cta { align-self: center; }

/* ---------- Helper action card ---------- */
.fl-helper-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.fl-helper-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.fl-helper-card__name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 16px; margin: 0;
}
.fl-helper-card__when { font-size: 13px; color: var(--ink-muted); }
.fl-helper-card__body { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.fl-helper-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Payment status card ---------- */
.fl-payment {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.fl-payment__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 12px;
}
.fl-payment__status--pending  { background: var(--warning-soft); color: #8C5E14; }
.fl-payment__status--complete { background: var(--success-soft); color: #1F5F45; }
.fl-payment__status--failed   { background: var(--danger-soft); color: #802A22; }
.fl-payment__amount {
  font-family: var(--font-display);
  font-weight: 700; font-size: 28px; letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.fl-payment__note {
  font-size: 13px; color: var(--ink-muted); margin: 0;
}
.fl-payment__provider {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 14px; margin-top: 14px;
  font-size: 13px;
}
.fl-payment__provider span:first-child { color: var(--ink-muted); }
.fl-payment__provider span:last-child { color: var(--ink); font-weight: 500; }

/* ---------- Trust-safe notice ---------- */
.fl-notice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.5;
}
.fl-notice__icon {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.fl-notice--info    { background: var(--info-soft); color: #1F4D6B; border: 1px solid #BBCCDE; }
.fl-notice--info .fl-notice__icon { background: var(--info); color: #fff; }
.fl-notice--warn    { background: var(--warning-soft); color: #8C5E14; border: 1px solid #E9D7A6; }
.fl-notice--warn .fl-notice__icon { background: var(--warning); color: #fff; }
.fl-notice--danger  { background: var(--danger-soft); color: #802A22; border: 1px solid #E5C2BA; }
.fl-notice--danger .fl-notice__icon { background: var(--danger); color: #fff; }
.fl-notice--quiet   { background: var(--cream-warm); color: var(--ink-soft); border: 1px solid var(--line); }
.fl-notice--quiet .fl-notice__icon { background: var(--ink-muted); color: #fff; }

/* ---------- Empty state ---------- */
.fl-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.fl-empty__glyph {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--teal-soft);
  border-radius: 14px;
  position: relative;
}
.fl-empty__glyph::before {
  content: ""; position: absolute; inset: auto 0 0 0;
  height: 38%;
  background: var(--paper);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.fl-empty__title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; margin: 0 0 6px;
}
.fl-empty__body {
  font-size: 14px; color: var(--ink-soft); margin: 0 0 18px;
  max-width: 36ch; margin-left: auto; margin-right: auto;
}

/* ---------- Error state ---------- */
.fl-error {
  background: var(--paper);
  border: 1px solid var(--danger-soft);
  border-radius: var(--r-lg);
  padding: 22px;
  text-align: center;
}
.fl-error__title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; margin: 0 0 4px;
  color: var(--ink);
}
.fl-error__body { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }

/* ---------- Loading state ---------- */
.fl-skeleton {
  background: linear-gradient(90deg, var(--cream-warm) 0%, #ECE7DD 50%, var(--cream-warm) 100%);
  background-size: 200% 100%;
  animation: fl-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
  height: 16px;
}
.fl-skeleton--lg { height: 24px; }
.fl-skeleton--block { height: 80px; }
@keyframes fl-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.fl-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--teal-soft);
  border-top-color: var(--anchor-teal);
  border-radius: 999px;
  animation: fl-spin 0.9s linear infinite;
  display: inline-block;
}
@keyframes fl-spin { to { transform: rotate(360deg); } }

/* ---------- Form fields ---------- */
.fl-field { display: block; margin-bottom: 14px; }
.fl-field__label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.fl-input, .fl-textarea, .fl-select {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.fl-input:focus, .fl-textarea:focus, .fl-select:focus {
  border-color: var(--anchor-teal);
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-soft);
}
.fl-input[disabled], .fl-textarea[disabled] {
  background: var(--cream-warm); color: var(--ink-muted); cursor: not-allowed;
}
.fl-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.fl-field__help { font-size: 12.5px; color: var(--ink-muted); margin: 6px 0 0; }
.fl-field__error { font-size: 12.5px; color: var(--danger); margin: 6px 0 0; }

/* ---------- Chips ---------- */
.fl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-chip {
  display: inline-flex; align-items: center;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.fl-chip.is-on {
  background: var(--teal-soft);
  border-color: var(--anchor-teal);
  color: var(--teal-ink);
  font-weight: 600;
}

/* ---------- Mobile bottom CTA ---------- */
.fl-bottom-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: none;
  z-index: 30;
  box-shadow: 0 -4px 12px rgba(7,61,55,0.06);
}
.fl-bottom-cta .fl-btn { width: 100%; }
@media (max-width: 640px) {
  .fl-bottom-cta.is-active { display: block; }
  body.has-bottom-cta { padding-bottom: 84px; }
}

/* ---------- Footer ---------- */
.fl-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.fl-footer a { color: var(--ink-soft); }
.fl-footer__row { margin-bottom: 6px; }
.fl-footer__row:last-child { margin-bottom: 0; }

/* ---------- Utility ---------- */
.fl-text-center { text-align: center; }
.fl-mt-0 { margin-top: 0; }
.fl-mt-sm { margin-top: 8px; }
.fl-mt-md { margin-top: 16px; }
.fl-mt-lg { margin-top: 28px; }
.fl-hidden { display: none !important; }
.fl-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
