/* ClashReply design system — shared tokens and components */
:root {
  --cr-navy: #0b1930;
  --cr-ink: #162033;
  --cr-muted: #5d6878;
  --cr-line: #dfe4e8;
  --cr-paper: #fbfbf8;
  --cr-canvas: #f4f7fb;
  --cr-brand: #3d6f9f;
  --cr-brand-hover: #315f86;
  --cr-success: #059669;
  --cr-warning: #d97706;
  --cr-danger: #dc2626;
  --cr-radius-sm: 8px;
  --cr-radius-md: 12px;
  --cr-radius-lg: 16px;
  --cr-radius-xl: 20px;
  --cr-shadow-sm: 0 4px 14px rgba(11, 25, 48, 0.06);
  --cr-shadow-md: 0 12px 35px rgba(11, 25, 48, 0.08);
  --cr-shadow-lg: 0 24px 60px rgba(11, 25, 48, 0.12);
  --cr-font: "Inter", ui-sans-serif, system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--cr-font);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid rgba(61, 111, 159, 0.45);
  outline-offset: 2px;
}

.cr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--cr-radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cr-btn-primary {
  background: var(--cr-brand);
  color: #fff;
  box-shadow: 0 8px 24px rgba(61, 111, 159, 0.22);
}

.cr-btn-primary:hover {
  background: var(--cr-brand-hover);
}

.cr-btn-secondary {
  background: #fff;
  color: var(--cr-ink);
  border: 1px solid var(--cr-line);
}

.cr-btn-secondary:hover {
  border-color: #c5cdd6;
  background: #fafafa;
}

.cr-btn-ghost {
  background: transparent;
  color: var(--cr-muted);
}

.cr-btn-ghost:hover {
  color: var(--cr-ink);
  background: rgba(11, 25, 48, 0.04);
}

.cr-input,
.cr-select,
.cr-textarea {
  width: 100%;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-md);
  background: #fff;
  color: var(--cr-ink);
  font-size: 0.875rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cr-input,
.cr-select {
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
}

.cr-textarea {
  padding: 0.75rem 1rem;
  line-height: 1.6;
  resize: vertical;
}

.cr-input:focus,
.cr-select:focus,
.cr-textarea:focus {
  outline: none;
  border-color: var(--cr-brand);
  box-shadow: 0 0 0 4px rgba(61, 111, 159, 0.12);
}

.cr-card {
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-lg);
  background: #fff;
  box-shadow: var(--cr-shadow-sm);
}

.cr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cr-badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.cr-badge-brand {
  background: rgba(61, 111, 159, 0.12);
  color: var(--cr-brand);
}

.cr-alert {
  border-radius: var(--cr-radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.cr-alert-info {
  border: 1px solid rgba(61, 111, 159, 0.25);
  background: rgba(61, 111, 159, 0.08);
  color: #1e3a5f;
}

.cr-alert-warning {
  border: 1px solid rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
  color: #92400e;
}

.cr-alert-error {
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.06);
  color: #991b1b;
}

.cr-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--cr-line);
  border-radius: var(--cr-radius-xl);
  background: #fff;
}

.cr-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(61, 111, 159, 0.2);
  border-top-color: var(--cr-brand);
  border-radius: 9999px;
  animation: cr-spin 0.7s linear infinite;
}

@keyframes cr-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Landing page: navy dark + readable light sections (body.cr-landing) ── */

.cr-landing {
  --cr-navy-deep: #0b1930;
  --cr-navy-elevated: #132743;
  --cr-navy-panel: #1a3050;
  --cr-navy-border: #2a4060;
  --cr-on-navy: #eef3f8;
  --cr-on-navy-soft: #c8d6e4;
  --cr-on-navy-muted: #9eb4c8;
}

.cr-landing .bg-slate-900 {
  background-color: var(--cr-navy-deep) !important;
}

.cr-landing .bg-slate-800 {
  background-color: var(--cr-navy-elevated) !important;
}

.cr-landing .bg-slate-800\/80 {
  background-color: rgba(19, 39, 67, 0.94) !important;
}

.cr-landing .bg-slate-700 {
  background-color: var(--cr-navy-panel) !important;
}

.cr-landing .border-slate-700 {
  border-color: var(--cr-navy-border) !important;
}

.cr-landing .border-slate-600 {
  border-color: #354d6a !important;
}

.cr-landing header.bg-slate-900\/95 {
  background-color: rgba(11, 25, 48, 0.97) !important;
}

.cr-landing header .text-slate-300,
.cr-landing header .text-slate-400 {
  color: var(--cr-on-navy-soft) !important;
}

.cr-landing section:not(.professional-light) .text-slate-300 {
  color: var(--cr-on-navy-soft) !important;
}

.cr-landing section:not(.professional-light) .text-slate-400 {
  color: var(--cr-on-navy-muted) !important;
}

.cr-landing section:not(.professional-light) .text-slate-500 {
  color: #849ab0 !important;
}

.cr-landing section:not(.professional-light) .text-blue-500,
.cr-landing section:not(.professional-light) .text-blue-600 {
  color: #6ba3d1 !important;
}

/* Light sections: white cards, navy headings, readable body copy */
.cr-landing section.professional-light {
  background: var(--cr-canvas) !important;
  color: var(--cr-ink) !important;
}

.cr-landing section.professional-light .text-white {
  color: var(--cr-navy) !important;
}

.cr-landing section.professional-light .text-slate-300 {
  color: var(--cr-ink) !important;
}

.cr-landing section.professional-light .text-slate-400 {
  color: var(--cr-muted) !important;
}

.cr-landing section.professional-light .text-slate-500 {
  color: #4a5568 !important;
}

.cr-landing section.professional-light .text-slate-700 {
  color: #64748b !important;
}

/* Finding cards: always high contrast (never gray-on-gray) */
.cr-landing .finding-card {
  background: #ffffff !important;
  border-color: #d0dae6 !important;
  color: #162033 !important;
}

.cr-landing .finding-card-label {
  color: #3d6f9f !important;
}

.cr-landing .finding-card-body,
.cr-landing .finding-card-body span {
  color: #162033 !important;
}

.cr-landing .finding-card-empty {
  color: #5d6878 !important;
}

.cr-landing .finding-card-bullet {
  color: #3d6f9f !important;
}

.cr-landing header a[aria-label="ClashReply home"] span:last-child,
.cr-landing header .brand-wordmark {
  color: #ffffff !important;
}

.cr-landing section.professional-light .bg-slate-900,
.cr-landing section.professional-light .bg-slate-800,
.cr-landing section.professional-light .bg-slate-800\/80 {
  background-color: #ffffff !important;
}

.cr-landing section.professional-light .border-slate-700,
.cr-landing section.professional-light .border-slate-600 {
  border-color: var(--cr-line) !important;
}

.cr-landing section.professional-light .hover\:border-slate-600:hover {
  border-color: #b8c5d0 !important;
}

.cr-landing section.professional-light .text-blue-600,
.cr-landing section.professional-light .text-blue-400 {
  color: var(--cr-brand) !important;
}

.cr-landing section.professional-light a.text-blue-400:hover {
  color: var(--cr-brand-hover) !important;
}

.cr-landing section.professional-light .journey-step.is-active {
  border-color: rgba(61, 111, 159, 0.45) !important;
  background: rgba(61, 111, 159, 0.1) !important;
  color: var(--cr-brand) !important;
}

.cr-landing section.professional-light .text-slate-200 {
  color: var(--cr-ink) !important;
}

.cr-landing section.professional-light .bg-slate-900\/80,
.cr-landing section.professional-light .bg-slate-900\/60 {
  background-color: #ffffff !important;
  border-color: var(--cr-line) !important;
}

.cr-landing section.professional-light .response-document {
  background: #ffffff !important;
  color: var(--cr-ink) !important;
}

.cr-landing section.professional-light #copy-btn,
.cr-landing section.professional-light #edit-btn,
.cr-landing section.professional-light #regenerate-btn,
.cr-landing section.professional-light #firm-btn,
.cr-landing section.professional-light #neutral-btn,
.cr-landing section.professional-light #concise-btn {
  background-color: var(--cr-navy) !important;
  border-color: var(--cr-navy) !important;
  color: #ffffff !important;
}

.cr-landing section.professional-light #copy-btn:hover,
.cr-landing section.professional-light #edit-btn:hover,
.cr-landing section.professional-light #regenerate-btn:hover,
.cr-landing section.professional-light #firm-btn:hover,
.cr-landing section.professional-light #neutral-btn:hover,
.cr-landing section.professional-light #concise-btn:hover {
  border-color: var(--cr-brand) !important;
  background-color: #132743 !important;
}

.cr-landing section.professional-light #review-notice {
  background: rgba(61, 111, 159, 0.06) !important;
  border-color: rgba(61, 111, 159, 0.22) !important;
  color: var(--cr-muted) !important;
}

/* Navy CTA blocks on guide pages and elsewhere */
section.bg-slate-900 .text-slate-300 {
  color: #c8d6e4;
}

section.bg-slate-900 .text-slate-400 {
  color: #9eb4c8;
}

section.rounded-2xl.bg-slate-900 {
  background-color: var(--cr-navy) !important;
}
