/* app.css — StorySprout onboarding and app-specific styles
   Landing page theme tokens are in theme.css.
   Keep all app-specific overrides here.
*/

/* Nav CTA */
.nav-cta {
  margin-left: auto;
  padding: 10px 22px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-cta:hover {
  background: #b5432f;
}

/* ONBOARDING */
.onboard-wrap {
  min-height: calc(100vh - 80px);
  padding: 64px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.onboard-hero {
  text-align: center;
  margin-bottom: 56px;
}

.onboard-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 12px;
}

.onboard-headline {
  font-family: 'Lora', serif;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.15;
}

.onboard-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}

.onboard-form {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Form sections */
.form-section {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 16px rgba(30,42,58,0.06);
}

.form-section-title {
  font-family: 'Lora', serif;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cream-dark);
}

.form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.form-input {
  padding: 12px 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(122, 158, 126, 0.15);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Character mode selector */
.character-modes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-option {
  cursor: pointer;
}

.mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--cream-dark);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option input:checked + .mode-card {
  border-color: var(--sage);
  background: rgba(122, 158, 126, 0.05);
}

.mode-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  background: var(--cream-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.mode-option input:checked + .mode-card .mode-icon {
  background: rgba(122, 158, 126, 0.2);
}

.mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-text strong {
  font-size: 15px;
  color: var(--ink);
}

.mode-text span {
  font-size: 13px;
  color: var(--muted);
}

/* Submit button */
.btn-generate {
  width: 100%;
  padding: 18px 32px;
  background: var(--accent);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.btn-generate:hover:not(:disabled) {
  background: #b5432f;
}

.btn-generate:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* STORY PAGE */
.story-wrap {
  min-height: calc(100vh - 80px);
  padding: 64px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-header {
  text-align: center;
  margin-bottom: 32px;
}

.story-meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.story-virtue-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sage);
  background: rgba(122, 158, 126, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

.virtue-dot {
  width: 8px;
  height: 8px;
  background: var(--sage);
  border-radius: 50%;
}

.story-body {
  max-width: 680px;
  width: 100%;
  background: var(--white);
  border-radius: 20px;
  padding: 48px 56px;
  box-shadow: 0 4px 32px rgba(30,42,58,0.08);
  margin-bottom: 40px;
}

.story-title {
  font-family: 'Lora', serif;
  font-size: clamp(22px, 3vw, 32px);
  color: var(--ink);
  margin-bottom: 28px;
  line-height: 1.25;
}

.story-body p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--fg);
  margin-bottom: 20px;
}

.story-body p:last-child {
  margin-bottom: 0;
}

.story-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-secondary {
  padding: 12px 24px;
  border: 2px solid var(--cream-dark);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  background: var(--white);
}

.btn-secondary:hover {
  border-color: var(--sage);
  background: rgba(122, 158, 126, 0.05);
}

.btn-secondary--muted {
  color: var(--muted);
}

/* ERROR PAGES */
.error-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.error-headline {
  font-family: 'Lora', serif;
  font-size: 36px;
  color: var(--ink);
  margin-bottom: 16px;
}

.error-body {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* MOBILE */
@media (max-width: 640px) {
  .form-row--two {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 24px 20px;
  }

  .story-body {
    padding: 32px 24px;
  }
}