@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap');

/*
 * RESTORE Design System v1.0 — Coach application expression
 * Canonical brand source: djorourke-lgtm/restorepreaching.com
 * The app is the operational expression of the same system used by the public site.
 */
:root {
  /* Locked brand primitives */
  --restore-navy: #102535;
  --restore-olive: #566044;
  --restore-ochre: #AA824B;
  --restore-paper: #F4EFE6;
  --restore-ink: #1C252D;
  --restore-white: #FFFFFF;

  /* Environmental neutrals / accessible interaction */
  --restore-canvas-app: #F5F2ED;
  --restore-surface-subtle: #F7F3EC;
  --restore-surface-paper: #FFFDF9;
  --restore-border: #D9D2C7;
  --restore-border-subtle: #E8E2D9;
  --restore-text: #2F3A43;
  --restore-muted: #5F6A72;
  --restore-focus: #8A672F;
  --restore-olive-wash: #EEF0E9;
  --restore-ochre-wash: #F5ECDD;

  /* Semantic states */
  --restore-success: #3F684B;
  --restore-success-bg: #EDF4EE;
  --restore-success-border: #BFD2C3;
  --restore-warning: #85601F;
  --restore-warning-bg: #FBF2DF;
  --restore-warning-border: #DDC58F;
  --restore-error: #9B4137;
  --restore-error-bg: #FBECEA;
  --restore-error-border: #E4B7B1;
  --restore-info: #275D75;
  --restore-info-bg: #EAF2F5;
  --restore-info-border: #B8D0DA;

  /* Compatibility aliases for the existing application. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --color-bg: var(--restore-canvas-app);
  --color-surface: var(--restore-surface-paper);
  --color-primary: var(--restore-navy);
  --color-primary-light: #17364A;
  --color-accent: var(--restore-olive);
  --color-accent-light: #677151;
  --color-accent-dim: #D8DDCF;
  --color-text: var(--restore-ink);
  --color-text-muted: var(--restore-muted);
  --color-text-soft: var(--restore-muted);
  --color-border: var(--restore-border);
  --color-border-light: var(--restore-border-subtle);
  --color-warm: var(--restore-surface-subtle);
  --color-today: var(--restore-ochre-wash);
  --color-success: var(--restore-success);
  --color-success-bg: var(--restore-success-bg);
  --color-error: var(--restore-error);
  --color-error-bg: var(--restore-error-bg);

  --shadow-sm: 0 1px 2px rgba(16,37,53,.04);
  --shadow-md: 0 4px 14px rgba(16,37,53,.07);
  --shadow-lg: 0 16px 44px rgba(16,37,53,.12);
}

body {
  background: var(--restore-canvas-app);
  color: var(--restore-ink);
}

.header {
  background: rgba(255,253,249,.97);
  border-bottom-color: var(--restore-border-subtle);
}
.logo img { width: 160px; }
.header-btn { color: var(--restore-muted); }
.header-btn:hover { color: var(--restore-ink); background: var(--restore-surface-subtle); }
.header-btn.active {
  color: var(--restore-olive);
  background: var(--restore-olive-wash);
  font-weight: 600;
}
.header-btn svg,
.dropdown-item-icon svg,
.hamburger-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.dropdown-item-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--restore-muted);
}
.dropdown-item:hover .dropdown-item-icon { color: var(--restore-olive); }

.avatar { background: var(--restore-navy); }
.avatar-dropdown,
.coach-picker-menu,
.manuscript-actions-menu,
.series-card-menu-items {
  border-color: var(--restore-border);
  background: var(--restore-surface-paper);
  box-shadow: var(--shadow-lg);
}

/* Focus is ochre; selection is olive. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--restore-focus);
  outline-offset: 2px;
}
input:focus,
textarea:focus,
select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.sermon-edit-grid input:focus,
.sermon-edit-grid select:focus,
.theme-add-row input:focus {
  border-color: var(--restore-focus);
  box-shadow: 0 0 0 2px rgba(138,103,47,.16);
}

/* Shared actions */
.btn-primary,
.filter-btn {
  background: var(--restore-navy);
  color: var(--restore-surface-paper);
}
.btn-primary:hover,
.filter-btn:hover { background: #17364A; }
.btn-secondary {
  background: var(--restore-surface-paper);
  color: var(--restore-navy);
  border-color: var(--restore-border);
}
.btn-secondary:hover {
  border-color: var(--restore-navy);
  color: var(--restore-navy);
}
.form-group .required-mark { color: var(--restore-ochre); }

/* Remove the stray purple mini-system. */
.theme-tag {
  background: var(--restore-olive-wash) !important;
  color: var(--restore-olive) !important;
}

/* Main Coach working environment */
.sidebar {
  background: var(--restore-surface-paper);
  border-right-color: var(--restore-border-subtle);
}
.sidebar-new-btn:hover {
  border-color: var(--restore-olive);
  color: var(--restore-olive);
  background: var(--restore-olive-wash);
}
.conv-item:hover { background: var(--restore-surface-subtle); }
.conv-item.active {
  background: var(--restore-olive-wash);
  border-left-color: var(--restore-olive);
}
.workspace-nav-item:hover,
.workspace-nav-item[aria-pressed="true"] {
  background: var(--restore-olive-wash);
}
.workspace-nav-item[aria-pressed="true"] {
  color: var(--restore-olive);
}
.workspace-nav-item[aria-pressed="true"]::after { background: var(--restore-olive); }

.msg.coach .msg-avatar { background: var(--restore-olive); }
.msg.user .msg-avatar { background: var(--restore-navy); }
.msg.coach .msg-bubble {
  background: var(--restore-surface-paper);
  border-color: var(--restore-border-subtle);
  box-shadow: none;
}
.msg.user .msg-bubble {
  background: var(--restore-navy);
  color: var(--restore-surface-paper);
}
.welcome-card {
  background: var(--restore-surface-subtle);
  border-color: var(--restore-border);
  box-shadow: none;
}
.welcome-greeting { color: var(--restore-olive); }
.welcome-title { color: var(--restore-navy); font-weight: 500; }

.input-area {
  background: var(--restore-surface-paper);
  border-top-color: var(--restore-border-subtle);
}
.input-wrapper {
  background: #FFFFFF;
  border-color: var(--restore-border);
  box-shadow: 0 1px 3px rgba(16,37,53,.04);
}
.input-wrapper:focus-within {
  border-color: var(--restore-focus);
  box-shadow: 0 0 0 2px rgba(138,103,47,.16);
}
.send-btn {
  background: var(--restore-navy);
  color: var(--restore-surface-paper);
}
.send-btn:hover { background: #17364A; }

.bounce-ball { background: var(--restore-olive); }

/* Calendar / Series inherit the same system rather than separate feature palettes. */
.calendar-workspace,
.series-workspace { background: var(--restore-surface-paper); }
.calendar-workspace-header,
.series-header { border-bottom-color: var(--restore-border-subtle); }
.calendar-workspace-nav button {
  background: var(--restore-surface-subtle);
  border-color: var(--restore-border);
}
.calendar-workspace-nav button:hover { border-color: var(--restore-olive); }
.series-primary-action,
.journey-node {
  background: var(--restore-navy);
  border-color: var(--restore-navy);
}
.journey-route path { stroke: var(--restore-olive); }
.journey-milestone.selected .journey-milestone-summary {
  border-color: var(--restore-olive);
  box-shadow: 0 0 0 2px rgba(86,96,68,.10);
}
.journey-add-node-button,
.journey-linked-action {
  border-color: var(--restore-olive);
  color: var(--restore-olive);
}
.series-context-header {
  background: linear-gradient(90deg,var(--restore-olive-wash),var(--restore-surface-paper));
  box-shadow: inset 0 -3px 0 #D8DDCF;
}

/* Auth / cards / dialogs */
.login-card,
.modal,
.draft-modal,
.archive-form,
.stat-card,
.rate-card,
.metric-definitions {
  background: var(--restore-surface-paper);
  border-color: var(--restore-border-subtle);
}
.modal-title,
.archive-title,
.dashboard-heading h1,
.section h2 { color: var(--restore-navy); }
.alert.error,
.form-alert.error,
.toast.error {
  background: var(--restore-error-bg);
  color: var(--restore-error);
  border-color: var(--restore-error-border);
}
.alert.success,
.form-alert.success,
.toast.success {
  background: var(--restore-success-bg);
  color: var(--restore-success);
  border-color: var(--restore-success-border);
}

/* Motion is quiet and functional. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* Auth expression */
.login-card {
  background: var(--restore-surface-paper);
  border: 1px solid var(--restore-border-subtle);
  box-shadow: 0 10px 34px rgba(16,37,53,.08);
}
.login-card .subtitle { color: var(--restore-muted); }
.login-card .auth-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--restore-navy);
}
.login-card input { background: #FFFFFF; color: var(--restore-ink); }
.login-card button {
  background: var(--restore-navy);
  color: var(--restore-surface-paper);
}
.login-card button:hover { background: #17364A; }
.login-card a { color: var(--restore-navy); }

/* Archive / administrative surfaces */
.new-entry-btn {
  background: var(--restore-navy) !important;
  color: var(--restore-surface-paper) !important;
}
.new-manuscript-link { color: var(--restore-navy) !important; }
.filter-pill.active {
  background: var(--restore-navy);
  border-color: var(--restore-navy);
}
.tab-btn.active {
  color: var(--restore-olive);
  border-bottom-color: var(--restore-olive);
}
.spark-bar,
.coach-chart-bar { background: var(--restore-olive); }

/* Use ochre only for craft/attention, not as the default action colour. */
.workspace-eyebrow,
.journey-kicker,
.series-group h3 { color: var(--restore-olive); }
