/*
 * The whole stylesheet. Served from this origin, versioned with the page, and
 * loading nothing — no font host, no CDN, no @import. `default-src 'none'`
 * with `style-src 'self'` and `font-src 'none'` means an added webfont would
 * fail visibly rather than quietly becoming a third-party dependency inside
 * the cryptographic boundary.
 *
 * The accent and feedback tones are the same values as the rest of the estate
 * (`sm4rt-web`'s theme: accent #4A90D9, hover #3B82C4, the light alert tones).
 * Copied as VALUES on purpose — this page must not import a design system.
 */

:root {
  --accent: #4a90d9;
  --accent-hover: #3b82c4;
  --ink: #1a1a1a;
  --muted: #5f6b76;
  --line: #dde3e9;
  --page: #f4f6f8;
  --card: #ffffff;
  --error-bg: #fdecea;
  --error-border: #f5c6c0;
  --error-ink: #b03a2e;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ----------------------------------------------------------------- brand -- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

/* A CSS mark rather than an image: one less asset, one less request, and
   nothing to get out of step with the rest of the brand. */
.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: var(--accent);
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ------------------------------------------------------------------ card -- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.3;
  /* The heading is the technician-typed label. It is set with textContent, but
     a label containing one very long unbroken string should still not push the
     card wider than the viewport. */
  overflow-wrap: anywhere;
}

.lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.message {
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.fine {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------------ form -- */

.label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 7rem;
}

textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0 1rem;
}

.button {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.button-secondary {
  color: var(--accent);
  background: transparent;
  margin-top: 1rem;
}

.button-secondary:hover:not(:disabled) {
  background: #eef4fb;
  border-color: var(--accent-hover);
}

/* ----------------------------------------------------------------- alert -- */

.alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.alert-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-ink);
}

/* The platform honours `hidden` unless something overrides display; these rules
   set display on .card and .button, so say it explicitly. */
[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9edf1;
    --muted: #9aa7b4;
    --line: #2c353e;
    --page: #14191e;
    --card: #1c232a;
    --error-bg: #3a201d;
    --error-border: #6b332c;
    --error-ink: #f3b4ac;
  }

  .button-secondary:hover:not(:disabled) {
    background: #22303d;
  }
}
