/* Dream Pattern Tracker — briannuckols.com consumer version */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Newsreader:wght@400;600;700&display=swap');

:root {
  --bg: #FAF9F7;
  --surface: #FFFFFE;
  --text: #1A1A1A;
  --text-secondary: #5A5A5A;
  --accent: #4A7C6F;
  --accent-light: #EDF5F2;
  --border: #E5E5E5;
  --success: #276749;
  --success-bg: #F0FFF4;
  --warning: #C53030;
  --warning-bg: #FFF5F5;
  --blue: #2B6CB0;
  --blue-light: #EBF8FF;
  --radius: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

/* Site nav */
.site-nav {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
}
.site-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { text-decoration: underline; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Screen management */
.screen { display: none; }
.screen.active { display: block; }

/* Header */
.app-header {
  text-align: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.app-header h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* CTA card */
.cta-card {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #3D6B5F; }
.btn-primary:disabled {
  background: #CBD5E0;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--accent-light); }
.btn-success {
  background: var(--success);
  color: white;
}
.btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.btn-group .btn { flex: 1; }

/* Form elements */
textarea, input[type="date"], input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
textarea:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 111, 0.12);
}
textarea { min-height: 200px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.word-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}
.word-count.low { color: var(--warning); font-weight: 600; }
.word-count.ok { color: var(--success); }

/* Privacy note */
.privacy-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.5;
}

/* Likert grid */
.likert-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.likert-item:last-child { border-bottom: none; }
.likert-text {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.likert-options {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}
.likert-option {
  flex: 1;
  text-align: center;
}
.likert-option input { display: none; }
.likert-option label {
  display: block;
  padding: 0.5rem 0.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0;
}
.likert-option input:checked + label {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Dream list */
.dream-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s;
  gap: 0.75rem;
}
.dream-item:hover { background: var(--accent-light); }
.dream-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}
.dream-preview {
  flex: 1;
  min-width: 0;
}
.dream-preview .date {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.dream-preview .excerpt {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dream-scores {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}
.dream-scores .score-badge {
  display: inline-block;
  background: var(--accent-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--accent);
}

/* Chart */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
.chart-container canvas { width: 100% !important; }

/* Interpretation card */
.interpretation-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}
.interpretation-text .pattern-label {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

/* Decision tree */
.tree-step {
  padding: 1rem;
  background: var(--accent-light);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.tree-step .question {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.tree-step .hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.tree-branch {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.tree-branch:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.tree-result {
  text-align: center;
  padding: 1.5rem;
  background: var(--success-bg);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.tree-result .code {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}
.tree-result .label {
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Status messages */
.status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin: 0.75rem 0;
}
.status-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.status-error { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.status-info { background: var(--blue-light); color: var(--blue); border: 1px solid var(--blue); }

/* Responsive */
@media (min-width: 768px) {
  .container { padding: 0 2rem 2rem; }
  textarea { min-height: 280px; }
}

/* Print */
@media print {
  body { background: white; }
  .btn, .app-header, .site-nav { display: none; }
}
