/* ════════════════════════════════════════════════════════════════════════════
   FFH.Recalculate — Universal UI Stylesheet
   Version: 1.0.0
   Pair with: recalculate-engine.js
   Brand: FFH Academy (navy/orange/green/gold)
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --ffh-navy: #0f2044;
  --ffh-orange: #e8450a;
  --ffh-green: #16a34a;
  --ffh-gold: #f59e0b;
  --ffh-rose: #e11d48;
  --ffh-gray: #f4f6fa;
  --ffh-light: #e2e8f0;
  --ffh-mid: #6b7a99;
}

/* ── DRIFT BANNER ─────────────────────────────────────────────────────────── */
.ffh-recalc-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 560px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15,32,68,.18);
  border-left: 5px solid var(--ffh-orange);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9998;
  animation: ffh-recalc-slide-up .35s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@keyframes ffh-recalc-slide-up {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.ffh-recalc-banner-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.ffh-recalc-banner-text {
  flex: 1;
  font-size: .88rem;
  color: var(--ffh-navy);
  line-height: 1.4;
}
.ffh-recalc-banner-text strong { display: block; margin-bottom: 2px; font-size: .92rem; }
.ffh-recalc-banner-text span { color: var(--ffh-mid); font-size: .82rem; }
.ffh-recalc-banner-btn {
  background: var(--ffh-orange);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .2s;
}
.ffh-recalc-banner-btn:hover { background: #c73a08; }
.ffh-recalc-banner-close {
  background: none;
  border: none;
  color: var(--ffh-mid);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.ffh-recalc-banner-close:hover { color: var(--ffh-navy); }

/* ── SHEET (modal overlay) ─────────────────────────────────────────────────── */
.ffh-recalc-sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 68, .65);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: ffh-recalc-fade-in .25s ease;
}
@keyframes ffh-recalc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (min-width: 700px) {
  .ffh-recalc-sheet { align-items: center; padding: 20px; }
}

.ffh-recalc-card {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 720px;
  padding: 24px 22px 28px;
  position: relative;
  box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  max-height: 92vh;
  overflow-y: auto;
  animation: ffh-recalc-slide-up-sheet .3s ease;
}
@keyframes ffh-recalc-slide-up-sheet {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (min-width: 700px) {
  .ffh-recalc-card { border-radius: 20px; max-height: 88vh; }
}

.ffh-recalc-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--ffh-gray);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--ffh-mid);
  cursor: pointer;
  z-index: 2;
}
.ffh-recalc-close:hover { background: var(--ffh-light); color: var(--ffh-navy); }

.ffh-recalc-header {
  text-align: center;
  margin-bottom: 16px;
}
.ffh-recalc-badge {
  display: inline-block;
  background: var(--ffh-orange);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.ffh-recalc-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--ffh-navy);
  letter-spacing: -.3px;
}
.ffh-recalc-card h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--ffh-navy);
}
.ffh-recalc-goal-label {
  color: var(--ffh-mid);
  font-size: .88rem;
  margin: 0;
}
.ffh-recalc-help {
  color: var(--ffh-mid);
  font-size: .85rem;
  margin: 0 0 14px;
}

/* Coach Lucy bubble */
.ffh-recalc-coach {
  display: flex;
  gap: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left: 4px solid var(--ffh-orange);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: .92rem;
  color: var(--ffh-navy);
  line-height: 1.5;
}
.ffh-recalc-coach-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ffh-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
.ffh-recalc-coach strong { color: var(--ffh-orange); }

/* Tags row */
.ffh-recalc-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ffh-tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 10px;
}
.ffh-tag.me   { background: #dbeafe; color: #1e40af; }
.ffh-tag.we   { background: #fce7f3; color: #9d174d; }
.ffh-tag.ours { background: #d1fae5; color: #065f46; }

/* Choice grid */
.ffh-recalc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.ffh-recalc-choice {
  background: #fff;
  border: 2px solid var(--ffh-light);
  border-radius: 12px;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  font-size: .9rem;
  color: var(--ffh-navy);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ffh-recalc-choice:hover {
  border-color: var(--ffh-orange);
  background: #fff7ed;
  transform: translateY(-1px);
}
.ffh-recalc-choice-icon { font-size: 1.4rem; flex-shrink: 0; }
.ffh-recalc-choice-label { font-weight: 600; }
.ffh-recalc-choice-sub { font-size: .75rem; color: var(--ffh-mid); margin-top: 2px; }

.ffh-recalc-back {
  background: none;
  border: none;
  color: var(--ffh-mid);
  font-size: .85rem;
  cursor: pointer;
  margin-top: 12px;
  padding: 6px 0;
  font-family: inherit;
}
.ffh-recalc-back:hover { color: var(--ffh-orange); }

/* Plan view */
.ffh-recalc-recalibrated {
  display: inline-block;
  background: var(--ffh-green);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ffh-recalc-plan-title { margin: 0 0 14px; text-align: center; }

.ffh-recalc-coin-burst {
  text-align: center;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}
.ffh-recalc-coins { font-size: 1.5rem; font-weight: 800; color: #b45309; }
.ffh-recalc-coin-label { font-size: .78rem; color: #78350f; font-weight: 600; margin-top: 2px; }

.ffh-recalc-routes-label {
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ffh-navy);
}
.ffh-recalc-routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ffh-recalc-route {
  border: 2px solid var(--ffh-light);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  transition: all .2s;
}
.ffh-recalc-route:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.ffh-recalc-route.selected { border-color: var(--ffh-orange); background: #fff7ed; }
.ffh-recalc-route.scenic { border-top: 4px solid var(--ffh-green); }
.ffh-recalc-route.direct { border-top: 4px solid #2563eb; }
.ffh-recalc-route.detour { border-top: 4px solid var(--ffh-gold); }
.ffh-recalc-route-icon { font-size: 1.5rem; }
.ffh-recalc-route h4 { margin: 6px 0 4px; font-size: .98rem; color: var(--ffh-navy); }
.ffh-recalc-route-desc { font-size: .8rem; color: var(--ffh-mid); margin-bottom: 8px; }
.ffh-recalc-route-goal {
  font-size: .76rem;
  font-weight: 600;
  background: var(--ffh-gray);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ffh-navy);
}

.ffh-recalc-action-block {
  background: var(--ffh-gray);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.ffh-recalc-action-block h4 {
  margin: 0 0 10px;
  font-size: .92rem;
  color: var(--ffh-navy);
}
.ffh-recalc-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: .88rem;
  border-bottom: 1px solid var(--ffh-light);
  color: var(--ffh-navy);
}
.ffh-recalc-action:last-child { border-bottom: none; }
.ffh-recalc-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--ffh-mid);
  flex-shrink: 0;
  cursor: pointer;
  background: #fff;
}
.ffh-recalc-check.checked {
  background: var(--ffh-green);
  border-color: var(--ffh-green);
  position: relative;
}
.ffh-recalc-check.checked::after {
  content: '✓';
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.ffh-recalc-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ffh-recalc-resource {
  background: #eff6ff;
  color: #1e40af;
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  text-decoration: none;
}
.ffh-recalc-resource:hover { background: #dbeafe; }

.ffh-recalc-share {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.ffh-recalc-share h4 { margin: 0 0 6px; font-size: .92rem; color: #78350f; }
.ffh-recalc-share p { margin: 0 0 10px; font-size: .82rem; color: #78350f; }
.ffh-recalc-share-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ffh-recalc-share-btns button {
  background: #fff;
  border: 1px solid #fbbf24;
  color: #78350f;
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.ffh-recalc-share-btns button:hover { background: #fbbf24; color: #fff; }

.ffh-recalc-plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ffh-recalc-btn-primary,
.ffh-recalc-btn-secondary {
  flex: 1;
  min-width: 140px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.ffh-recalc-btn-primary { background: var(--ffh-orange); color: #fff; }
.ffh-recalc-btn-primary:hover { background: #c73a08; }
.ffh-recalc-btn-secondary { background: var(--ffh-gray); color: var(--ffh-navy); border: 2px solid var(--ffh-light); }
.ffh-recalc-btn-secondary:hover { background: var(--ffh-light); }

@media (max-width: 600px) {
  .ffh-recalc-banner { flex-wrap: wrap; }
  .ffh-recalc-banner-text { flex: 1 1 100%; order: 2; margin-top: 4px; }
  .ffh-recalc-banner-btn { order: 3; }
}
