/* ──────────────────────────────────────────────────────────────
   DanoHub Forms — application styles
   Built on the Wanted Design System tokens (colors_and_type.css)
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* App-level accent (overridable by Tweaks — only --app-accent is set;
     the rest derive from it so one swap recolors everything) */
  --app-accent:        #0066ff;
  --app-accent-press:  color-mix(in srgb, var(--app-accent) 88%, #000);
  --app-accent-tint:   color-mix(in srgb, var(--app-accent) 12%, #fff);
  --app-accent-wash:   color-mix(in srgb, var(--app-accent) 6%, #fff);

  /* Density (overridable by Tweaks via [data-density]) */
  --d-section-y: 88px;   /* vertical rhythm between sections */
  --d-card-pad:  24px;
  --d-gap:       20px;
  --d-scale:     1;

  --maxw: 1200px;
  --nav-h: 66px;
}

[data-density="compact"]  { --d-section-y: 64px; --d-card-pad: 20px; --d-gap: 16px; --d-scale: 0.94; }
[data-density="spacious"] { --d-section-y: 112px; --d-card-pad: 30px; --d-gap: 26px; --d-scale: 1.06; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--fg-primary);
  background: var(--bg-base);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ── Top navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; height: var(--nav-h);
  display: flex; align-items: center; gap: 30px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand .mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand .name { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; color: var(--fg-primary); }
.brand .name b { color: var(--app-accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.012em;
  color: var(--fg-secondary); padding: 8px 12px; border-radius: 9px;
  transition: background 120ms ease, color 120ms ease;
}
.nav-links a:hover { background: var(--bg-muted); color: var(--fg-primary); }
.nav-links a.active { color: var(--app-accent); }
.nav-spacer { flex: 1; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px;
  background: var(--bg-muted); border-radius: 10px; width: 200px;
  color: var(--fg-tertiary); font-size: 13.5px; cursor: text;
}
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent;
  cursor: pointer; color: var(--fg-primary); display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--app-accent), #3385ff); color: #fff;
  font-weight: 700; font-size: 13px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.006em;
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn-lg { font-size: 16px; padding: 0 22px; height: 50px; border-radius: 13px; }
.btn-md { font-size: 14.5px; padding: 0 16px; height: 42px; border-radius: 11px; }
.btn-sm { font-size: 13px; padding: 0 12px; height: 34px; border-radius: 9px; }
.btn-primary { background: var(--app-accent); color: #fff; }
.btn-primary:hover { background: var(--app-accent-press); }
.btn-secondary { background: var(--bg-muted); color: var(--fg-primary); }
.btn-secondary:hover { background: #ebebed; }
.btn-outline { background: #fff; color: var(--fg-primary); box-shadow: inset 0 0 0 1px var(--border-default); }
.btn-outline:hover { background: var(--bg-subtle); }
.btn-ghost { background: transparent; color: var(--fg-secondary); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--fg-primary); }
.btn-block { width: 100%; }

/* ── Generic chip / tag / badge ─────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px;
  border-radius: var(--radius-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--border-default);
  font-size: 14px; font-weight: 600; color: var(--fg-secondary); cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.chip:hover { background: var(--bg-subtle); }
.chip.is-active { background: var(--app-accent); color: #fff; box-shadow: none; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; background: var(--bg-muted); color: var(--fg-secondary);
}
.tag.accent { background: var(--app-accent-tint); color: var(--app-accent); }
.tag.green  { background: #e7f8ee; color: #00a838; }
.tag.amber  { background: #fff1e6; color: #e25500; }
.tag.violet { background: var(--w-violet-100); color: var(--w-violet-700); }

/* ── Section heading ────────────────────────────────────────── */
.section { padding-top: var(--d-section-y); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.sec-head .title { font-size: 27px; font-weight: 700; letter-spacing: -0.025em; }
.sec-head .sub { margin-top: 6px; font-size: 15px; color: var(--fg-tertiary); font-weight: 500; }
.sec-head .more { font-size: 14px; font-weight: 600; color: var(--fg-secondary); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.sec-head .more:hover { color: var(--app-accent); }

/* ── Card (form) ────────────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius-xl);
  padding: var(--d-card-pad); cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.card:hover { box-shadow: var(--shadow-card); border-color: var(--border-default); transform: translateY(-3px); }
.card .ficon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--app-accent-wash); color: var(--app-accent); flex-shrink: 0;
}
.card .ftitle { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.4; }
.card .fdesc { font-size: 13.5px; color: var(--fg-tertiary); line-height: 1.55; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .fmeta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--fg-tertiary); font-weight: 500; margin-top: auto; }
.card .fmeta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--w-coolNeutral-300); }
.card .fmeta b { color: var(--fg-secondary); font-weight: 600; }

/* footer */
.footer { margin-top: var(--d-section-y); border-top: 1px solid var(--border-subtle); background: var(--bg-subtle); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 28px 56px; display: flex; flex-wrap: wrap; gap: 40px 80px; }
.footer .col h5 { font-size: 13px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em; }
.footer .col a { display: block; text-decoration: none; color: var(--fg-tertiary); font-size: 13.5px; font-weight: 500; margin-bottom: 9px; }
.footer .col a:hover { color: var(--fg-secondary); }
.footer .legal { width: 100%; margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--border-subtle);
  font-size: 12.5px; color: var(--fg-tertiary); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }


/* ── Mobile navigation (opt-in via body.has-mobile-nav) ─────── */
.mobile-nav-toggle,
.mobile-nav-panel { display: none; }

@media (max-width: 768px) {
  body.has-mobile-nav { --nav-h: 58px; }
  body.has-mobile-nav .nav-inner { height: var(--nav-h); padding: 0 14px; gap: 8px; min-width: 0; }
  body.has-mobile-nav .brand { min-width: 0; flex: 1 1 auto; }
  body.has-mobile-nav .brand .mark { width: 28px; height: 28px; }
  body.has-mobile-nav .brand .name { min-width: 0; font-size: 16px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.has-mobile-nav .nav-links,
  body.has-mobile-nav .nav-spacer,
  body.has-mobile-nav .nav-right > .icon-btn,
  body.has-mobile-nav .nav-right > .btn,
  body.has-mobile-nav .nav-right > .avatar { display: none; }
  body.has-mobile-nav .nav-right { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
  body.has-mobile-nav .nav-search { width: 38px; height: 38px; padding: 0; justify-content: center; gap: 0; overflow: hidden; font-size: 0; cursor: pointer; }
  body.has-mobile-nav .nav-search svg { width: 18px; height: 18px; flex-shrink: 0; }
  body.has-mobile-nav .mobile-nav-toggle { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--fg-primary); cursor: pointer; display: grid; place-items: center; }
  body.has-mobile-nav .mobile-nav-toggle:hover,
  body.has-mobile-nav .mobile-nav-toggle[aria-expanded="true"] { background: var(--bg-muted); }
  body.has-mobile-nav .mobile-nav-toggle svg { width: 21px; height: 21px; }
  body.has-mobile-nav .mobile-nav-panel { position: fixed; z-index: 59; top: var(--nav-h); left: 0; right: 0; display: none; padding: 10px 14px 16px; background: rgba(255,255,255,0.98); border-bottom: 1px solid var(--border-subtle); box-shadow: var(--shadow-card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  body.has-mobile-nav .mobile-nav-panel.is-open { display: block; }
  body.has-mobile-nav .mobile-nav-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 520px; margin: 0 auto; }
  body.has-mobile-nav .mobile-nav-menu a { min-width: 0; padding: 12px 13px; border-radius: 9px; text-decoration: none; color: var(--fg-secondary); font-size: 14px; font-weight: 700; line-height: 1.3; letter-spacing: 0; white-space: nowrap; }
  body.has-mobile-nav .mobile-nav-menu a:hover,
  body.has-mobile-nav .mobile-nav-menu a:focus-visible { background: var(--bg-muted); color: var(--fg-primary); }
  body.has-mobile-nav.mobile-nav-open { overflow: hidden; }
}
