/* SustBridge Design System — CSS Variables & Base Styles */
:root {
  /* Base */
  --base-bg: #ffffff;
  --base-contrast-5: #f4f4f4;

  /* Grayscale */
  --contrast-100: #2A2A2A;
  --contrast-90: #3d3d3d;
  --contrast-80: #555555;
  --contrast-70: #6e6e6e;
  --contrast-60: #878787;
  --contrast-50: #a0a0a0;
  --contrast-40: #b9b9b9;
  --contrast-30: #d2d2d2;
  --contrast-20: #ebebeb;
  --contrast-10: #f5f5f5;
  --contrast-5: #fafafa;

  /* Text */
  --text-heading: #1F3F1F;
  --text-body: #2A2A2A;
  --text-secondary: #2A2A2A;
  --text-disabled: rgba(42,42,42,0.35);

  /* Primary */
  --primary: #3E7D4F;
  --primary-text: #005A8D;
  --primary-50: rgba(62,125,79,0.5);
  --primary-10: rgba(62,125,79,0.1);

  /* Status */
  --error: #E21D12;
  --error-text: #CA100C;
  --error-50: rgba(226,29,18,0.5);
  --error-10: rgba(226,29,18,0.1);
  --warning: #F1CC00;
  --warning-text: #8B9231;
  --warning-10: rgba(241,204,0,0.1);
  --success: #158444;
  --success-text: #0A7637;
  --success-50: rgba(21,132,68,0.5);
  --success-10: rgba(21,132,68,0.1);

  /* User colors */
  --user-0: #0F5952;
  --user-1: #85044C;
  --user-2: #0577AA;
  --user-3: #A26200;
  --user-4: #8F1F5;
  --user-5: #584301;
  --user-6: #070636;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

  /* Border radius (from Shapes) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-body);
  background: var(--base-bg);
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─── */
.heading-xxxl { font-size: 40px; font-weight: 600; line-height: 1.2; }
.heading-xxl  { font-size: 28px; font-weight: 600; line-height: 1.25; }
.heading-xl   { font-size: 22px; font-weight: 600; line-height: 1.3; }
.heading-l    { font-size: 18px; font-weight: 600; line-height: 1.35; }
.heading-m    { font-size: 16px; font-weight: 600; line-height: 1.4; }
.heading-s    { font-size: 14px; font-weight: 600; line-height: 1.4; text-transform: uppercase; }
.body-text    { font-size: 16px; font-weight: 400; line-height: 1.5; }
.small-text   { font-size: 14px; font-weight: 400; line-height: 1.5; }
.text-xs      { font-size: 12px; font-weight: 400; line-height: 1.5; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #356d44; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0e7038; }
.btn-error { background: var(--error); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-body); border: 1px solid var(--contrast-30); }
.btn-ghost:hover:not(:disabled) { background: var(--contrast-10); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ─── Input Fields ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--contrast-30);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 16px;
  color: var(--text-body);
  background: var(--base-bg);
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-10);
}
.form-input.invalid {
  border-color: var(--error);
  background: var(--error-10);
}
.form-input:disabled {
  background: var(--contrast-10);
  color: var(--text-disabled);
}
.form-hint {
  font-size: 12px;
  color: var(--contrast-60);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--error-text);
  margin-top: 4px;
}

/* ─── Cards ─── */
.card {
  background: var(--base-bg);
  border: 1px solid var(--contrast-20);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background: var(--success-10); color: var(--success-text); }
.badge-warning { background: var(--warning-10); color: var(--warning-text); }
.badge-error { background: var(--error-10); color: var(--error-text); }
.badge-primary { background: var(--primary-10); color: var(--primary); }

/* ─── Notifications ─── */
.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}
.notification-success { background: var(--success); color: #fff; }
.notification-error { background: var(--error); color: #fff; }
.notification-warning { background: var(--warning); color: var(--text-body); }

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-muted { color: var(--contrast-60); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
