/* Lukas Westberg Homelab Alerts - SMS program pages */

:root {
  --paper: #f2f4f3;
  --card: #ffffff;
  --ink: #0e1614;
  --muted: #5c6a66;
  --rule: #d3dad7;
  --up: #1f6f5c;
  --down: #a63a2b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

/* ---- masthead ---- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
}

.brand {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.brand a:hover {
  color: var(--ink);
}

.states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.state {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.state--up {
  color: var(--up);
}

.state--down {
  color: var(--down);
}

.state--idle {
  color: var(--muted);
}

/* ---- type ---- */

h1 {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.lede {
  color: var(--muted);
  font-size: 1.0625rem;
  margin: 0 0 2rem;
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--up);
}

strong {
  font-weight: 600;
}

.kw {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.updated {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---- opt-in form ---- */

.form {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

input[type="tel"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

input[type="tel"]:focus-visible,
button:focus-visible,
input[type="checkbox"]:focus-visible,
a:focus-visible {
  outline: 2px solid var(--up);
  outline-offset: 2px;
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.consent input[type="checkbox"] {
  margin-top: 0.35rem;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.consent label {
  font-family: var(--sans);
  font-size: 0.9375rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  margin: 0;
}

button {
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

button:hover {
  background: var(--up);
}

.result {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--up);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.55;
}

.result[hidden] {
  display: none;
}

/* ---- footer ---- */

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  margin-right: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- rev2: optional-SMS form additions ---- */

.callout {
  border-left: 3px solid var(--up);
  background: var(--card);
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0;
}

.callout p {
  margin: 0;
  font-size: 0.9375rem;
}

.req,
.opt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  margin-left: 0.4rem;
  text-transform: uppercase;
}

.req {
  color: var(--down);
  border: 1px solid currentColor;
}

.opt {
  color: var(--muted);
  border: 1px solid currentColor;
}

.hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.hint--consent {
  margin: 0.6rem 0 0;
  padding-left: 1.8rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.75rem 0 1.25rem;
}

.optional-head {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}

button.secondary:hover {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink);
}

main em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.9em;
}
