/* Goal Design Foundation (C1-R2)
   Lightweight tokens + base components for the Goal product space.
   The Goal space should feel calm, trustworthy and action-first, not like a
   flashy AI SaaS.  Keep gradients, shadows and motion minimal. */

:root {
  /* ---- Color tokens ---- */
  --goal-bg: #f3f7f5;
  --goal-surface: #ffffff;
  --goal-surface-subtle: #eaf1ed;
  --goal-text: #1d2925;
  --goal-text-secondary: #51625b;
  --goal-text-muted: #7b8b84;
  --goal-border: #dbe5df;
  --goal-border-strong: #c3d2ca;
  --goal-primary: #176b55;
  --goal-primary-hover: #115a46;
  --goal-primary-active: #0e4d3b;
  --goal-primary-soft: #e1efe9;
  --goal-success: #1e7f4f;
  --goal-success-soft: #e4f3ea;
  --goal-warning: #9a6a12;
  --goal-warning-soft: #f7efdc;
  --goal-error: #b23a30;
  --goal-error-soft: #f9e8e6;
  --goal-focus: #2f8f74;

  /* Legacy aliases used by the goal space and app shell */
  --surface: var(--goal-bg);
  --surface-subtle: var(--goal-surface-subtle);
  --blue: var(--goal-primary);
  --muted: var(--goal-text-muted);
  --dashboard-green-soft: var(--goal-primary-soft);

  /* ---- Typography ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 26px;
  --text-3xl: 32px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* ---- Spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* ---- Radius ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- Shadow (minimal) ---- */
  --shadow-card: 0 1px 2px rgba(24, 51, 43, 0.05), 0 4px 14px rgba(24, 51, 43, 0.05);
  --shadow-pop: 0 12px 40px rgba(16, 40, 33, 0.16);

  /* ---- Layout ---- */
  --goal-content-max: 920px;
  --goal-content-narrow: 680px;
  --tap-target: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--goal-text);
  background: var(--goal-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--goal-primary); }
:focus-visible {
  outline: 2px solid var(--goal-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Section labels ---- */
.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--goal-text-muted);
}

/* ---- Buttons ---- */
.primary,
.secondary,
.ghost,
.danger {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  min-height: var(--tap-target);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 120ms ease, border-color 120ms ease, transform 60ms ease;
}
.primary {
  background: var(--goal-primary);
  color: #ffffff;
}
.primary:hover { background: var(--goal-primary-hover); }
.primary:active { background: var(--goal-primary-active); transform: translateY(1px); }
.primary:disabled { background: var(--goal-border-strong); color: #ffffff; cursor: not-allowed; }
.secondary {
  background: var(--goal-surface);
  border-color: var(--goal-border-strong);
  color: var(--goal-text);
}
.secondary:hover { border-color: var(--goal-primary); color: var(--goal-primary); background: var(--goal-primary-soft); }
.secondary:active { transform: translateY(1px); }
.secondary:disabled { color: var(--goal-text-muted); border-color: var(--goal-border); cursor: not-allowed; background: var(--goal-surface); }
.ghost {
  background: transparent;
  color: var(--goal-text-secondary);
  font-weight: var(--weight-medium);
}
.ghost:hover { background: var(--goal-surface-subtle); color: var(--goal-text); }
.ghost:disabled { color: var(--goal-text-muted); cursor: not-allowed; }
.danger {
  background: var(--goal-error-soft);
  color: var(--goal-error);
}
.danger:hover { background: #f3dcd9; }

/* ---- Forms ---- */
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--goal-text);
  margin: 14px 0 6px;
}
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--goal-border-strong);
  border-radius: var(--radius-sm);
  background: var(--goal-surface);
  padding: 10px 12px;
  min-height: var(--tap-target);
  font-size: var(--text-base);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--goal-focus);
  box-shadow: 0 0 0 3px rgba(47, 143, 116, 0.18);
}
.form-message {
  font-size: var(--text-sm);
  color: var(--goal-text-secondary);
  min-height: 20px;
  margin: 0 0 12px;
}
.form-message.error { color: var(--goal-error); }
.form-message.success { color: var(--goal-success); }

/* ---- Cards ---- */
.goal-panel {
  background: var(--goal-surface);
  border: 1px solid var(--goal-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-card);
}
.goal-panel h2 { margin: 4px 0 8px; font-size: var(--text-lg); font-weight: var(--weight-bold); }
.goal-muted { color: var(--goal-text-muted); font-size: var(--text-xs); }
.goal-empty-panel {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--goal-text-secondary);
}
.goal-empty-panel h2 { color: var(--goal-text); }
