/* ==========================================================================
   NFC Fiber Exchange — Design System v2
   Rebuilt to match the Natural Fiber Brand Guideline (2026):
   - Primary: Dark Spring Green #15704f, Light Olive Green #98c550
   - Secondary: White #ffffff, Black #2d2d2d
   - Heading font: Klyra (matched here with Poppins — see note below)
   - Body font: Gilroy (matched here with Manrope — see note below)
   Klyra and Gilroy are commercial fonts with no free web-embed license;
   swap the @font-face block below for the real files if you own them.
   ========================================================================== */

:root {
  --forest:        #15704f;  /* Dark Spring Green — brand primary */
  --forest-dark:    #0e5138;
  --lime:           #98c550;  /* Light Olive Green — brand primary */
  --lime-dark:      #7ba33d;
  --ink:            #2d2d2d;  /* brand secondary Black */
  --ink-soft:       #6b6b6b;
  --paper:          #ffffff;  /* brand secondary White */
  --paper-tint:     #f6f9f4;  /* very light green-white tint, sparing use only */
  --line:           #e3e8df;
  --alert:          #b3462c;
  --alert-bg:       #f7e9e4;
  --approved-bg:    #eaf3e6;

  /* Real Klyra/Gilroy files: replace these two lines with your @font-face
     family names once uploaded, e.g. --font-display: 'Klyra', sans-serif; */
  --font-display: 'Poppins', -apple-system, sans-serif;
  --font-body:    'Manrope', -apple-system, sans-serif;

  --radius: 3px;
}

/* If you own the licensed Klyra / Gilroy font files, add them like this
   and switch the --font-display / --font-body variables above:
@font-face {
  font-family: 'Klyra';
  src: url('/assets/fonts/Klyra-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('/assets/fonts/Gilroy-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
*/

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.4em;
  line-height: 1.15;
  font-weight: 800;
}

h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }

.tabular { font-variant-numeric: tabular-nums; }

/* ---- Brand pattern texture (used sparingly — hero + footer only) -------- */
.brand-weave {
  background-image:
    repeating-linear-gradient(60deg, rgba(152,197,80,0.10) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-60deg, rgba(21,112,79,0.08) 0 2px, transparent 2px 22px);
}

/* ---- Motion: one orchestrated entrance, respects reduced-motion --------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise-in {
  animation: riseIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rise-in-1 { animation-delay: 0.05s; }
.rise-in-2 { animation-delay: 0.15s; }
.rise-in-3 { animation-delay: 0.25s; }
.rise-in-4 { animation-delay: 0.35s; }

/* ---- Scroll-triggered reveal for sections below the fold ------------------ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal-in { opacity: 1; transform: translateY(0); }

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

/* ---- Focus visibility (accessibility floor) --------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.4em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); text-decoration: none; transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: #fff; text-decoration: none; transform: translateY(-1px); }

.btn-accent { background: var(--lime); color: var(--forest-dark); }
.btn-accent:hover { background: var(--lime-dark); text-decoration: none; transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); text-decoration: none; }

.btn-danger { background: var(--alert); color: #fff; }
.btn-danger:hover { background: #93381f; text-decoration: none; }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms --------------------------------------------------------------- */
.field { margin-bottom: 1.15em; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.4em;
}

.field-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.3em; }

input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%;
  padding: 0.7em 0.85em;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--forest);
}

textarea { resize: vertical; min-height: 100px; }

.field-error { color: var(--alert); font-size: 0.82rem; margin-top: 0.35em; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75em; }
.radio-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9em 1em;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.radio-card:has(input:checked) { border-color: var(--forest); background: var(--approved-bg); }
.radio-card input { margin-right: 0.5em; accent-color: var(--forest); }
.radio-card .radio-title { font-weight: 700; }
.radio-card .radio-desc { font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Alerts / flash messages --------------------------------------------- */
.alert {
  padding: 0.85em 1.1em;
  border-radius: var(--radius);
  border-left: 3px solid;
  font-size: 0.92rem;
  margin-bottom: 1.2em;
}
.alert-error   { background: var(--alert-bg); border-color: var(--alert); color: #7a3018; }
.alert-success { background: var(--approved-bg); border-color: var(--forest); color: var(--forest-dark); }
.alert-info    { background: #eef2f6; border-color: #4a6a8a; color: #33506b; }

/* ---- Badges --------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.25em 0.65em;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 2px;
}
.badge-pending  { background: #f4ead8; color: #8a6a2f; }
.badge-approved { background: var(--approved-bg); color: var(--forest-dark); }
.badge-rejected { background: var(--alert-bg); color: var(--alert); }
.badge-soldout  { background: #ececec; color: var(--ink-soft); }

/* ==========================================================================
   Auth screens (login / register / forgot-password) — split hero layout
   ========================================================================== */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-hero {
  background: var(--forest-dark);
  color: #fff;
  padding: 3.5em 3em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(115deg, rgba(152,197,80,0.6) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(25deg, rgba(255,255,255,0.35) 0 2px, transparent 2px 34px);
  pointer-events: none;
}

.auth-hero-brand { position: relative; }

.auth-hero-main { position: relative; max-width: 30ch; }
.auth-hero-main h1 { color: #fff; font-size: 2.3rem; }
.auth-hero-main p { color: rgba(255,255,255,0.82); }

.auth-hero-stats {
  position: relative;
  display: flex;
  gap: 2.2em;
  padding-top: 1.6em;
  border-top: 1px solid rgba(255,255,255,0.22);
}
.auth-hero-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--lime);
}
.auth-hero-stats div span { font-size: 0.78rem; color: rgba(255,255,255,0.75); }

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3em 2em;
}

.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { margin-bottom: 0.2em; }
.auth-card .auth-sub { color: var(--ink-soft); margin-bottom: 1.6em; }

.auth-switch { margin-top: 1.4em; font-size: 0.9rem; color: var(--ink-soft); text-align: center; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ==========================================================================
   Dashboard shell — sidebar + main ledger area
   ========================================================================== */

.dash-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.dash-sidebar {
  background: var(--forest-dark);
  color: #fff;
  padding: 1.6em 1.2em;
  display: flex;
  flex-direction: column;
}

.dash-brand { margin-bottom: 0.2em; }
.dash-brand-sub { display: block; font-size: 0.68rem; font-weight: 400; color: rgba(255,255,255,0.6); margin-top: 0.35em; }

.dash-nav { margin-top: 2.2em; display: flex; flex-direction: column; gap: 0.15em; flex: 1; }
.dash-nav a {
  color: rgba(255,255,255,0.82);
  padding: 0.6em 0.7em;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.dash-nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.dash-nav a.active { background: var(--lime); color: var(--forest-dark); }

.dash-user {
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 1em;
  font-size: 0.85rem;
}
.dash-user .name { font-weight: 700; }
.dash-user .role { color: rgba(255,255,255,0.65); font-size: 0.78rem; text-transform: capitalize; }
.dash-user form { margin-top: 0.7em; }
.dash-user button {
  background: none; border: none; color: rgba(255,255,255,0.75);
  font-size: 0.82rem; cursor: pointer; padding: 0;
}
.dash-user button:hover { color: #fff; text-decoration: underline; }

.dash-main { padding: 2.2em 2.6em; max-width: 1180px; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.6em;
  gap: 1em;
  flex-wrap: wrap;
}
.dash-header p { margin: 0.2em 0 0; color: var(--ink-soft); }

/* ---- Stat strip ------------------------------------------------------------ */
.stat-strip { display: flex; gap: 0; border: 1px solid var(--line); background: var(--paper); margin-bottom: 1.8em; }
.stat-cell { flex: 1; padding: 1.1em 1.4em; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: none; }
.stat-cell .stat-label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.stat-cell .stat-value { font-family: var(--font-display); font-size: 1.6rem; color: var(--forest-dark); margin-top: 0.15em; font-weight: 800; }

/* ---- Ledger table (the core "trading floor" device) ------------------------ */
.ledger { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); }
.ledger th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger td {
  padding: 0.85em 1em;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: middle;
}
.ledger tr:last-child td { border-bottom: none; }
.ledger tr:hover td { background: var(--paper-tint); }
.ledger .price { font-family: var(--font-display); font-weight: 800; color: var(--forest-dark); }
.ledger .product-thumb {
  width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover;
  border: 1px solid var(--line); background: var(--paper-tint);
}
.ledger .row-title { font-weight: 700; }
.ledger .row-sub { color: var(--ink-soft); font-size: 0.82rem; }

.ledger-empty {
  text-align: center;
  padding: 3.5em 2em;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--line);
}
.ledger-empty h3 { color: var(--ink); }

/* ---- Cards ---------------------------------------------------------------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1.6em 1.8em;
}
.panel + .panel { margin-top: 1.2em; }

/* ---- Filter bar ------------------------------------------------------------- */
.filter-bar { display: flex; gap: 0.7em; margin-bottom: 1.2em; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input[type="text"] { width: auto; min-width: 160px; }

/* ---- Photo upload grid ------------------------------------------------------ */
.photo-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8em; }
.photo-slot {
  aspect-ratio: 1;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  position: relative;
  overflow: hidden;
}
.photo-slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Approval queue rows ----------------------------------------------------- */
.queue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em 1.2em;
  border: 1px solid var(--line);
  background: var(--paper);
  margin-bottom: 0.7em;
  gap: 1em;
  flex-wrap: wrap;
  transition: box-shadow 0.15s ease;
}
.queue-row:hover { box-shadow: 0 0 0 1px var(--lime); }
.queue-row .queue-meta { font-size: 0.82rem; color: var(--ink-soft); }
.queue-actions { display: flex; gap: 0.5em; }
.queue-actions form { display: inline; }

/* ---- Pending-approval notice screen ------------------------------------------ */
.center-notice {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em;
}
.center-notice .panel { max-width: 480px; text-align: center; }
.center-notice .notice-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--approved-bg); color: var(--forest);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1em; font-size: 1.5rem; font-family: var(--font-display); font-weight: 800;
}

/* ==========================================================================
   Landing / marketing page
   ========================================================================== */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.3em 3em; border-bottom: 1px solid var(--line);
}
.site-header nav a { margin-left: 1.6em; font-weight: 600; font-size: 0.92rem; color: var(--ink); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--forest);
  margin-bottom: 0.6em;
}
.eyebrow-dark { color: rgba(255,255,255,0.7); }

.landing-hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  padding: 4.5em 3em; gap: 3em; align-items: center;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.hero-watermark {
  position: absolute;
  top: 50%; left: -6%;
  transform: translateY(-50%);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
.landing-hero > div { position: relative; z-index: 1; }

.landing-hero h1 { font-size: 2.6rem; max-width: 16ch; }
.landing-hero p.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 42ch; }
.landing-hero-actions { display: flex; gap: 0.9em; margin-top: 1.5em; }

/* ---- Button arrow micro-interaction ---------------------------------------- */
.btn-arrow::after { content: '→'; margin-left: 0.3em; display: inline-block; transition: transform 0.15s ease; }
.btn-arrow:hover::after { transform: translateX(3px); }

/* ---- Material / product grid (real photography) ---------------------------- */
.material-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6em; margin-top: 1.8em; }
.material-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.material-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(21,112,79,0.12); }
.material-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.material-card-body { padding: 1.2em 1.3em; }
.material-card-body h3 { font-size: 1.05rem; margin-bottom: 0.35em; }
.material-card-body p { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }

/* ---- Benefit icon --------------------------------------------------------- */
.benefit-icon { color: var(--lime); font-size: 1.1rem; margin-bottom: 0.5em; }

/* ---- Sustainability stat dashboard (mirrors the main site) --------------- */
.stat-dashboard {
  background: var(--forest-dark);
  color: #fff;
  padding: 4em 3em;
  text-align: center;
}
.stat-dashboard-head { max-width: 60ch; margin: 0 auto 2.4em; }
.stat-dashboard-head h2 { color: #fff; }
.stat-dashboard-head p { color: rgba(255,255,255,0.75); margin: 0 auto; }
.stat-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.15);
  max-width: 980px;
  margin: 0 auto 2em;
  border: 1px solid rgba(255,255,255,0.15);
}
.stat-dash-cell { background: var(--forest-dark); padding: 1.8em 1.2em; }
.stat-dash-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; color: var(--lime); }
.stat-dash-label { font-size: 0.82rem; color: rgba(255,255,255,0.75); margin-top: 0.5em; }
.btn-on-dark.btn-outline { color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-on-dark.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---- Benefit grid (adapted from "Why Partner") ---------------------------- */
.benefit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4em; margin-top: 1.8em; }
.benefit-card { border: 1px solid var(--line); padding: 1.4em; border-radius: var(--radius); transition: border-color 0.15s ease; }
.benefit-card:hover { border-color: var(--lime); }
.benefit-card h3 { font-size: 1rem; margin-bottom: 0.4em; }
.benefit-card p { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }

/* ---- Mission / Vision ------------------------------------------------------- */
.mission-vision { display: grid; grid-template-columns: 1fr 1fr; gap: 3em; }
.mv-text { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--forest-dark); line-height: 1.4; max-width: 34ch; }

/* ---- Trusted-by ------------------------------------------------------------- */
.trusted-by { text-align: center; }
.trusted-by .eyebrow { text-align: center; }
.trusted-list { color: var(--ink-soft); font-size: 0.92rem; max-width: 70ch; margin: 0 auto; line-height: 1.9; }

/* ---- Footer (multi-column, mirrors main site structure) -------------------- */
.nfc-footer { padding: 3em 3em 1.5em; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5em; margin-bottom: 2em; }
.footer-grid h4 { font-family: var(--font-display); font-size: 0.85rem; margin-bottom: 0.8em; color: var(--ink); }
.footer-grid a { display: block; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.55em; }
.footer-grid a:hover { color: var(--forest); text-decoration: none; }
.footer-social { display: flex; gap: 1em; margin-top: 1em; }
.footer-social a { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--forest); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 1.4em; color: var(--ink-soft); font-size: 0.82rem; }

@media (max-width: 900px) {
  .stat-dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
  .material-grid { grid-template-columns: 1fr; }
  .mission-vision { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-watermark { display: none; }
}

.landing-panel {
  background: var(--forest-dark);
  color: #fff;
  padding: 2em;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.landing-panel::before {
  content: "";
  position: absolute; inset: 0; opacity: 0.14;
  background-image: repeating-linear-gradient(115deg, rgba(152,197,80,0.7) 0 2px, transparent 2px 26px);
}
.landing-panel .ticker-row {
  position: relative;
  display: flex; justify-content: space-between;
  padding: 0.8em 0; border-bottom: 1px solid rgba(255,255,255,0.18);
  font-size: 0.9rem;
}
.landing-panel .ticker-row:last-child { border-bottom: none; }
.landing-panel .ticker-row .tprice { font-family: var(--font-display); color: var(--lime); font-weight: 800; }

.landing-section { padding: 3.5em 3em; border-top: 1px solid var(--line); }
.landing-section.tinted { background: var(--paper-tint); }
.landing-section h2 { max-width: 20ch; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6em; margin-top: 1.8em; }
.how-step { border-left: 2px solid var(--lime); padding-left: 1em; }
.how-step h3 { font-size: 1rem; }
.how-step p { font-size: 0.9rem; color: var(--ink-soft); }

.site-footer { padding: 2em 3em; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.85rem; }

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .landing-hero { grid-template-columns: 1fr; padding: 2.5em 1.5em; }
  .landing-section, .site-header { padding-left: 1.5em; padding-right: 1.5em; }
  .how-steps { grid-template-columns: 1fr; }
  .dash-main { padding: 1.6em; }
}
