/* ==========================================================================
   HandiClan — Brand Stylesheet v1.0
   Drop-in CSS for the HandiClan webapp and supporting sites.
   Built on the brand principles: trustworthy, friendly, enabling.
   ----------------------------------------------------------------------------
   IMPORTANT — language constraints (mirror the engineering constraints):
   Class names and component labels reference "credits", "hours", "give",
   "receive". They never reference "wage", "payment", "salary", "earn money",
   or "compensation". If you add new components, follow the same rule.
   ========================================================================== */

/* ---------- Design tokens ------------------------------------------------- */
:root {
  /* Brand palette — primary */
  --hc-clan:        #1F7A6B;  /* Clan Teal — primary brand, trust + growth   */
  --hc-clan-deep:   #145C50;  /* Deep Clan — hover, pressed, accents          */
  --hc-clan-soft:   #E9F5F2;  /* Soft Clan — surfaces, hover wash             */

  /* Brand palette — accent */
  --hc-hour:        #F4A261;  /* Hour Amber — the credit, time, warmth        */
  --hc-hour-deep:   #D8823F;  /* Deep Hour — pressed/active states            */
  --hc-hour-soft:   #FCEFDF;  /* Soft Hour — credit chips, highlight bg       */

  /* Neutrals — warm, not cold */
  --hc-ink:         #1B3A3A;  /* Primary text — deep teal-charcoal            */
  --hc-ink-2:       #4A5C5C;  /* Secondary text                               */
  --hc-ink-3:       #7A8A8A;  /* Tertiary text, captions                      */
  --hc-line:        #DCE4E2;  /* Borders, dividers                            */
  --hc-paper:       #FAF6EE;  /* Page background — warm off-white             */
  --hc-surface:     #FFFFFF;  /* Cards, sheets                                */
  --hc-surface-2:   #F4EFE5;  /* Alt surface                                  */

  /* Semantic */
  --hc-success:     #2E8C5F;  /* Job completed, endorsement received          */
  --hc-warn:        #C9853B;  /* Needs attention                              */
  --hc-danger:      #B5483F;  /* Errors, blocked actions                      */
  --hc-info:        --hc-clan;

  /* Typography */
  --hc-font-sans:   "Inter", "Helvetica Neue", system-ui, -apple-system,
                    "Segoe UI", Roboto, Arial, sans-serif;
  --hc-font-display:"Inter", "Helvetica Neue", system-ui, sans-serif;
  --hc-font-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
                    Consolas, monospace;

  --hc-fs-xs:    0.75rem;   /* 12 */
  --hc-fs-sm:    0.875rem;  /* 14 */
  --hc-fs-md:    1rem;      /* 16 */
  --hc-fs-lg:    1.125rem;  /* 18 */
  --hc-fs-xl:    1.375rem;  /* 22 */
  --hc-fs-2xl:   1.75rem;   /* 28 */
  --hc-fs-3xl:   2.25rem;   /* 36 */
  --hc-fs-4xl:   3rem;      /* 48 */

  --hc-lh-tight: 1.15;
  --hc-lh-snug:  1.35;
  --hc-lh-base:  1.55;

  /* Spacing — 4px base */
  --hc-sp-1:  4px;
  --hc-sp-2:  8px;
  --hc-sp-3:  12px;
  --hc-sp-4:  16px;
  --hc-sp-5:  20px;
  --hc-sp-6:  24px;
  --hc-sp-8:  32px;
  --hc-sp-10: 40px;
  --hc-sp-12: 48px;
  --hc-sp-16: 64px;

  /* Radii — friendly, rounded but not bubbly */
  --hc-radius-xs: 6px;
  --hc-radius-sm: 10px;
  --hc-radius-md: 14px;
  --hc-radius-lg: 20px;
  --hc-radius-xl: 28px;
  --hc-radius-pill: 999px;

  /* Shadows — soft, ambient, never heavy */
  --hc-shadow-1: 0 1px 2px rgba(27, 58, 58, 0.06),
                 0 1px 1px rgba(27, 58, 58, 0.04);
  --hc-shadow-2: 0 4px 12px rgba(27, 58, 58, 0.08),
                 0 1px 3px  rgba(27, 58, 58, 0.05);
  --hc-shadow-3: 0 12px 28px rgba(27, 58, 58, 0.10),
                 0 4px 8px   rgba(27, 58, 58, 0.06);

  /* Motion */
  --hc-ease:      cubic-bezier(0.2, 0.8, 0.2, 1);
  --hc-dur-fast:  120ms;
  --hc-dur-base:  200ms;
  --hc-dur-slow:  320ms;

  /* Layout */
  --hc-container: 1140px;
  --hc-focus-ring: 0 0 0 3px rgba(31, 122, 107, 0.25);
}

/* ---------- Dark mode (optional, opt-in via class) ------------------------ */
.hc-dark, [data-theme="dark"] {
  --hc-paper:    #0F1F1E;
  --hc-surface:  #16302E;
  --hc-surface-2:#1C3A37;
  --hc-ink:      #EDEFEC;
  --hc-ink-2:    #B8C5C2;
  --hc-ink-3:    #88989A;
  --hc-line:     #294744;
  --hc-clan-soft:#1C3A37;
  --hc-hour-soft:#3A2E1E;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--hc-font-sans);
  font-size: var(--hc-fs-md);
  line-height: var(--hc-lh-base);
  color: var(--hc-ink);
  background: var(--hc-paper);
}

::selection { background: var(--hc-hour-soft); color: var(--hc-ink); }

a {
  color: var(--hc-clan);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--hc-dur-fast) var(--hc-ease);
}
a:hover { color: var(--hc-clan-deep); }
a:focus-visible { outline: none; box-shadow: var(--hc-focus-ring); border-radius: var(--hc-radius-xs); }

/* ---------- Typography ---------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--hc-font-display);
  color: var(--hc-ink);
  margin: 0 0 var(--hc-sp-4);
  line-height: var(--hc-lh-tight);
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 { font-size: var(--hc-fs-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--hc-fs-3xl); }
h3 { font-size: var(--hc-fs-2xl); }
h4 { font-size: var(--hc-fs-xl); }
h5 { font-size: var(--hc-fs-lg); }

p { margin: 0 0 var(--hc-sp-4); }
small, .hc-caption { font-size: var(--hc-fs-sm); color: var(--hc-ink-2); }

.hc-eyebrow {
  font-size: var(--hc-fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hc-clan);
}

/* ---------- Layout helpers ----------------------------------------------- */
.hc-container {
  max-width: var(--hc-container);
  margin-inline: auto;
  padding-inline: var(--hc-sp-6);
}
.hc-stack > * + * { margin-top: var(--hc-sp-4); }
.hc-row { display: flex; gap: var(--hc-sp-4); align-items: center; }
.hc-row--between { justify-content: space-between; }
.hc-grid { display: grid; gap: var(--hc-sp-6); }
@media (min-width: 720px)  { .hc-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .hc-grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Buttons ------------------------------------------------------- */
.hc-btn {
  --_bg:     var(--hc-clan);
  --_fg:     #FFFFFF;
  --_bd:     var(--hc-clan);
  --_hover:  var(--hc-clan-deep);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hc-sp-2);
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  font-size: var(--hc-fs-md);
  line-height: 1;
  color: var(--_fg);
  background: var(--_bg);
  border: 1.5px solid var(--_bd);
  border-radius: var(--hc-radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--hc-dur-fast) var(--hc-ease),
              transform   var(--hc-dur-fast) var(--hc-ease),
              box-shadow  var(--hc-dur-fast) var(--hc-ease);
  box-shadow: var(--hc-shadow-1);
}
.hc-btn:hover     { background: var(--_hover); border-color: var(--_hover); }
.hc-btn:active    { transform: translateY(1px); box-shadow: none; }
.hc-btn:focus-visible { outline: none; box-shadow: var(--hc-focus-ring), var(--hc-shadow-1); }
.hc-btn:disabled  { opacity: 0.5; cursor: not-allowed; }

.hc-btn--secondary {
  --_bg: transparent;
  --_fg: var(--hc-clan);
  --_bd: var(--hc-clan);
  --_hover: var(--hc-clan-soft);
}
.hc-btn--secondary:hover { background: var(--hc-clan-soft); color: var(--hc-clan-deep); }

.hc-btn--ghost {
  --_bg: transparent;
  --_fg: var(--hc-ink);
  --_bd: transparent;
  --_hover: var(--hc-clan-soft);
  box-shadow: none;
}
.hc-btn--ghost:hover { background: var(--hc-clan-soft); color: var(--hc-clan-deep); }

.hc-btn--accent {
  --_bg: var(--hc-hour);
  --_fg: var(--hc-ink);
  --_bd: var(--hc-hour);
  --_hover: var(--hc-hour-deep);
}
.hc-btn--sm { padding: 8px 16px; font-size: var(--hc-fs-sm); }
.hc-btn--lg { padding: 16px 28px; font-size: var(--hc-fs-lg); }

/* ---------- Card ---------------------------------------------------------- */
.hc-card {
  background: var(--hc-surface);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
  padding: var(--hc-sp-6);
  box-shadow: var(--hc-shadow-1);
  transition: box-shadow var(--hc-dur-base) var(--hc-ease),
              transform  var(--hc-dur-base) var(--hc-ease);
}
.hc-card:hover { box-shadow: var(--hc-shadow-2); }
.hc-card--lift:hover { transform: translateY(-2px); }
.hc-card__title { font-size: var(--hc-fs-xl); margin: 0 0 var(--hc-sp-2); }
.hc-card__meta  { color: var(--hc-ink-3); font-size: var(--hc-fs-sm); }

/* ---------- Inputs -------------------------------------------------------- */
.hc-field { display: flex; flex-direction: column; gap: 6px; }
.hc-label { font-size: var(--hc-fs-sm); font-weight: 600; color: var(--hc-ink-2); }

.hc-input, .hc-select, .hc-textarea {
  width: 100%;
  font: inherit;
  font-size: var(--hc-fs-md);
  color: var(--hc-ink);
  background: var(--hc-surface);
  padding: 12px 14px;
  border: 1.5px solid var(--hc-line);
  border-radius: var(--hc-radius-md);
  transition: border-color var(--hc-dur-fast) var(--hc-ease),
              box-shadow   var(--hc-dur-fast) var(--hc-ease);
}
.hc-input:hover, .hc-select:hover, .hc-textarea:hover { border-color: var(--hc-ink-3); }
.hc-input:focus, .hc-select:focus, .hc-textarea:focus {
  outline: none;
  border-color: var(--hc-clan);
  box-shadow: var(--hc-focus-ring);
}
.hc-textarea { min-height: 120px; resize: vertical; line-height: var(--hc-lh-snug); }
.hc-help { font-size: var(--hc-fs-xs); color: var(--hc-ink-3); }

/* ---------- Credit chip — the signature HandiClan UI element ------------- */
/* Use anywhere a credit balance / time-credit amount is shown.
   Never label this as "wage", "pay", "balance owed", etc.                  */
.hc-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  background: var(--hc-hour-soft);
  color: var(--hc-ink);
  border-radius: var(--hc-radius-pill);
  font-weight: 600;
  font-size: var(--hc-fs-sm);
  font-variant-numeric: tabular-nums;
}
.hc-credit::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--hc-hour);
  box-shadow: inset 0 0 0 2px var(--hc-hour-soft);
}
.hc-credit__unit { color: var(--hc-ink-2); font-weight: 500; }
.hc-credit--lg { padding: 8px 16px 8px 12px; font-size: var(--hc-fs-md); }
.hc-credit--lg::before { width: 18px; height: 18px; }

/* ---------- Badges -------------------------------------------------------- */
.hc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--hc-fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--hc-radius-pill);
  background: var(--hc-clan-soft);
  color: var(--hc-clan-deep);
}
.hc-badge--success { background: #DDF1E5; color: #1B6B45; }
.hc-badge--warn    { background: #FBEAD3; color: #8B5A1F; }
.hc-badge--danger  { background: #F6DCD9; color: #7E2F28; }
.hc-badge--neutral { background: var(--hc-line); color: var(--hc-ink-2); }

/* ---------- Avatar -------------------------------------------------------- */
.hc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--hc-clan-soft);
  color: var(--hc-clan-deep);
  font-weight: 700;
  font-size: var(--hc-fs-sm);
  border: 2px solid var(--hc-surface);
}

/* ---------- Nav ----------------------------------------------------------- */
.hc-nav {
  display: flex;
  align-items: center;
  gap: var(--hc-sp-6);
  padding: var(--hc-sp-4) var(--hc-sp-6);
  background: var(--hc-surface);
  border-bottom: 1px solid var(--hc-line);
}
.hc-nav__brand {
  display: inline-flex; align-items: center; gap: var(--hc-sp-3);
  font-weight: 700; font-size: var(--hc-fs-lg);
  color: var(--hc-ink); text-decoration: none;
}
.hc-nav__brand b { color: var(--hc-clan); }
.hc-nav__link {
  color: var(--hc-ink-2);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--hc-radius-sm);
}
.hc-nav__link:hover { color: var(--hc-ink); background: var(--hc-clan-soft); }
.hc-nav__link.is-active { color: var(--hc-clan-deep); background: var(--hc-clan-soft); }

/* ---------- Utilities ----------------------------------------------------- */
.hc-text-clan    { color: var(--hc-clan) !important; }
.hc-text-hour    { color: var(--hc-hour-deep) !important; }
.hc-text-muted   { color: var(--hc-ink-3) !important; }
.hc-bg-paper     { background: var(--hc-paper) !important; }
.hc-bg-soft      { background: var(--hc-clan-soft) !important; }
.hc-bg-hour-soft { background: var(--hc-hour-soft) !important; }
.hc-rounded      { border-radius: var(--hc-radius-lg); }
.hc-shadow       { box-shadow: var(--hc-shadow-2); }

.hc-divider {
  height: 1px;
  background: var(--hc-line);
  border: 0;
  margin: var(--hc-sp-6) 0;
}

/* ---------- Accessibility prefs ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Print --------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .hc-btn, .hc-nav { display: none; }
}
