/* Pauhu.com — Brief tool + landing page styles
 * Base: /css/brand.css (shared across all domains)
 */

/* Variable aliases — brief.js references these */
:root {
  --bg-primary: var(--color-surface);
  --bg-secondary: var(--color-container);
  --bg-tertiary: var(--color-container-bright);
  --text-primary: var(--color-on-surface);
  --text-secondary: var(--color-on-surface-variant);
  --text-muted: var(--color-outline-variant);
  --accent: var(--ana-2);
  --accent-hover: var(--ana-3);
  --border: var(--color-outline-variant);
  --success: var(--color-success);
  --error: var(--color-error);
}

/* Brief Form */
.brief-form,
.reply-form {
  margin-bottom: 2rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  transition: border-color 0.15s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
}

.brief-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.5;
}

.brief-input::placeholder {
  color: var(--text-muted);
}

.brief-submit {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-left: 0.5rem;
}

.brief-submit:hover {
  background: var(--accent-hover);
}

.brief-submit:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

/* Examples */
.examples {
  margin-top: 1.5rem;
}

.examples-label {
  color: var(--color-on-surface-variant);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.example-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.example-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Conversation State */
.brief-conversation {
  max-width: 640px;
  width: 100%;
}

.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.back-btn:hover {
  color: var(--text-primary);
}

.brief-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: var(--color-primary-container);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

/* Footer heading (matching pauhu.eu pattern) */
.footer-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--color-on-inverse-surface);
  opacity: 0.8;
}

/* Messages */
.messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.ai {
  flex-direction: row;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.message.ai .message-avatar {
  background: var(--accent);
}

.message-content {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  max-width: 80%;
}

.message.user .message-content {
  background: var(--bg-tertiary);
}

.message-text {
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Result State */
.brief-result {
  max-width: 720px;
  width: 100%;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.result-document {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.result-document h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

.result-document h2 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.result-document p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.result-document ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.result-document li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn.primary {
  background: var(--accent);
  border: none;
  color: white;
}

.action-btn.primary:hover {
  background: var(--accent-hover);
}

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  border-color: var(--text-secondary);
}

/* Lead Capture */
.lead-capture {
  background: var(--color-primary-container);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.lead-text {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s ease;
}

.cta-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

/* Brief-specific footer (minimal) */
.footer-copy {
  color: var(--color-on-inverse-surface);
  font-size: 0.75rem;
}

/* Responsive — brief */
@media (max-width: 640px) {
  .main { padding: 1rem; }
  .brief-title { font-size: 1.5rem; }
  .example-chips { flex-direction: column; }
  .example-chip { width: 100%; text-align: center; }
  .result-actions { flex-direction: column; }
  .action-btn { justify-content: center; width: 100%; }
}

/* Signup form */
.lead-capture {
  margin-top: 2rem;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  margin: 0 auto;
}

.signup-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.signup-form input:focus {
  border-color: var(--accent);
}

.signup-form input::placeholder {
  color: var(--text-muted);
}

.cta-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.signup-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.signup-status.error {
  color: var(--color-error);
}

.signup-status.success {
  color: var(--color-success);
}

.signup-alt {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.signup-alt a {
  color: var(--accent);
  text-decoration: none;
}

.signup-alt a:hover {
  text-decoration: underline;
}
