/*
 * OpenLine public pages. Mobile first, single column.
 *
 * System font stack on purpose: a page that promises it makes no
 * third-party requests must not fetch a typeface from Google.
 *
 * Palette matches frontend/src/constants/theme/tokens.ts — navy 600
 * #211B43, warm 50 #FAFAF7, navy 500 #2D2658, warm 300 #D5D2C9.
 */

:root {
  --navy: #211b43;
  --navy-600: #2d2658;
  --navy-200: #7a72a8;
  --canvas: #fafaf7;
  --raised: #ffffff;
  --line: #d5d2c9;
  --ink: #1f1b2e;
  --ink-soft: #5c5850;
  --danger: #a3271f;
  --radius: 10px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Every interactive element keeps a visible focus ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--navy-200);
  outline-offset: 2px;
}

.ol-header {
  background: var(--navy);
  padding: 18px 16px;
}

.ol-wordmark {
  color: #fff;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.ol-main {
  flex: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.ol-footer {
  padding: 20px 16px 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.ol-h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 16px;
  color: var(--navy);
}

.ol-lede {
  margin: 0 0 16px;
  font-size: 1.0625rem;
}

.ol-note {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.ol-note--strong {
  color: var(--ink);
}

.ol-aside {
  margin-top: 28px;
  font-size: 0.9375rem;
}

.ol-aside a,
.ol-main a {
  color: var(--navy-600);
}

.ol-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--danger);
  background: #fdf2f1;
  color: var(--danger);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
}

/* ─── Forms ───────────────────────────────────────────────────────── */

.ol-form {
  margin: 20px 0 0;
}

.ol-label,
.ol-legend {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  padding: 0;
}

.ol-textarea,
.ol-input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.ol-textarea {
  min-height: 9rem;
  resize: vertical;
}

.ol-input {
  min-height: 48px;
}

.ol-input--caseid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ol-fieldset {
  border: 0;
  padding: 0;
  margin: 20px 0 0;
}

.ol-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ol-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised);
  cursor: pointer;
  font-size: 0.9375rem;
}

.ol-chip input {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.ol-chip:has(input:checked) {
  border-color: var(--navy);
  background: #efedf7;
  color: var(--navy);
  font-weight: 600;
}

.ol-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 8px 0 16px;
  cursor: pointer;
  font-size: 0.9375rem;
}

.ol-checkbox input {
  width: 22px;
  height: 22px;
  accent-color: var(--navy);
  flex: none;
}

.ol-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 20px;
  padding: 0 24px;
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
}

.ol-button:hover:not(:disabled) {
  background: var(--navy-600);
}

.ol-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ol-button--secondary {
  width: auto;
  margin-top: 0;
  color: var(--navy);
  background: var(--raised);
  border-color: var(--line);
}

.ol-button--secondary:hover:not(:disabled) {
  background: #f1efe7;
}

/* ─── Case ID ─────────────────────────────────────────────────────── */

.ol-caseid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--navy);
  background: var(--raised);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: 18px 12px;
  margin: 20px 0 14px;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.ol-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ol-copied {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ─── Thread ──────────────────────────────────────────────────────── */

.ol-status {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.ol-status strong {
  color: var(--navy);
}

.ol-thread {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ol-message {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--line);
}

.ol-message--ceo {
  background: #efedf7;
  border-color: #cfc9e6;
}

.ol-message-who {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-600);
}

.ol-message-body {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 40rem) {
  .ol-main {
    padding-top: 40px;
  }
  .ol-h1 {
    font-size: 1.75rem;
  }
  .ol-button {
    width: auto;
    min-width: 12rem;
  }
}
