/* webapp-base.css — общий layout/typography для всех webapp страниц.
 * Дефолтные CSS vars обеспечивают graceful degradation если webapp-theme.js не отработал.
 * Spec: docs/superpowers/specs/2026-05-03-unify-webapp-pages-design.md
 */

:root {
  /* Default palette (overridden by template + theme-loader) */
  --bg: #F6F1EB;
  --bg-card: #FFFFFF;
  --primary: #2A7A6E;
  --primary-light: #3DA196;
  --primary-pale: rgba(42, 122, 110, 0.08);
  --primary-glow: rgba(42, 122, 110, 0.15);
  --text: #1E2B2A;
  --text-secondary: #6B7C7A;
  --text-muted: #9AADAB;
  --divider: #E8E2DA;
  --accent: #C8956C;
  --accent-light: rgba(200, 149, 108, 0.12);
  --danger: #D94F4F;
  --success: #2A9D6E;

  /* Typography */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-headings: 'Outfit', 'DM Sans', sans-serif;

  /* Layout */
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --shadow-sm: 0 1px 3px rgba(30, 43, 42, 0.04);
  --shadow-md: 0 4px 20px rgba(30, 43, 42, 0.06);
  --shadow-lg: 0 8px 40px rgba(30, 43, 42, 0.08);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  padding-bottom: 2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
}

a { color: var(--primary); text-decoration: none; }

/* Layout primitives */
.webapp-header {
  background: var(--bg);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 100;
}

.webapp-header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.webapp-logo {
  font-family: var(--font-headings);
  color: var(--primary);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.webapp-back-button {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--divider);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.webapp-back-button:hover { border-color: var(--primary); color: var(--primary); }

.webapp-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.webapp-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.webapp-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.webapp-card h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

/* Hidden until theme is ready (optional FOUC mitigation) */
body[data-theme-pending="true"] { visibility: hidden; }

/* Modules: hide blocks where modules.X === false */
[data-module][data-module-disabled="true"] { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
  .webapp-container { padding: 1rem; }
  .webapp-card { padding: 1.25rem; }
}
