/* ─── APP CHROME ─────────────────────────────────────── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 58px;
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-med);
  box-shadow: 0 1px 4px rgba(43, 35, 25, 0.06);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.nav-logo:hover { color: var(--accent); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  font-size: 0.87rem;
  color: var(--fg-muted);
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.12s, background 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Primary — warm brick orange, Flat 2.0 solid */
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(196, 92, 42, 0.30);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(196, 92, 42, 0.35);
}

/* Green confirm */
.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 6px rgba(74, 124, 89, 0.22);
}

.btn-green:hover { box-shadow: 0 4px 12px rgba(74, 124, 89, 0.28); }

/* Accent alias */
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(196, 92, 42, 0.28);
}

.btn-accent:hover { background: var(--accent-hover); }

/* Ghost — warm paper look with clear border */
.btn-ghost {
  background: var(--bg-card);
  color: var(--fg-muted);
  border: 1px solid var(--border-med);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(43, 35, 25, 0.25);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.83rem;
  border-radius: var(--radius-sm);
}

.btn-full { width: 100%; justify-content: center; }

/* ─── ALERTS ─────────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.91rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.alert-error {
  background: rgba(196, 92, 42, 0.07);
  border-color: rgba(196, 92, 42, 0.20);
  color: #8b3a14;
}

.alert-success {
  background: var(--green-light);
  border-color: rgba(74, 124, 89, 0.22);
  color: var(--green);
}

.alert-info {
  background: var(--teal-light);
  border-color: rgba(59, 125, 140, 0.20);
  color: var(--teal);
}

/* ─── FORMS ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  padding: 11px 15px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  box-shadow: var(--shadow-sm);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fg-dim);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-sm);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.required { color: var(--accent); }

/* ─── AUTH PAGE ──────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 58px);
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 42px 38px;
  box-shadow: var(--shadow-md);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--fg);
}

.auth-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.55;
}

.auth-form { margin-top: 24px; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ─── BOARD LAYOUT ───────────────────────────────────── */
.board-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 28px;
  align-items: start;
}

.board-header { margin-bottom: 26px; }

.board-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--fg);
}

.board-sub { color: var(--fg-muted); font-size: 0.93rem; }

/* ─── POST CARDS — cork-board pins ───────────────────── */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.22s, transform 0.18s;
}

.post-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.post-author {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.post-category {
  font-size: 0.73rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-warm);
  color: var(--fg-dim);
  border: 1px solid var(--border-med);
}

.post-swap-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.half-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 6px;
}

.offer-half .half-label { color: var(--accent); }
.need-half  .half-label { color: var(--teal); }

.half-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
}

.half-detail {
  font-size: 0.81rem;
  color: var(--fg-dim);
  margin-top: 4px;
  line-height: 1.5;
}

.post-arrow {
  font-size: 1.2rem;
  color: var(--fg-dim);
  text-align: center;
}

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.empty-icon { font-size: 2.8rem; margin-bottom: 14px; }
.empty-state p { color: var(--fg-muted); margin-bottom: 20px; }

/* ─── SIDE PANEL ─────────────────────────────────────── */
.board-col-side {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.side-title {
  font-family: var(--font-display);
  font-size: 0.97rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
}

/* Small count pill — Flat 2.0 badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-warm);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--fg-muted);
  border: 1px solid var(--border-med);
}

.badge-green {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(74, 124, 89, 0.22);
}

.side-empty-text { color: var(--fg-dim); font-size: 0.87rem; }

.my-post-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.my-post-item:last-child { border-bottom: none; }

.my-post-status {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.status-open    { color: var(--green); }
.status-matched { color: var(--teal); }

.my-post-offer, .my-post-need {
  font-size: 0.84rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* ─── MATCH CARDS ────────────────────────────────────── */
.match-card {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.match-card:last-child { margin-bottom: 0; }

/* Accepted swap — subtle warm green tint */
.match-card-accepted {
  border-color: rgba(74, 124, 89, 0.22);
  background: var(--green-light);
}

.match-trade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.83rem;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.match-user-a, .match-user-b {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--fg);
  font-size: 0.82rem;
}

.match-gives { font-size: 0.82rem; }
.match-gives strong { color: var(--fg); }

.match-arrow { color: var(--fg-dim); }

.match-message {
  font-size: 0.82rem;
  color: var(--fg-dim);
  font-style: italic;
  margin: 6px 0;
  line-height: 1.4;
}

.match-actions { display: flex; gap: 8px; margin-top: 10px; }

.match-waiting {
  font-size: 0.79rem;
  color: var(--fg-dim);
  display: block;
  margin-top: 8px;
  font-style: italic;
}

.accepted-badge {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── NEW POST FORM ──────────────────────────────────── */
.form-page {
  max-width: 820px;
  margin: 0 auto;
}

.form-header { margin-bottom: 32px; }

.form-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--fg);
}

.form-sub { color: var(--fg-muted); font-size: 0.95rem; }

.swap-form {
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 38px;
  box-shadow: var(--shadow-md);
}

.swap-form-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.swap-form-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--fg-dim);
  padding-top: 56px;
}

.form-section-label {
  font-family: var(--font-body);
  font-size: 0.87rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.label-dot-orange { background: var(--accent); }
.label-dot-blue   { background: var(--teal); }

.form-group-inline { max-width: 280px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ─── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 35, 25, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lift);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--fg);
}

.modal-sub {
  color: var(--fg-muted);
  font-size: 0.91rem;
  margin-bottom: 22px;
}

.modal-their-post {
  background: var(--bg-warm);
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.91rem;
  color: var(--fg);
  font-family: var(--font-display);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .board-layout       { grid-template-columns: 1fr; }
  .board-col-side     { position: static; }
}

@media (max-width: 640px) {
  .swap-form-grid     { grid-template-columns: 1fr; }
  .swap-form-divider  { padding-top: 0; }
  .swap-form          { padding: 22px 18px; }
  .post-swap-row      { grid-template-columns: 1fr; }
  .post-arrow         { display: none; }
  .auth-card          { padding: 30px 22px; }
}
