/* App pages — matches theme.css design tokens */

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.app-header {
  margin-bottom: 2.5rem;
}

.app-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.app-subtitle {
  color: var(--fg-muted);
  font-size: 1rem;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.back-link:hover { text-decoration: underline; }

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}

.app-card.highlight {
  border-color: var(--accent-dim);
}

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--surface2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.card-icon.accent { color: var(--accent); }

.app-card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.app-card p {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.playbook-preview {
  list-style: none;
  padding: 0;
  margin: 0;
}

.playbook-preview li {
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.playbook-preview li:last-child { border-bottom: none; }

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary.btn-large { width: 100%; padding: 0.875rem; font-size: 1rem; }

.hint-text {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

/* Profile Form */
.profile-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group select { cursor: pointer; }

.form-message {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.form-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Scripts Grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.week-card.empty {
  border-style: dashed;
  opacity: 0.7;
}

.week-card.generating {
  opacity: 0.5;
}

.week-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.week-number {
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
}

.week-theme {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
}

.regen-btn {
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.regen-btn:hover { opacity: 1; color: var(--accent); }

.script-hook {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

.script-points {
  list-style: none;
  padding: 0;
  margin: 0 0 0.875rem;
}

.script-points li {
  font-size: 0.825rem;
  color: var(--fg);
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.script-points li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--fg-muted);
}

.script-cta {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--green);
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.script-meta {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

.script-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  text-align: center;
}

.script-empty p { color: var(--fg-muted); font-size: 0.875rem; }

.btn-gen-small {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-gen-small:hover { border-color: var(--accent); color: var(--accent); }

.loading-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--fg-muted);
}

.error-state a { color: var(--accent); }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .scripts-grid { grid-template-columns: 1fr; }
}