/* ---------------------------------------------------------
   Receipt & invoice extractor demo — shares the hub's visual
   language (signal teal / warm amber) since this is Decision
   Clarity's own product, not a client template.
--------------------------------------------------------- */

:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --ink: #16211d;
  --muted: #626d68;
  --muted-2: #8a948f;
  --line: #d8ded9;
  --signal: #2b6e5b;
  --signal-strong: #1f5245;
  --signal-bg: #e4efeb;
  --warm: #d98c3f;
  --warm-strong: #b96f27;
  --danger: #a3392b;
  --danger-bg: #f7e8e5;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;

  --max-width: 40rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--signal-strong);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}

.skip-link:focus {
  left: var(--gutter);
  top: 1rem;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.back-link {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--muted);
}

.back-link:hover {
  color: var(--signal-strong);
}

/* ---------- Page ---------- */

.page {
  padding-block: clamp(2rem, 6vw, 3.5rem);
}

.page-head h1 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
}

.page-head p {
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 52ch;
}

/* ---------- Capability note ---------- */

.capability-note {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 52ch;
}

/* ---------- Form ---------- */

.intake-form {
  margin-top: 1.5rem;
}

.intake-form label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.composer {
  border-radius: 1.25rem;
  background: var(--ink);
  padding: 0.25rem 0.25rem 0.75rem;
}

.intake-form textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 1rem 1.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--bg);
  resize: vertical;
  min-height: 6.5rem;
}

.intake-form textarea::placeholder {
  color: #808b85;
}

.intake-form textarea:focus-visible {
  outline: none;
}

.composer:focus-within {
  box-shadow: 0 0 0 2px var(--signal);
}

.composer-footer {
  padding-inline: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.char-count {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: #808b85;
}

.session-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.send-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: var(--warm);
  color: #23150a;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.send-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.send-btn:hover:not(:disabled) {
  background: var(--warm-strong);
  transform: translateY(-1px);
}

.send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.send-btn:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.send-btn.is-loading .send-icon {
  animation: send-icon-pulse 1s ease-in-out infinite;
}

@keyframes send-icon-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .send-btn.is-loading .send-icon {
    animation: none;
  }
}

/* ---------- Result panel ---------- */

.result-panel {
  margin-top: 2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.result-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .result-panel {
    transition: none;
    transform: none;
  }
}

.result-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.result-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.result-value {
  font-size: 0.9375rem;
}

.result-line-items {
  margin-top: 1.25rem;
}

.line-items-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.line-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.line-item-description {
  flex: 1;
}

.line-item-amount {
  flex: none;
  font-family: var(--font-display);
  color: var(--muted);
}

.line-item-empty {
  color: var(--muted);
}

/* ---------- Error panel ---------- */

.error-panel {
  margin-top: 2rem;
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}
