/* ==========================================================================
   AWG Finance Support Portal — Shared Design System
   Inherits AWG Group design tokens. Finance pillar (green) primary accent.
   Version: 1.0.0 (May 2026)
   ========================================================================== */

/* === Design Tokens === */
:root {
  --parchment:        #F4F0E5;
  --parchment-warm:   #EEE9DC;
  --parchment-cool:   #F7F4EC;
  --parchment-near-white: #FBF9F3;
  --white:            #FFFFFF;

  --charcoal:         #323230;
  --charcoal-light:   #4A4A47;
  --charcoal-deep:    #1F1F1E;
  --charcoal-surface: #2A2A28;

  --border-light:     #E6E1D4;
  --border-charcoal:  #4A4A47;

  /* Finance pillar — primary accent */
  --green:            #006E41;
  --green-bright:     #307D61;
  --green-dim:        #00583A;
  --green-glow:       rgba(0, 110, 65, 0.10);
  --green-glow-strong:rgba(0, 110, 65, 0.18);

  /* Copper — AWG CTAs */
  --copper:           #BE5D03;
  --copper-dim:       #AB4903;
  --copper-glow:      rgba(190, 93, 3, 0.10);

  /* Amber — accents */
  --amber:            #F6B239;

  /* Text */
  --text-dark:        #323230;
  --text-mid:         #6A6A66;
  --text-light:       #8B8B86;
  --text-on-charcoal: #F4F0E5;
  --text-muted-charcoal: #8B8B86;

  /* Typography */
  --font-body:        'Work Sans', sans-serif;
  --font-mono:        'JetBrains Mono', monospace;

  /* Spacing */
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px;
  --sp-5: 40px; --sp-6: 48px; --sp-8: 64px; --sp-10: 80px;

  /* Shape */
  --radius:     10px;
  --radius-box: 15px;
  --max-w:      1200px;
  --content-w:  760px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

/* === Base === */
body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--parchment);
}

/* Grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === Typography === */
h1, h2, h3, h4, h5 { font-family: var(--font-body); font-weight: 700; line-height: 1.25; color: var(--text-dark); }
p { line-height: 1.65; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); }

/* === Top Bar === */
.topbar {
  background: var(--charcoal);
  padding: 0 var(--sp-3);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-charcoal);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--sp-3);
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-logo img { width: 36px; height: 36px; display: block; }
.topbar-logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.topbar-logo-brand {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-on-charcoal);
  letter-spacing: -0.01em;
}
.topbar-logo-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.topbar-nav a {
  text-decoration: none;
  color: var(--text-muted-charcoal);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,0.06); color: var(--text-on-charcoal); }
.topbar-nav a.active { color: var(--text-on-charcoal); font-weight: 600; }
.topbar-nav .btn-ticket {
  background: var(--green);
  color: var(--text-on-charcoal) !important;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-weight: 600;
}
.topbar-nav .btn-ticket:hover { background: var(--green-bright) !important; }
.topbar-back {
  font-size: 0.8125rem;
  color: var(--text-muted-charcoal);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-back:hover { color: var(--text-on-charcoal); }

/* === Hero === */
.hero {
  background: var(--charcoal-deep);
  padding: var(--sp-10) var(--sp-3) 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 800px 400px at 50% 100%, rgba(0,110,65,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-on-charcoal);
  margin-bottom: 10px;
  line-height: 1.15;
  position: relative;
}
.hero p {
  font-size: 1.0625rem;
  color: var(--text-muted-charcoal);
  margin-bottom: var(--sp-5);
  position: relative;
}

/* === Search === */
.search-wrap {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  height: 56px;
  border: 2px solid var(--border-charcoal);
  border-radius: var(--radius);
  padding: 0 52px 0 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--parchment-near-white);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-wrap input:focus { border-color: var(--green); background: var(--white); }
.search-wrap input::placeholder { color: var(--text-light); }
.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-box);
  box-shadow: 0 12px 40px rgba(50,50,48,0.16);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
  text-align: left;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--parchment); }
.search-result-title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px; }
.search-result-cat { font-size: 0.75rem; color: var(--text-light); }

/* === Page Header (sub-hero for inner pages) === */
.page-header {
  background: var(--charcoal);
  border-bottom: 1px solid var(--border-charcoal);
  padding: var(--sp-5) var(--sp-3);
}
.page-header-inner { max-width: var(--max-w); margin: 0 auto; }
.page-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-on-charcoal);
  margin-bottom: 6px;
}
.page-header p { font-size: 0.9375rem; color: var(--text-muted-charcoal); }

/* === Breadcrumb === */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted-charcoal);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted-charcoal); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-bright); }
.breadcrumb-sep { opacity: 0.4; }

/* === Main Wrapper === */
.main { max-width: var(--max-w); margin: 0 auto; padding: var(--sp-8) var(--sp-3) var(--sp-10); }
.main-narrow { max-width: var(--content-w); margin: 0 auto; padding: var(--sp-8) var(--sp-3) var(--sp-10); }

/* === Section Header === */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-light);
}
.section-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--text-dark); }
.section-header a { font-size: 0.875rem; font-weight: 500; color: var(--green); }
.section-header a:hover { text-decoration: underline; }

/* === Category Grid === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: var(--sp-8);
}
.category-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-box);
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 20px var(--green-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.category-icon { font-size: 1.75rem; line-height: 1; margin-bottom: 4px; }
.category-label { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.category-desc { font-size: 0.875rem; color: var(--text-mid); line-height: 1.5; }
.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border-light);
}

/* === Article List === */
.article-list { margin-bottom: var(--sp-8); }
.article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  gap: var(--sp-2);
  transition: background 0.1s;
}
.article-row:first-child { border-top: 1px solid var(--border-light); }
.article-row:hover { text-decoration: none; }
.article-row-meta { flex: 1; }
.article-row-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
  transition: color 0.15s;
}
.article-row:hover .article-row-title { color: var(--green); }
.article-row-cat { font-size: 0.8125rem; color: var(--text-light); }
.article-arrow { color: var(--border-light); font-size: 1rem; flex-shrink: 0; transition: color 0.15s; }
.article-row:hover .article-arrow { color: var(--green); }

/* === CTA Strip === */
.cta-strip {
  background: var(--charcoal);
  border-radius: var(--radius-box);
  padding: var(--sp-5) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  border: 1px solid var(--border-charcoal);
}
.cta-strip-text h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-on-charcoal); margin-bottom: 6px; }
.cta-strip-text p { font-size: 0.9375rem; color: var(--text-muted-charcoal); }

/* === Buttons === */
.btn-primary {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}
.btn-primary:hover { background: var(--green-bright); text-decoration: none; }
.btn-copper {
  background: var(--copper);
  color: var(--white);
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-copper:hover { background: var(--copper-dim); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--text-on-charcoal);
  border: 1.5px solid var(--border-charcoal);
  padding: 12px 26px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: var(--green); background: var(--green-glow); text-decoration: none; }

/* === Forms === */
.form-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-box);
  padding: var(--sp-5);
}
.form-row { margin-bottom: var(--sp-3); }
.form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-row label .req { color: var(--green); }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--parchment);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--green); background: var(--white); }
.form-row textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B8B86' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-hint { font-size: 0.8125rem; color: var(--text-light); margin-top: 5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.form-status {
  display: none;
  padding: var(--sp-2);
  border-radius: var(--radius);
  margin-top: var(--sp-2);
  font-size: 0.9375rem;
  font-weight: 500;
}
.form-status.success {
  background: var(--green-glow);
  color: var(--green-dim);
  border: 1px solid rgba(0,110,65,0.3);
}
.form-status.error {
  background: #FFF0F0;
  color: #B71C1C;
  border: 1px solid #FFCDD2;
}

/* === Article Layout === */
.article-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-3) var(--sp-10);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
  align-items: start;
}
.article-cat-badge {
  display: inline-block;
  background: var(--green-glow);
  color: var(--green);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: var(--sp-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.article-body { color: var(--text-mid); }
.article-body h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); margin: var(--sp-5) 0 var(--sp-2); }
.article-body h3 { font-size: 1.0625rem; font-weight: 700; color: var(--text-dark); margin: var(--sp-4) 0 10px; }
.article-body p { margin-bottom: var(--sp-2); }
.article-body ol, .article-body ul { padding-left: var(--sp-3); margin-bottom: var(--sp-2); }
.article-body li { margin-bottom: 6px; }
.article-body code {
  background: var(--parchment-warm);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.875em;
  font-family: var(--font-mono);
  color: var(--text-dark);
}
.article-body pre {
  background: var(--charcoal);
  border-radius: var(--radius);
  padding: var(--sp-3);
  overflow-x: auto;
  margin-bottom: var(--sp-2);
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-on-charcoal);
  font-size: 0.875rem;
}
.article-body a { color: var(--green); }
.article-body a:hover { text-decoration: underline; }
.article-note {
  background: var(--green-glow);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: var(--sp-3) 0;
  font-size: 0.9375rem;
  color: var(--text-dark);
}
.article-note strong { color: var(--green-dim); }
.article-divider { border: none; border-top: 1px solid var(--border-light); margin: var(--sp-6) 0; }

/* === Feedback Block === */
.feedback-block {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-box);
  padding: var(--sp-3);
  text-align: center;
}
.feedback-block p { font-size: 0.9375rem; font-weight: 600; margin-bottom: var(--sp-2); }
.feedback-btns { display: flex; justify-content: center; gap: 10px; }
.feedback-btn {
  border: 1.5px solid var(--border-light);
  background: var(--parchment);
  padding: 9px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
  transition: border-color 0.15s, background 0.15s;
}
.feedback-btn:hover, .feedback-btn.selected {
  border-color: var(--green);
  background: var(--green-glow);
  color: var(--green-dim);
}

/* === Sidebar === */
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-box);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.sidebar-card h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
}
.related-link {
  display: block;
  font-size: 0.875rem;
  color: var(--green);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.4;
  font-weight: 500;
}
.related-link:last-child { border-bottom: none; }
.related-link:hover { text-decoration: underline; }

/* === Status Badge === */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-open    { background: rgba(190,93,3,0.12); color: #7A3800; }
.status-pending { background: rgba(246,178,57,0.18); color: #7A5500; }
.status-resolved{ background: var(--green-glow); color: var(--green-dim); }

/* === Footer === */
footer {
  background: var(--charcoal);
  border-top: 1px solid var(--border-charcoal);
  padding: var(--sp-5) var(--sp-3);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.footer-inner p { font-size: 0.8125rem; color: var(--text-muted-charcoal); }
.footer-inner a { color: var(--green-bright); text-decoration: none; }
.footer-inner a:hover { color: var(--text-on-charcoal); }
.footer-links { display: flex; gap: var(--sp-3); }
.footer-links a { font-size: 0.8125rem; color: var(--text-muted-charcoal); text-decoration: none; }
.footer-links a:hover { color: var(--text-on-charcoal); }

/* === Responsive === */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .article-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .category-grid { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; text-align: center; }
  .topbar-back { display: none; }
  .topbar-nav li:not(:last-child) { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.5rem; }
}
