/* ==========================================================================
   قيمة | QIMA - Centralized Design System & Stylesheet
   المنظومة الرقمية للاقتصاد الدائري في المملكة العربية السعودية
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette */
  --brand-forest:       #2B6B41;
  --brand-forest-dark:  #1B482B;
  --brand-forest-mid:   #3A8C56;
  --brand-lime:         #68B845;
  --brand-lime-soft:    #85CC5E;
  --brand-ink:          #142823;

  --primary:            #2B6B41;
  --primary-light:      #68B845;
  --primary-dark:       #1D5231;
  --accent:             #68B845;
  --accent-glow:        rgba(104, 184, 69, 0.18);

  --teal:               #3A8C56;
  --teal-light:         #4DAA6B;
  --amber:              #B08800;
  --amber-light:        #C9A227;

  /* Backgrounds & Surfaces */
  --bg:                 #F7FCF8;
  --surface:            #EDF6EF;
  --surface-card:       #F2F8F4;
  --card:               #FFFFFF;
  --card-hover:         #F5FBF6;

  /* Borders & Outlines */
  --border:             rgba(43, 107, 65, 0.16);
  --border-accent:      rgba(104, 184, 69, 0.35);
  --border-light:       rgba(43, 107, 65, 0.08);

  /* Typography Colors */
  --text:               #142823;
  --text-muted:         #446A58;
  --text-dim:           #7D9F8F;

  /* Radii & Shadows */
  --radius-sm:          10px;
  --radius:             16px;
  --radius-lg:          24px;
  --shadow-card:        0 2px 16px rgba(43, 107, 65, 0.06);
  --shadow:             0 8px 30px rgba(27, 72, 43, 0.08);
  --shadow-hover:       0 12px 36px rgba(43, 107, 65, 0.14);

  /* Gradients */
  --grad-brand:         linear-gradient(135deg, var(--brand-forest) 0%, var(--brand-lime) 100%);
  --grad-dark:          linear-gradient(135deg, #142823 0%, #1E4631 100%);
}

/* --------------------------------------------------------------------------
   2. Reset & Base Typography
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #E8F5EA;
}
::-webkit-scrollbar-thumb {
  background: var(--brand-forest);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-lime);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: clamp(32px, 4.8vw, 62px); }
h2 { font-size: clamp(24px, 3.6vw, 42px); }
h3 { font-size: clamp(19px, 2.6vw, 26px); }
h4 { font-size: 18px; }

a {
  color: var(--brand-forest);
  text-decoration: none;
  transition: all 0.2s ease;
}

p {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   3. Common Layout & Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 90px 0;
  position: relative;
}

.section-surface {
  background: var(--surface);
}

.section-dark {
  background: var(--grad-dark);
  color: white;
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-forest) 0%, var(--brand-lime) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-light {
  background: linear-gradient(135deg, #A8F384 0%, #FFFFFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 50px;
}

.section-header p {
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 14px;
}

.divider {
  width: 50px;
  height: 3px;
  background: var(--grad-brand);
  border-radius: 2px;
  margin: 18px auto;
}

/* --------------------------------------------------------------------------
   4. Buttons & Badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 18px rgba(43, 107, 65, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(104, 184, 69, 0.45);
  color: #fff;
}

.btn-dark {
  background: #142823;
  color: white;
}

.btn-dark:hover {
  background: #1E4631;
  color: white;
}

.btn-outline {
  background: white;
  color: var(--brand-forest);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--brand-forest);
  background: rgba(43, 107, 65, 0.05);
  color: var(--brand-forest);
}

.btn-lg {
  padding: 16px 34px;
  font-size: 16px;
  border-radius: 14px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(43, 107, 65, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--brand-forest);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-lime);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.badge-white {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #C5F3A9;
}

.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.st-sched { background: #FEF3C7; color: #92400E; }
.st-transit { background: #DBEAFE; color: #1E40AF; }
.st-received { background: #D1FAE5; color: #065F46; }
.status-pending, .st-pending { background: #FEF3C7; color: #92400E; }
.status-priced, .st-priced { background: #DBEAFE; color: #1E40AF; }
.status-matched, .st-matched { background: #D1FAE5; color: #065F46; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --------------------------------------------------------------------------
   5. Cards & Containers
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-card);
}

.card:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* --------------------------------------------------------------------------
   6. Navigation Bar (Public Site)
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 0;
  background: rgba(247, 252, 248, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(43, 107, 65, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.nav-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(43, 107, 65, 0.25);
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  display: block;
}

.nav-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--brand-forest);
  background: rgba(43, 107, 65, 0.08);
}

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

/* --------------------------------------------------------------------------
   7. Topbar (Dashboard Portals)
   -------------------------------------------------------------------------- */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--brand-forest);
  text-decoration: none;
  font-size: 16px;
}

.topbar-mark {
  width: 34px;
  height: 34px;
  background: var(--grad-brand);
  border-radius: 8px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: #DC2626;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #FEE2E2;
}

/* --------------------------------------------------------------------------
   8. Hero Section & Live Preview Component
   -------------------------------------------------------------------------- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 130px 0 60px;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
  width: 100%;
}

.hero-pretag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 30px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.hero-trust-strip {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.hero-trust-item svg {
  color: var(--brand-lime);
  flex-shrink: 0;
}

.hero-card-preview {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.preview-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-forest);
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #16A34A;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  animation: pulse 1.6s infinite;
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
}

.preview-row .mat { font-weight: 700; color: var(--text); }
.preview-row .vol { color: var(--text-muted); font-size: 12px; }
.preview-row .price { font-weight: 800; color: var(--brand-forest); font-size: 14px; }

.preview-impact {
  background: rgba(43, 107, 65, 0.08);
  border: 1px dashed var(--border-accent);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.preview-impact .num { font-size: 18px; font-weight: 900; color: var(--brand-forest); }
.preview-impact .lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* --------------------------------------------------------------------------
   9. Statistics Counters Bar
   -------------------------------------------------------------------------- */
.stats-bar {
  padding: 44px 0;
  background: white;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item .num {
  font-size: 38px;
  font-weight: 900;
  color: var(--brand-forest);
  line-height: 1.1;
}

.stat-item .lbl {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   10. Marketplace Catalog & Filter Pills
   -------------------------------------------------------------------------- */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--brand-forest);
  color: var(--brand-forest);
}

.filter-btn.active {
  background: var(--brand-forest);
  color: white;
  border-color: var(--brand-forest);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.market-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 22px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.market-card:hover {
  border-color: var(--brand-forest);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-cat {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(43, 107, 65, 0.08);
  color: var(--brand-forest);
}

.card-city {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
  flex-grow: 1;
}

.card-metrics {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.metric-qty {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.metric-price {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand-forest);
}

.metric-price small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Interactive Value & ESG Calculator
   -------------------------------------------------------------------------- */
.calculator-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
  max-width: 960px;
  margin: 0 auto;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.calc-form-group {
  margin-bottom: 20px;
}

.calc-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.calc-select, .calc-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #FAFCFA;
  transition: all 0.2s;
}

.calc-select:focus, .calc-input:focus {
  border-color: var(--brand-forest);
  background: white;
}

.calc-results-card {
  background: linear-gradient(145deg, #183A26 0%, #2B6B41 100%);
  border-radius: 18px;
  padding: 28px;
  color: white;
}

.calc-res-title {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.calc-res-val {
  font-size: 38px;
  font-weight: 900;
  color: #A8F384;
  line-height: 1.1;
  margin-bottom: 18px;
}

.calc-metric-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
}

.calc-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-metric-item strong {
  color: white;
  font-weight: 800;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   12. Price Index Table & Trends
   -------------------------------------------------------------------------- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.price-table th, .price-table td {
  padding: 14px 18px;
  text-align: right;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.price-table th {
  background: var(--surface);
  font-weight: 700;
  color: var(--brand-forest);
  font-size: 14px;
}

.price-table tr:hover td {
  background: #FAFCFA;
}

.trend-up { color: #16A34A; font-weight: 700; }
.trend-down { color: #DC2626; font-weight: 700; }
.trend-stable { color: #D97706; font-weight: 700; }

/* --------------------------------------------------------------------------
   13. Solutions & Enterprise Pillars
   -------------------------------------------------------------------------- */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.solution-card {
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  padding: 32px 26px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.solution-card:hover {
  border-color: var(--brand-forest);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.sol-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(43, 107, 65, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-forest);
  margin-bottom: 20px;
}

.solution-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.solution-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.sol-features {
  list-style: none;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text);
  flex-grow: 1;
}

.sol-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sol-features svg {
  color: var(--brand-lime);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   14. Process Workflow Cards
   -------------------------------------------------------------------------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.process-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 26px 20px;
  text-align: center;
  position: relative;
}

.process-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-forest);
  color: white;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.process-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.process-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   15. Portal Switchers (Homepage & Links)
   -------------------------------------------------------------------------- */
.portals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.portal-card {
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-card:hover {
  border-color: var(--brand-forest);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: #F7FCF8;
}

.portal-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(43, 107, 65, 0.08);
  color: var(--brand-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.portal-card strong {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.portal-card span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

.portal-link-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-forest);
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   16. Authentication Pages (Login & Register)
   -------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 10px 30px rgba(43, 107, 65, 0.08);
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
}

.logo-mark {
  width: 44px;
  height: 44px;
  background: var(--grad-brand);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 26px;
  font-weight: 900;
  color: var(--brand-ink);
}

.logo-text em {
  font-style: normal;
  color: var(--brand-lime);
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
}

.auth-card p.sub {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.role-option {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  background: #F7FAF8;
  transition: all 0.2s;
}

.role-option.selected {
  border-color: var(--brand-forest);
  background: rgba(43, 107, 65, 0.1);
  font-weight: 700;
}

.role-option .icon {
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--brand-forest);
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-option .title {
  font-size: 13px;
}

.quick-roles {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(43, 107, 65, 0.1);
}

.quick-roles-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-btn {
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F4FAF5;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-forest);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.role-btn:hover {
  background: var(--brand-forest);
  color: white;
}

.footer-links {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--brand-forest);
  font-weight: 700;
  text-decoration: none;
}

.error-msg {
  background: #FEE2E2;
  border: 1px solid #F87171;
  color: #991B1B;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* --------------------------------------------------------------------------
   17. Dashboard Portals Styles (Supplier, Buyer, Admin, Partner)
   -------------------------------------------------------------------------- */
.hero-banner {
  background: var(--grad-brand);
  color: white;
  border-radius: 16px;
  padding: 24px 30px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-banner h2 {
  color: white;
  font-size: 22px;
  margin-bottom: 4px;
}

.hero-banner p {
  font-size: 13px;
  opacity: 0.9;
}

.journey-helper {
  background: rgba(43, 107, 65, 0.06);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
}

.journey-helper-steps {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.j-step {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.j-step.active {
  background: var(--brand-forest);
  color: white;
  border-color: var(--brand-forest);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box, .stat-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--brand-forest);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar select {
  padding: 10px 14px;
  border: 1.5px solid rgba(43, 107, 65, 0.2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: white;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--brand-forest);
  color: var(--brand-forest);
}

.tab-btn.active {
  background: var(--brand-forest);
  color: white;
  border-color: var(--brand-forest);
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th, .table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  background: #F4FAF5;
  color: var(--brand-forest);
  font-weight: 700;
}

.table tr:hover td {
  background: #FAFCFA;
}

.market-item {
  border: 1px solid var(--border-light);
  background: #FAFDFB;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.market-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.market-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-lime);
  text-transform: uppercase;
}

.market-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-forest);
}

.market-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--amber);
  margin-top: 6px;
}

.btn-buy {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-buy:hover {
  opacity: 0.9;
}

.btn-act {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-match { background: #D1FAE5; color: #065F46; }
.btn-price { background: #DBEAFE; color: #1E40AF; }

.partnership-item {
  border: 1px solid var(--border-light);
  background: #FAFDFB;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}

.consult-box {
  background: #EEF8F1;
  border-right: 4px solid var(--brand-lime);
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   18. Forms, Inputs & Controls
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(43, 107, 65, 0.2);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: white;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-forest);
  box-shadow: 0 0 0 3px rgba(43, 107, 65, 0.12);
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   19. Footer (Public Site)
   -------------------------------------------------------------------------- */
.footer {
  background: var(--brand-ink);
  color: rgba(255, 255, 255, 0.7);
  padding: 70px 0 30px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer h5 {
  font-size: 16px;
  color: white;
  margin-bottom: 18px;
  font-weight: 800;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #A8F384;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   20. Live Auctions & Real Bidding Engine
   -------------------------------------------------------------------------- */
.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
  margin-top: 18px;
}

.auction-card {
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.auction-card:hover {
  border-color: var(--brand-lime);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(43, 107, 65, 0.12);
}

.auction-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E8F7EC;
  color: #1E6B37;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.auction-timer {
  background: #1B3530;
  color: #A8F384;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  direction: ltr;
}

.auction-price-box {
  background: #F4FAF5;
  border: 1px solid rgba(43, 107, 65, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auction-price-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--brand-forest);
}

.bid-input-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.bid-input-group input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid rgba(43, 107, 65, 0.25);
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  outline: none;
}

.bid-input-group input:focus {
  border-color: var(--brand-forest);
  box-shadow: 0 0 0 2px rgba(43, 107, 65, 0.12);
}

.btn-bid {
  padding: 10px 18px;
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.btn-bid:hover {
  opacity: 0.92;
}

.quick-bids {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.quick-bid-pill {
  flex: 1;
  padding: 4px 8px;
  background: white;
  border: 1px solid rgba(43, 107, 65, 0.2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-forest);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.quick-bid-pill:hover {
  background: var(--brand-forest);
  color: white;
}

.bids-history-list {
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px dashed var(--border-light);
  margin-top: 12px;
  padding-top: 10px;
  font-size: 12px;
}

.bid-history-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

/* --------------------------------------------------------------------------
   21. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }
  .portals-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .grid-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .portals-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .roles-grid { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: 1fr; }
}
