/* App pages — journal, auth, share card
   Inherits design tokens from theme.css */

/* Page shell */
.app-body {
  padding-top: 80px;
  min-height: 100vh;
}
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--fg);
}
.page-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-top: 0.4rem;
}

/* Dream list */
.dream-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 4rem;
}
.dream-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.dream-card:hover { border-color: rgba(168, 156, 245, 0.25); }
.dream-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.dream-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--fg);
}
.dream-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.dream-snippet {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dream-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.symbol-tag {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  padding: 0.2rem 0.7rem;
  background: rgba(168, 156, 245, 0.06);
}
.dream-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  font-family: 'DM Sans', system-ui, sans-serif;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #080c14;
}
.btn-primary:hover:not(:disabled) { background: #b8aef7; }
.btn-secondary {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover:not(:disabled) { color: var(--fg); border-color: rgba(168, 156, 245, 0.25); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover:not(:disabled) { background: rgba(168, 156, 245, 0.08); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--fg);
}
.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.modal-close:hover { color: var(--fg); }

/* Form */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-input, .form-textarea {
  width: 100%;
  background: rgba(168, 156, 245, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-dim);
}
.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-error {
  font-size: 0.8rem;
  color: #e07a5f;
  margin-top: 0.4rem;
}

/* Share card */
.share-url-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.share-url-input {
  flex: 1;
  background: rgba(168, 156, 245, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-family: monospace;
}

/* Interpretation block */
.interpretation-block {
  background: rgba(168, 156, 245, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.interpretation-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.interpretation-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--fg);
  line-height: 1.6;
}
.interpretation-loading {
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.auth-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.4rem;
}
.auth-tagline {
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.auth-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: left;
}
.auth-submit { width: 100%; margin-top: 0.5rem; padding: 0.85rem; }

/* Share card landing page */
.card-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}
.card-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(168, 156, 245, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.share-card {
  width: 100%;
  max-width: 480px;
  position: relative;
}
.card-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.card-star {
  position: absolute;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.4;
}
.cs-a { width: 2px; height: 2px; top: 8%; left: 15%; }
.cs-b { width: 1px; height: 1px; top: 20%; left: 80%; opacity: 0.6; }
.cs-c { width: 1.5px; height: 1.5px; top: 60%; left: 90%; opacity: 0.3; }
.cs-d { width: 1px; height: 1px; top: 75%; left: 10%; opacity: 0.5; }
.cs-e { width: 2px; height: 2px; top: 45%; left: 5%; opacity: 0.4; }

.card-inner {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 1;
}
.card-date {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 1rem;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1.5rem;
  line-height: 1.25;
}
.card-symbols {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.card-symbol {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.symbol-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.symbol-text {
  font-size: 0.9rem;
  color: var(--fg);
}
.card-interpretation {
  background: rgba(168, 156, 245, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.card-interpretation p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--fg);
  line-height: 1.65;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.card-cta {
  font-size: 0.8rem;
  font-weight: 500;
  color: #080c14;
  background: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.card-cta:hover { background: #b8aef7; }

@media (max-width: 480px) {
  .modal { padding: 1.5rem; }
  .card-inner { padding: 1.75rem 1.25rem; }
}