/* ========================================
   app.css — TaskMap authenticated pages
   Uses theme.css variables. Additions only.
   ======================================== */

/* === AUTH PAGE === */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(26,26,46,0.06);
}

.auth-header {
  margin-bottom: 2rem;
  text-align: center;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.auth-switch a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* === APP MAIN LAYOUT === */
.app-main {
  background: var(--bg);
  min-height: calc(100vh - 60px);
  padding: 2.5rem 1.5rem;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* === FORM PANEL === */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.panel-header {
  margin-bottom: 1.75rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.panel-sub {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* === FORM ELEMENTS === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

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

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

.label-optional {
  font-weight: 400;
  color: var(--ink-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.form-textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 160px;
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-alt);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--ink-muted);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.btn-ghost:hover {
  color: var(--ink);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
}

.inline-form {
  display: inline;
}

/* === RESULT PANEL === */
.result-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  min-height: 400px;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  gap: 1rem;
  color: var(--ink-muted);
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 0.9rem;
  text-align: center;
  max-width: 28ch;
  line-height: 1.5;
}

.result-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

/* === RESULT CONTENT === */
.result-summary {
  background: var(--hero-bg);
  color: var(--hero-fg);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

.summary-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(250,248,245,0.85);
  margin-bottom: 0.75rem;
}

.summary-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(250,248,245,0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.step-count,
.prompt-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--bg-alt);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* === STEPS === */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s;
}

.step-card:hover {
  border-color: var(--accent);
}

.step-num-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.step-num-badge {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--accent);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  flex: 1;
}

.step-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--bg-alt);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.step-why {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.step-tip {
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-style: italic;
  margin-top: 0.4rem;
}

/* === AI PROMPTS === */
.prompts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.prompt-header {
  background: var(--bg-alt);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.prompt-step {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.prompt-context {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.prompt-body {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.btn-copy-prompt {
  display: block;
  width: 100%;
  padding: 0.65rem;
  background: var(--surface);
  border: none;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}

.btn-copy-prompt:hover {
  background: var(--bg-alt);
}

/* === RESULT ACTIONS === */
.result-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* === NAV LINKS (used by partials/nav on app pages) === */
.nav-links { display: flex; gap: 0.5rem; align-items: center; }

.nav-link {
  font-size: 0.85rem; font-weight: 500; color: var(--ink-muted);
  text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--ink); background: var(--bg-alt); }

.nav-link-active {
  color: var(--ink); font-weight: 600; background: var(--bg-alt);
}

/* === NAV USER === */
.nav-spacer { flex: 1; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-email {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }

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

/* === NAV SHARED STYLES (used in app pages) === */
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 0.75rem; }
.nav-link {
  font-size: 0.85rem; font-weight: 500; color: var(--ink-muted);
  text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--ink); background: var(--bg-alt); }
.nav-link-active { color: var(--ink); font-weight: 600; background: var(--bg-alt); }

.inline-form { display: inline; }

@media (max-width: 600px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  .result-panel {
    padding: 1.25rem;
  }

  .step-card {
    padding: 0.875rem 1rem;
  }
}