/* ==========================================================================
   U Utility templates — page styles (demo/utilities.html)
   One page, ten templates. The sticky bar switches between the views
   (.util-view); each view is a self-contained utility page.
   ========================================================================== */

/* Page frame ------------------------------------------------------------- */
.utilities {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.util-view {
  flex: 1;
}

/* Template switcher bar -------------------------------------------------- */
.util-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.util-bar__home {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}

.util-bar__home:hover {
  color: var(--on-inverse);
}

.util-bar__mark {
  color: var(--action);
}

.util-bar__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.util-tab {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.util-tab[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--canvas);
}

/* Big-message views: 404, thank-you, maintenance ------------------------- */
.util-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 140px) 24px;
}

.util-hero--narrow {
  max-width: 760px;
  gap: 18px;
}

.util-hero__kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-3);
}

.util-hero__kicker--sm {
  font-size: 13px;
}

.util-hero__title {
  margin: 0;
  font-family: var(--font-display);
  line-height: .95;
  letter-spacing: -.045em;
}

.util-hero__title--404 {
  max-width: 12ch;
  font-size: clamp(48px, 8vw, 128px);
  line-height: .9;
  letter-spacing: -.05em;
}

.util-hero__title--thanks {
  font-size: clamp(40px, 6vw, 72px);
}

.util-hero__title--maint {
  font-size: clamp(40px, 6vw, 80px);
}

.util-hero__lead {
  margin: 0;
  font-size: 18px;
  color: var(--ink-2);
}

.util-hero__lead--404 {
  max-width: 50ch;
  font-size: 19px;
}

.util-hero__link {
  font-weight: 600;
}

/* Green check badge on the thank-you page */
.util-hero__check {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pos-bg);
  color: var(--pos);
  font-size: 22px;
  font-weight: 700;
}

/* Pill buttons used by the big-message views */
.util-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.util-btn {
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.util-btn--primary {
  background: var(--action);
  color: var(--on-action);
}

.util-btn--primary:hover {
  background: var(--action-hover);
  color: var(--on-action);
}

.util-btn--secondary {
  border: 1px solid var(--line-2);
}

.util-btn--secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.util-btn--dashed {
  border: 1px dashed var(--line-2);
}

/* Status page ------------------------------------------------------------ */
.status {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px;
}

.status__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: -.04em;
}

.status__banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--warn-bg);
  color: var(--ink);
}

.status__pulse {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  animation: pulse 2s infinite;
}

.status__legend {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* 30-day uptime bars: one <i> per day, modifier for bad days */
.uptime {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.uptime__row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) 100px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.uptime__name {
  font-size: 14px;
}

.uptime__days {
  display: flex;
  gap: 2px;
  height: 24px;
}

.uptime__day {
  flex: 1;
  border-radius: 2px;
  background: var(--pos);
}

.uptime__day--warn {
  background: var(--warn);
}

.uptime__day--neg {
  background: var(--neg);
}

.uptime__state {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--pos);
  text-align: right;
}

.uptime__state--warn {
  color: var(--warn);
}

/* Incident timeline */
.incident {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--warn);
}

.incident__update {
  font-size: 14px;
}

.incident__time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.incident__next {
  font-size: 13px;
  color: var(--ink-2);
}

/* Help article ----------------------------------------------------------- */
.help {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.help__nav {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: 2px;
  max-width: 260px;
  font-size: 14px;
}

.help__search {
  min-height: 40px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
}

.help__group {
  padding: 6px 8px;
}

.help__group--next {
  padding-top: 14px;
}

.help__link {
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
}

.help__link[aria-current="page"] {
  background: var(--surface-2);
}

.help__article {
  display: flex;
  flex: 999 1 400px;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 720px;
  font-size: 17px;
  line-height: 1.65;
}

.help__crumbs,
.help__meta {
  font-size: 13px;
  color: var(--ink-3);
}

.help__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.help__p {
  margin: 0;
}

.help__steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.help__tip {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--info-bg);
  font-size: 15px;
}

.help__tip-label {
  color: var(--info);
}

.help__feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.help__vote {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
}

.help__thanks {
  font-size: 14px;
  color: var(--pos);
}

/* Auth cards: login, password reset, verify email ------------------------ */
.auth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(40px, 8vw, 96px) 24px;
}

.auth__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-frame);
}

.auth__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.auth__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.auth__text {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.auth__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth__label {
  font-size: 14px;
  font-weight: 600;
}

.auth__input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--canvas);
}

.auth__cta {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
}

.auth__cta:hover {
  background: var(--action-hover);
}

.auth__foot {
  font-size: 13px;
  color: var(--ink-3);
}

/* Cookie consent --------------------------------------------------------- */
/* Striped backdrop stands in for the page behind the banner */
.consent {
  position: relative;
  min-height: 70vh;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--canvas) 12px 24px);
}

.consent__dialog {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.consent__title {
  font-size: 18px;
}

.consent__text {
  font-size: 14px;
  color: var(--ink-2);
}

.consent__cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* One category row = a switch button */
.consent-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}

.consent-cat:disabled {
  cursor: default;
}

.consent-cat__name {
  font-size: 14px;
}

.consent-cat__desc {
  font-size: 13px;
  color: var(--ink-2);
}

.consent-cat__switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--line-2);
}

.consent-cat__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .16s;
}

.consent-cat[aria-checked="true"] .consent-cat__switch {
  background: var(--pos);
}

.consent-cat[aria-checked="true"] .consent-cat__switch::after {
  transform: translateX(16px);
}

.consent-cat:disabled .consent-cat__switch {
  opacity: .6;
}

.consent__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.consent__btn {
  min-height: 48px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.consent__custom {
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: underline;
}

.consent__state {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Legal pages ------------------------------------------------------------ */
.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.legal__nav {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  gap: 2px;
  max-width: 240px;
  font-size: 14px;
}

.legal__link {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.legal__link[aria-current="page"] {
  background: var(--surface-2);
}

.legal__doc {
  display: flex;
  flex: 999 1 400px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 720px;
  font-size: 16px;
  line-height: 1.7;
}

.legal__badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 12px;
}

.legal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: -.035em;
}

.legal__meta {
  font-size: 13px;
  color: var(--ink-3);
}

.legal__h2 {
  margin: 12px 0 6px;
  font-size: 19px;
}

.legal__p {
  margin: 0;
  color: var(--ink-2);
}

/* Small screens ---------------------------------------------------------- */
@media (max-width: 599px) {
  .uptime__row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .uptime__days {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
