/* The portal, in the cloudcake website's style (website/styles.css): the
   same colours, type and shapes. Unlike the site, the whole page is orange, as
   the sign-in pages are, with content on white cards. The site has no dark mode,
   so neither does this. */
:root {
  color-scheme: light;
  --orange: #f79400;   /* the logo's background */
  --brown: #a96106;    /* the logo's cupcake wrapper. 4.8:1 on white, so fine for text */
  --ink: #1c1b19;
  --quiet: #5f5b53;
  --page: #fbfaf7;
  --sand: #f2ede3;
  --white: #ffffff;
  --rule: #e6e1d6;
  --warning: #8b0000;
  --header-height: 84px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--orange);
  color: var(--ink);
  font: 17px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

h1, h2, h3, p, ul, figure { margin: 0; }

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout */

.container,
.site-header__inner {
  width: 100%;
  max-width: 1296px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* so a long command scrolls, not the page */
  gap: clamp(24px, 3vw, 40px);
  padding-block: clamp(32px, 5vw, 64px);
}

.card {
  scroll-margin-top: calc(var(--header-height) + 16px);  /* clear of the sticky header */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: clamp(24px, 3.4vw, 48px);
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--white);
}

.lede { color: var(--quiet); max-width: 44em; }

.eyebrow {
  color: var(--brown);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--orange);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  min-height: var(--header-height);
}

.logo {
  width: auto;
  height: 44px;
}

.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.link-button:hover { text-decoration-line: underline; }

/* Signed out: the website's hero, an ink box on the orange band */

.hero {
  padding-block: clamp(16px, 3vw, 40px) clamp(40px, 6vw, 72px);
  background: var(--orange);
}

.headline-box {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  justify-items: start;
  padding: clamp(28px, 4vw, 64px);
  border-radius: 20px;
  background: var(--ink);
  color: var(--page);
}

.headline-box h1 {
  font-size: clamp(2.5rem, 5.7vw, 5.1rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.headline-box em {
  color: var(--orange);
  font-style: normal;
}

.headline-box .button { justify-self: end; }

/* Controls */

.button {
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--page);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
}

.button:hover { background: #000; }

.button--orange {
  background: var(--orange);
  color: var(--ink);
  font-size: 1.125rem;
}

.button--orange:hover { background: #ffa31a; }

.button--quiet {
  border: 1.5px solid var(--ink);
  background: var(--white);
  color: var(--ink);
}

.button--quiet:hover { background: var(--sand); }

.button--small { padding: 6px 14px; font-size: 0.9375rem; }

label { font-weight: 600; }

input:not([type=checkbox]) {
  padding: 11px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

input:not([type=checkbox]):focus-visible { border-color: var(--ink); }

.scan-form { display: grid; gap: 8px; max-width: 520px; }

.scan-form__row { display: flex; gap: 12px; }

.scan-form__row input { flex: 1; min-width: 0; }

[role=status] { color: var(--quiet); }

/* Connecting an account */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.command { display: flex; gap: 12px; align-items: flex-start; }

pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--sand);
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* Scans, one table per account */

#scan-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }

.scan-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* The same column widths in every account's table, so they line up. */
.scan-group table { table-layout: fixed; }
.scan-group th:nth-child(1) { width: 32%; }
.scan-group th:nth-child(2) { width: 32%; }
.scan-group th:nth-child(4) { width: 6rem; }

.table-scroll { position: relative; overflow-x: auto; }  /* relative keeps hidden labels inside */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th, td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--quiet);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Results */

.total {
  color: var(--brown);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.notice {
  padding: 16px 20px;
  border-left: 4px solid var(--orange);
  border-radius: 12px;
  background: var(--sand);
}

.notice ul { margin-top: 8px; padding-left: 20px; }

.disclaimer {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--warning);
  color: var(--white);
}

/* Phones */

@media (max-width: 860px) {
  body { font-size: 16px; }

  .site-header { position: static; }

  .logo { height: 36px; }

  .command { flex-direction: column; align-items: stretch; }

  .command .button { align-self: flex-start; }
}

@media (max-width: 480px) {
  .scan-form__row { flex-direction: column; }

  .scan-form__row .button { align-self: flex-start; }

  /* Too narrow for fixed columns: let each take what its content needs. */
  .scan-group table { table-layout: auto; font-size: 0.875rem; }
  .scan-group th { width: auto !important; }
  th, td { padding-right: 6px; }
  td:last-child, th:last-child { padding-right: 0; }
  .button--small { padding: 4px 10px; }
}
