/* ==========================================================================
   World NGO Network — design tokens (single source of truth for both themes)

   Light is the default. Dark is applied by wngo-theme.js (and the inline
   bootstrap in container.phtml) via <html data-theme="dark">. Nothing in the
   redesigned surfaces (auth pages, app shell) should hard-code a colour: use
   these variables so Light and Dark stay two versions of one design.
   ========================================================================== */

:root {
  color-scheme: light;

  /* brand */
  --brand-primary: #009846;
  --brand-primary-hover: #007a38;
  --brand-primary-active: #00672f;
  --brand-on-primary: #ffffff;
  --brand-soft: #eaf7f0;          /* tinted fill: active nav, selected tab */
  --brand-soft-text: #00753a;
  --brand-ring: rgba(0, 152, 70, .22);

  /* surfaces */
  --bg-page: #f6f8fa;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f3f6f9;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(16, 24, 40, .45);

  /* text */
  --text-primary: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;
  --text-placeholder: #667085;     /* 4.6:1 on --input-bg and on the header search fill */
  --text-on-light: #101828;        /* text on a fixed light-coloured surface (e.g. the yellow affiliate box); does not flip with the theme */
  --text-link: #0e7a4a;

  /* lines */
  --border-default: #d9e1ea;
  --border-subtle: #e7edf3;
  --border-strong: #c2cedb;

  /* controls */
  --input-bg: #ffffff;
  --input-border: #d0d9e3;
  --hover-bg: #f2f5f8;
  --active-bg: var(--brand-soft);
  --option-bg: #ffffff;           /* native <select> popup */
  --option-text: #101828;
  --text-disabled: #838ea0;       /* 3.0:1 on --input-bg-disabled: dimmer than muted, still legible (was 2.3:1) */
  --input-bg-disabled: #f2f4f7;

  /* semantic */
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fda29b;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --warning-border: #fedf89;
  --success: #067647;
  --success-bg: #ecfdf3;
  --success-border: #abefc6;
  --info: #1d6fd1;
  --info-bg: #eff6ff;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -14px rgba(16, 24, 40, .16);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 24px 56px -16px rgba(16, 24, 40, .22);

  /* shape + type */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* app shell metrics */
  --shell-header-h: 70px;
  --shell-sidebar-w: 255px;
  --shell-right-w: 360px;
  --shell-rail-w: 76px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand-primary: #19b35b;
  --brand-primary-hover: #2cc56d;
  --brand-primary-active: #14994d;
  --brand-on-primary: #04170c;
  --brand-soft: rgba(25, 179, 91, .14);
  --brand-soft-text: #5fe19a;
  --brand-ring: rgba(25, 179, 91, .35);

  --bg-page: #0a0f1c;
  --bg-surface: #111827;
  --bg-surface-secondary: #162033;
  --bg-elevated: #172134;
  --bg-overlay: rgba(2, 6, 14, .66);

  --text-primary: #f1f5f9;
  --text-secondary: #b3bfd1;
  --text-muted: #8493aa;
  --text-placeholder: #94a3b8;     /* 5.7:1 on --input-bg */
  --text-link: #4fd890;

  --border-default: #243148;
  --border-subtle: #1b273b;
  --border-strong: #33425c;

  --input-bg: #1e293b;
  --input-border: #334155;
  --hover-bg: #1a2539;
  --active-bg: var(--brand-soft);
  --option-bg: #1e293b;
  --option-text: #f1f5f9;
  --text-disabled: #7d8ba1;
  --input-bg-disabled: #0f172a;

  --danger: #ff8a80;
  --danger-bg: rgba(240, 68, 56, .12);
  --danger-border: rgba(240, 68, 56, .5);
  --warning: #fdb022;
  --warning-bg: rgba(247, 144, 9, .12);
  --warning-border: rgba(247, 144, 9, .45);
  --success: #47cd89;
  --success-bg: rgba(18, 183, 106, .12);
  --success-border: rgba(18, 183, 106, .4);
  --info: #6aa9ff;
  --info-bg: rgba(41, 112, 255, .14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 28px 60px -16px rgba(0, 0, 0, .7);
}

/* One visible keyboard focus ring everywhere the shell is used. */
.wngo-app :focus-visible,
.wngo-auth :focus-visible,
.wngo-theme-switch :focus-visible {
  outline: 2px solid var(--brand-primary) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  .wngo-app *, .wngo-auth *, .wngo-theme-switch * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
