/* Flexing Data Hub — styles. Source of truth: DESIGN.md (tokens §2–4, recipes §5). */

:root {
  /* brand core */
  --fd-ink: #18222F;
  --fd-blue: #0A96C7;
  --fd-blue-deep: #0A7BA6;
  --fd-coral: #FF9D83;
  --fd-cream: #FFF4E9;
  --fd-deep: #101820;

  /* warm neutrals */
  --fd-paper: #FFFAF4;
  --fd-paper-2: #FFF3E9;
  --fd-white: #FFFFFF;
  --fd-ink-2: #44515F;
  --fd-muted: #6C7785;
  --fd-line: rgba(24, 34, 47, .09);

  /* accent tints + deep text (always paired) */
  --fd-blue-soft: #E4F4FB;   --fd-blue-text: #0A7BA6;
  --fd-coral-soft: #FFEDE6;  --fd-coral-text: #D4502B;
  --fd-amber-soft: #FFF5DF;  --fd-amber-text: #9A6206;
  --fd-teal-soft: #E6F6F0;   --fd-teal-text: #0C7A5A;
  --fd-violet-soft: #EFEAFF; --fd-violet-text: #5A3FD6;

  --grad-primary: linear-gradient(135deg, #0A96C7, #0A7BA6);
  --grad-warm: linear-gradient(135deg, #FF8A63, #FF9D83);

  --shadow-sm: 0 4px 14px -6px rgba(15, 42, 64, .18);
  --shadow: 0 22px 48px -22px rgba(15, 42, 64, .30);
  --shadow-btn-blue: 0 12px 26px -10px rgba(10, 150, 199, .6);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fd-paper);
  color: var(--fd-ink-2);
  font: 400 16px/1.7 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--fd-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.14;
}

a { color: var(--fd-blue-deep); text-decoration: none; }
::selection { background: var(--fd-blue-soft); color: var(--fd-blue-text); }

/* ── Logo ─────────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: baseline; gap: 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.logo-flexing { color: var(--fd-ink); }
.logo-data { color: var(--fd-blue); }
.logo-hub {
  background: var(--fd-blue-soft); color: var(--fd-blue-text);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px;
}
.logo-hub--admin { background: var(--fd-coral-soft); color: var(--fd-coral-text); }

/* ── Shell: top bar (mobile) ──────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px;
  background: rgba(255, 250, 244, .82);
  backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--fd-line);
}
.topbar-bell {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; font-size: 20px;
  transition: background .2s var(--ease);
}
.topbar-bell:hover { background: var(--fd-paper-2); }
.back-link { font-size: 14.5px; font-weight: 600; }

/* ── Shell: sidebar (desktop) ─────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: none; flex-direction: column;
  width: 240px; background: var(--fd-paper);
  border-right: 1px solid var(--fd-line);
}
.sidebar-logo { display: flex; align-items: center; height: 72px; padding: 0 20px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; }
.sidebar-nav:first-of-type { flex: 1; overflow-y: auto; }
.sidebar-nav--secondary { border-top: 1px solid var(--fd-line); padding: 12px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 13px;
  color: var(--fd-ink-2); font-size: 15px; font-weight: 600;
  transition: all .2s var(--ease);
}
.nav-link:hover { background: var(--fd-paper-2); color: var(--fd-ink); }
.nav-link.is-active { background: var(--fd-blue-soft); color: var(--fd-blue-text); }
.nav-emoji { font-size: 18px; }
.presence {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--fd-muted);
}
.presence-dot {
  width: 9px; height: 9px; border-radius: 999px; background: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .18);
}

/* ── Shell: bottom tabs (mobile) ──────────────────────────────────────── */
.bottomtabs {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 250, 244, .92);
  backdrop-filter: blur(14px) saturate(180%);
  border-top: 1px solid var(--fd-line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; }
.tab-emoji {
  display: flex; align-items: center; justify-content: center;
  height: 28px; padding: 0 16px; border-radius: 999px;
  font-size: 18px; line-height: 1; transition: background .2s var(--ease);
}
.tab-label { font-size: 11px; font-weight: 600; color: var(--fd-muted); }
.tab.is-active .tab-emoji { background: var(--fd-blue-soft); }
.tab.is-active .tab-label { color: var(--fd-blue-text); }

/* ── Main column ──────────────────────────────────────────────────────── */
.main {
  max-width: 680px; margin: 0 auto;
  padding: 24px 16px 112px;
}
.main--admin { max-width: 960px; padding-bottom: 40px; }

body.centered {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

@media (min-width: 1024px) {
  .topbar { display: none; }
  .sidebar { display: flex; }
  .bottomtabs { display: none; }
  .main { padding: 40px 24px; margin-left: calc(240px + (100% - 240px - 680px) / 2); }
  .main--admin { margin-left: auto; margin-right: auto; }
  .topbar--always { display: flex; }
}

/* ── Page header ──────────────────────────────────────────────────────── */
.page-header { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.page-header h1 { font-size: clamp(26px, 3.6vw, 40px); }
.hl { color: var(--fd-blue-deep); }
.lede { margin: 0; font-size: 15px; color: var(--fd-muted); }

/* ── Eyebrow (section-opener pill) ────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.eyebrow--blue   { background: var(--fd-blue-soft);   color: var(--fd-blue-text); }
.eyebrow--coral  { background: var(--fd-coral-soft);  color: var(--fd-coral-text); }
.eyebrow--amber  { background: var(--fd-amber-soft);  color: var(--fd-amber-text); }
.eyebrow--teal   { background: var(--fd-teal-soft);   color: var(--fd-teal-text); }
.eyebrow--violet { background: var(--fd-violet-soft); color: var(--fd-violet-text); }

/* ── Chip ─────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px;
  background: var(--fd-white); border: 1px solid var(--fd-line);
  box-shadow: var(--shadow-sm);
  font-size: 14.5px; font-weight: 600; color: var(--fd-ink);
}
.chip--muted { opacity: .6; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--fd-white);
  border: 1px solid var(--fd-line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  padding: 26px;
}
.card--link {
  display: flex; flex-direction: column; gap: 12px;
  color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card--link:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card--link h3 { font-size: 17px; }
.card--link p { margin: 0; font-size: 14.5px; color: var(--fd-muted); }
.card-cta { margin-top: auto; font-size: 14.5px; font-weight: 600; color: var(--fd-blue-deep); }

.icon-tile {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 15px;
  background: var(--fd-blue-soft); font-size: 24px;
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 26px; text-align: center;
}
.empty-emoji { font-size: 48px; }
.empty h3 { font-size: 22px; }
.empty p { margin: 0; max-width: 400px; font-size: 14.5px; color: var(--fd-muted); }
.empty .chip { margin-top: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 15px 26px; border: 0; border-radius: 13px;
  font: 700 16px 'Poppins', sans-serif; cursor: pointer;
  transition: all .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-btn-blue); }
.btn--ghost {
  background: var(--fd-white); color: var(--fd-ink);
  border: 1.5px solid var(--fd-line);
}
.btn--ghost:hover { border-color: var(--fd-blue); color: var(--fd-blue-deep); }

/* ── Stat tiles ───────────────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 16px; }
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--fd-blue-deep); }
.stat-caption { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fd-muted); }

/* ── Hub grid ─────────────────────────────────────────────────────────── */
.hub-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .hub-grid { grid-template-columns: 1fr 1fr; } }

/* ── Auth card ────────────────────────────────────────────────────────── */
.auth-card {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  max-width: 440px; width: 100%; padding: 32px; text-align: center;
}
.auth-card h1 { font-size: 26px; }
.auth-card p { margin: 0; font-size: 14.5px; color: var(--fd-muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Forms (DESIGN.md input recipe) ──────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.auth-form--left { text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-size: 14px; font-weight: 600; color: var(--fd-ink); }
.field input, .field textarea {
  padding: 13px 15px; border-radius: 9px;
  border: 1.5px solid rgba(24, 34, 47, .12);
  background: var(--fd-white); color: var(--fd-ink);
  font: 400 16px 'Poppins', sans-serif;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--fd-blue);
  box-shadow: 0 0 0 3px rgba(10, 150, 199, .14);
}
.field .hint, .auth-form .hint { font-size: 13px; color: var(--fd-muted); }
.form-error { margin: 0; font-size: 14px; font-weight: 600; color: var(--fd-coral-text); }
.form-success { margin: 0; font-size: 14px; font-weight: 600; color: var(--fd-teal-text); }
.auth-card--wide { max-width: 520px; }

/* ── OTP boxes (golden rule: auto-verify on 6th digit) ───────────────── */
.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp-box {
  width: 44px; height: 52px; text-align: center;
  border: 1.5px solid rgba(24, 34, 47, .12); border-radius: 9px;
  background: var(--fd-white); color: var(--fd-ink);
  font: 800 22px 'Poppins', sans-serif;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.otp-box:focus { outline: none; border-color: var(--fd-blue); box-shadow: 0 0 0 3px rgba(10, 150, 199, .14); }
.otp-box.is-filled { border-color: var(--fd-blue); background: rgba(10, 150, 199, .05); }

/* ── Avatars (initials) ──────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--fd-blue-soft); color: var(--fd-blue-text);
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.avatar--lg { width: 64px; height: 64px; font-size: 28px; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 13px;
  color: var(--fd-ink-2); transition: background .2s var(--ease);
}
.user-row:hover { background: var(--fd-paper-2); }
.user-name { font-size: 14px; font-weight: 600; }

/* ── Skill picker ─────────────────────────────────────────────────────── */
.skill-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--pick { cursor: pointer; font-family: 'Poppins', sans-serif; transition: all .16s var(--ease); }
.chip--pick.is-picked {
  background: var(--fd-blue-soft); color: var(--fd-blue-text);
  border-color: var(--fd-blue);
}

/* ── Profile & settings ──────────────────────────────────────────────── */
.profile-card { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.profile-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.stat-row--profile { margin: 0; grid-template-columns: repeat(2, auto); gap: 28px; }
.profile-headline { margin: 0; font-weight: 600; color: var(--fd-ink); }
.profile-bio { margin: 0; font-size: 14.5px; }
.card-title { margin-bottom: 16px; font-size: 17px; }
.settings-card { display: flex; flex-direction: column; padding: 8px 26px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--fd-line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row h4 { font-size: 15px; }
.settings-row p { margin: 0; font-size: 14px; color: var(--fd-muted); }
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: 14.5px; }

/* ── Feed: composer ──────────────────────────────────────────────────── */
.page-header--row { flex-direction: row; align-items: flex-end; justify-content: space-between; width: 100%; }
.composer { margin-bottom: 20px; }
.composer form { display: flex; flex-direction: column; gap: 14px; }
.composer-top { display: flex; gap: 12px; }
.composer-top textarea {
  flex: 1; border: 0; resize: vertical; min-height: 48px;
  font: 400 16px/1.6 'Poppins', sans-serif; color: var(--fd-ink);
  background: transparent; padding: 6px 0;
}
.composer-top textarea:focus { outline: none; }
.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-picker .chip { padding: 8px 14px; font-size: 13px; box-shadow: none; }
.img-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.img-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 9px; border: 1px solid var(--fd-line); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; }

/* ── Feed: post cards ────────────────────────────────────────────────── */
.post-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.post-card--placement { border-color: rgba(255, 138, 99, .35); background: linear-gradient(180deg, #FFF9F6, #FFFFFF); }
.post-pin { align-self: flex-start; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-name { font-weight: 700; color: var(--fd-ink); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.post-meta { font-size: 13px; color: var(--fd-muted); }
.post-type { padding: 5px 11px; font-size: 11px; }
.mentor-badge {
  background: var(--fd-coral-soft); color: var(--fd-coral-text);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px;
}
.post-content { margin: 0; color: var(--fd-ink); font-size: 15.5px; overflow-wrap: break-word; }
.post-media { display: grid; gap: 6px; border-radius: 14px; overflow: hidden; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-media--1 img { max-height: 480px; }
.post-media--2, .post-media--4 { grid-template-columns: 1fr 1fr; }
.post-media--2 img, .post-media--3 img, .post-media--4 img { aspect-ratio: 1; }
.post-media--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Feed: actions ───────────────────────────────────────────────────── */
.post-actions { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--fd-line); padding-top: 12px; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--fd-muted);
  font: 600 14px 'Poppins', sans-serif;
  transition: all .16s var(--ease);
}
.action-btn:hover { background: var(--fd-paper-2); color: var(--fd-ink); }
.action-btn.is-liked { color: var(--fd-coral-text); background: var(--fd-coral-soft); }
.action-btn.is-marked { color: var(--fd-amber-text); background: var(--fd-amber-soft); }
.action-btn--danger { margin-left: auto; }
.action-btn--danger:hover { color: var(--fd-coral-text); background: var(--fd-coral-soft); }
.action-btn--tiny { padding: 4px 10px; font-size: 12.5px; }
.action-btn input[type=file] { display: none; }
.load-more { width: 100%; margin-top: 4px; }

/* ── Comments ────────────────────────────────────────────────────────── */
.comments-card { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.comments-card .card-title { margin-bottom: 0; }
.comments-empty { margin: 0; font-size: 14px; color: var(--fd-muted); }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--fd-line); }
.comment .avatar { width: 32px; height: 32px; font-size: 14px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fd-ink); }
.comment-text { margin: 2px 0 6px; font-size: 14.5px; overflow-wrap: break-word; }
.comment-actions { display: flex; gap: 4px; }
.comment-form { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--fd-line); padding-top: 16px; }
.comment-form .avatar { width: 32px; height: 32px; font-size: 14px; }
.comment-form input {
  flex: 1; padding: 11px 15px; border-radius: 999px;
  border: 1.5px solid rgba(24, 34, 47, .12); background: var(--fd-white);
  font: 400 15px 'Poppins', sans-serif; color: var(--fd-ink);
}
.comment-form input:focus { outline: none; border-color: var(--fd-blue); box-shadow: 0 0 0 3px rgba(10, 150, 199, .14); }

/* ── Notifications & bell badge ──────────────────────────────────────── */
.badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fd-coral); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px;
  margin-left: auto;
}
.topbar-bell { position: relative; }
.topbar-bell .badge { position: absolute; top: 2px; right: -2px; margin: 0; }
.notif-card { display: flex; flex-direction: column; padding: 8px; }
.notif-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 13px; color: var(--fd-ink-2);
  transition: background .16s var(--ease);
}
.notif-row:hover { background: var(--fd-paper-2); }
.notif-row.is-unread { background: var(--fd-blue-soft); }
.notif-row.is-unread .notif-text { color: var(--fd-ink); font-weight: 600; }
.notif-emoji { font-size: 20px; }
.notif-text { flex: 1; font-size: 14.5px; }

/* ── Announcements ───────────────────────────────────────────────────── */
.announce-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.announce-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.announce-head .post-meta { margin-left: auto; }
.announce-card h3 { font-size: 19px; }
.announce-body { margin: 0; font-size: 15px; }
.announce-link { align-self: flex-start; }
.announce-admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; margin-bottom: 10px;
}
.announce-admin-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.announce-admin-main strong { color: var(--fd-ink); }
.announce-admin-actions { display: flex; gap: 4px; flex-shrink: 0; }
.check-row { display: flex; gap: 16px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--fd-ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--fd-blue); }
.btn--warm { background: var(--grad-warm); color: #fff; box-shadow: 0 12px 26px -10px rgba(255,138,99,.6); }
