/* ─────────────────────────────────────────────────────────────────────────────
   THE FAMILY CEO — Design System
   Dark · Gold · Mobile-first
───────────────────────────────────────────────────────────────────────────── */

.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;
}

:root {
  --gold:          #C9A96E;
  --gold-light:    #E8D5A3;
  --gold-dark:     #9E7A45;
  --gold-subtle:   rgba(201,169,110,.12);
  --black:         #0D0D0D;
  --dark:          #1A1A1A;
  --dark2:         #242424;
  --dark3:         #2E2E2E;
  --dark4:         #3A3A3A;
  --text:          #F0EDE6;
  --text-muted:    #8A8178;
  --text-faint:    #5A534C;
  --success:       #4CAF7D;
  --success-bg:    rgba(76,175,125,.15);
  --error:         #E05C5C;

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
  --nav-h:         68px;
  --topbar-h:      52px;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

html, body {
  height: 100%;
  background: var(--black);
  color: var(--text);
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#fc-app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--black);
  position: relative;
  overflow-x: hidden;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────────── */

h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; }
p  { font-size: 14.5px; line-height: 1.65; color: var(--text-muted); }

.fc-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
}

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */

.fc-screen {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.fc-screen--full {
  min-height: 100dvh;
  padding-bottom: 0;
}

.fc-page-header {
  padding: 56px 20px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.fc-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-subtle);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.fc-scroll {
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── TOP VIEW SWITCHER (Admin only) ─────────────────────────────────────── */

#fc-topbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 110;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: center;
}
#fc-topbar:empty { display: none; }

.fc-view-switch {
  display: flex;
  width: 100%;
  max-width: 240px;
  background: var(--dark2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.fc-view-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.fc-view-btn.active {
  background: var(--gold);
  color: var(--black);
}

body.fc-has-topbar .fc-page-header {
  padding-top: calc(var(--topbar-h) + 16px);
}
body.fc-has-topbar .fc-cockpit-header {
  padding-top: calc(var(--topbar-h) + 16px);
}

/* ── BOTTOM NAV ──────────────────────────────────────────────────────────── */

.fc-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-h);
  background: rgba(26,26,26,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fc-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.fc-nav-item svg { width: 22px; height: 22px; }

.fc-nav-item.active { color: var(--gold); }

.fc-nav-item.active svg path,
.fc-nav-item.active svg rect,
.fc-nav-item.active svg circle { stroke: var(--gold); }


/* ── CARDS ───────────────────────────────────────────────────────────────── */

.fc-card {
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.fc-card--gold {
  background: linear-gradient(135deg, rgba(201,169,110,.18) 0%, rgba(201,169,110,.06) 100%);
  border-color: rgba(201,169,110,.25);
}

.fc-card--action {
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.fc-card--action:active { transform: scale(.98); }

/* ── STREAK HERO ─────────────────────────────────────────────────────────── */

.fc-streak-hero {
  background: linear-gradient(160deg, #1F1A12 0%, #0D0D0D 100%);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.fc-streak-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(201,169,110,.12) 0%, transparent 70%);
  pointer-events: none;
}

.fc-streak-number {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -.02em;
}

.fc-streak-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── XP BAR ──────────────────────────────────────────────────────────────── */

.fc-xp-bar {
  height: 6px;
  background: var(--dark3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.fc-xp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 3px;
  transition: width .4s cubic-bezier(.34,1.56,.64,1);
}

.fc-level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.fc-level-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

.fc-xp-text {
  font-size: 11px;
  color: var(--text-faint);
}

/* ── QUICK WINS ──────────────────────────────────────────────────────────── */

.fc-quick-wins {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fc-win-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}

.fc-win-item:active { background: var(--dark3); }

.fc-win-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--dark4);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}

.fc-win-item.done .fc-win-check {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.fc-win-label {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.fc-win-item.done .fc-win-label {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.fc-win-xp {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

/* ── ACTION CARDS (Reflexion, Family Board) ──────────────────────────────── */

.fc-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fc-action-card {
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}

.fc-action-card:active { opacity: .85; }

.fc-action-card.done {
  border-color: rgba(76,175,125,.3);
  background: rgba(76,175,125,.06);
}

.fc-action-icon {
  font-size: 26px;
  line-height: 1;
}

.fc-action-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.fc-action-sub {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */

.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  line-height: 1;
}

.fc-btn:active { transform: scale(.97); opacity: .9; }

.fc-btn-primary {
  background: var(--gold);
  color: var(--black);
  width: 100%;
}

.fc-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--dark3);
  width: 100%;
}

.fc-btn-danger {
  background: rgba(224,92,92,.15);
  color: var(--error);
  border: 1.5px solid rgba(224,92,92,.25);
  width: 100%;
}

.fc-btn:disabled {
  opacity: .4;
  pointer-events: none;
}

/* ── INPUTS ──────────────────────────────────────────────────────────────── */

.fc-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--dark2);
  border: 1.5px solid var(--dark4);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.fc-input:focus { border-color: var(--gold); }
.fc-input::placeholder { color: var(--text-faint); }

.fc-textarea {
  resize: none;
  min-height: 120px;
  line-height: 1.65;
}

.fc-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8178' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── BADGE ───────────────────────────────────────────────────────────────── */

.fc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.fc-badge--gold {
  background: var(--gold-subtle);
  color: var(--gold);
  border: 1px solid rgba(201,169,110,.3);
}

.fc-badge--success {
  background: var(--success-bg);
  color: var(--success);
}

/* ── PROGRESS RING ───────────────────────────────────────────────────────── */

.fc-ring {
  transform: rotate(-90deg);
}

/* ── ONBOARDING ──────────────────────────────────────────────────────────── */

.fc-onboarding {
  min-height: 100dvh;
  padding: 56px 24px 40px;
  display: flex;
  flex-direction: column;
}

.fc-ob-step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
}

.fc-ob-step-dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--dark3);
  transition: background .3s;
}

.fc-ob-step-dot.active { background: var(--gold); }
.fc-ob-step-dot.done { background: var(--gold-dark); }

.fc-ob-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fc-ob-nav {
  display: flex;
  gap: 10px;
  margin-top: 32px;
}

/* ── BRAND VALUE CHIPS ───────────────────────────────────────────────────── */

.fc-value-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.fc-value-verantwortung { background: rgba(201,169,110,.15); color: #D4AA62; }
.fc-value-ehrlichkeit   { background: rgba(76,175,125,.12);  color: #5DC991; }
.fc-value-klarheit      { background: rgba(100,160,220,.12); color: #7BB8E8; }
.fc-value-fuehrung      { background: rgba(200,100,100,.12); color: #E08080; }
.fc-value-uebergreifend { background: rgba(160,120,220,.12); color: #B490E0; }

/* ── REFLECTION SCREEN ───────────────────────────────────────────────────── */

.fc-reflection-card {
  background: linear-gradient(160deg, #1A1810 0%, #0D0D0D 100%);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}

.fc-question-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}

/* ── PROGRESS SCREEN — HEATMAP ───────────────────────────────────────────── */

.fc-heatmap {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
}

.fc-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--dark3);
}

.fc-heatmap-cell.active { background: var(--gold); }
.fc-heatmap-cell.today  { background: var(--gold-light); }

/* ── BADGE GRID ──────────────────────────────────────────────────────────── */

.fc-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fc-badge-item {
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fc-badge-item.earned { border-color: rgba(201,169,110,.3); }
.fc-badge-item.locked { opacity: .35; }

.fc-badge-icon { font-size: 28px; }

.fc-badge-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── AUTH SCREEN ─────────────────────────────────────────────────────────── */

.fc-auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 0;
}

.fc-auth-logo {
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.fc-auth-headline {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.fc-auth-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.65;
}

.fc-auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── COCKPIT LAYOUT ──────────────────────────────────────────────────────── */

.fc-cockpit {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.fc-cockpit-header {
  padding: 56px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  margin-bottom: 4px;
}

.fc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fc-kpi-tile {
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.fc-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── ATTENTION LIST ──────────────────────────────────────────────────────── */

.fc-attention-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}

.fc-attention-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.fc-attention-dot.high   { background: var(--error); }
.fc-attention-dot.medium { background: var(--gold); }
.fc-attention-dot.low    { background: var(--success); }

/* ── UTILS ───────────────────────────────────────────────────────────────── */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

.text-gold  { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }

.divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 4px 0;
}

/* ── TOAST ───────────────────────────────────────────────────────────────── */

#fc-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  max-width: 390px;
  width: calc(100% - 40px);
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  z-index: 9999;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  text-align: center;
}

#fc-toast.show { transform: translateX(-50%) translateY(0); }
#fc-toast.success { border-color: rgba(76,175,125,.4); color: var(--success); }
#fc-toast.error   { border-color: rgba(224,92,92,.4);  color: var(--error); }

/* ── SPINNER ─────────────────────────────────────────────────────────────── */

.fc-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--dark3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: fc-spin .6s linear infinite;
  margin: 40px auto;
}

@keyframes fc-spin { to { transform: rotate(360deg); } }

/* ── FAMILY BOARD ────────────────────────────────────────────────────────── */

.fc-board-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: border-color .15s;
}

.fc-board-step:active { opacity: .85; }

.fc-board-step.active { border-color: rgba(201,169,110,.4); }
.fc-board-step.done   { border-color: rgba(76,175,125,.3); background: rgba(76,175,125,.05); }

.fc-board-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--dark3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.fc-board-step.active .fc-board-step-num { background: var(--gold); color: var(--black); }
.fc-board-step.done   .fc-board-step-num { background: var(--success-bg); color: var(--success); }

/* ── STAR RATING ─────────────────────────────────────────────────────────── */

.fc-stars {
  display: flex;
  gap: 6px;
}

.fc-star {
  font-size: 28px;
  cursor: pointer;
  transition: transform .1s;
  filter: grayscale(1);
  opacity: .4;
  -webkit-tap-highlight-color: transparent;
}

.fc-star.active {
  filter: none;
  opacity: 1;
  transform: scale(1.15);
}

/* ── SAFE AREA ───────────────────────────────────────────────────────────── */

.fc-screen { padding-top: env(safe-area-inset-top, 0px); }
