/* The portal's own look, on top of the finders' design system (tokens.css, components.css). */

@font-face {
  font-family: "Instrument Sans";
  font-weight: 400;
  font-display: swap;
  src: url(/static/instrument-sans-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-weight: 500;
  font-display: swap;
  src: url(/static/instrument-sans-latin-500-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-weight: 600;
  font-display: swap;
  src: url(/static/instrument-sans-latin-600-normal.woff2) format("woff2");
}

:root {
  --font-sans: "Instrument Sans", var(--font-sans-fallback);
}

/* A soft glow of the brand's volt green at the top of the page. */
body {
  background:
    radial-gradient(48rem 24rem at 50% -8rem, color-mix(in srgb, var(--volt) 28%, transparent), transparent 70%),
    var(--surface);
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Brand bar, page, credit: one column, the page high rather than lost in the middle. */

.shell {
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-4);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--type-heading-size);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  width: 32px;
  height: 32px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  background: var(--volt);
  color: var(--on-volt);
}

main {
  padding: clamp(var(--space-8), 12vh, 120px) 0 var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

h1 {
  margin: 0;
  font-size: var(--type-title-size);
  line-height: var(--type-title-line);
  font-weight: var(--type-title-weight);
  letter-spacing: var(--type-title-tracking);
}

.credit {
  padding: var(--space-4) 0;
  text-align: center;
  font-size: var(--type-body-sm-size);
  line-height: var(--type-body-sm-line);
  color: var(--ink-muted);
}

/* Sign in: a card, narrower than the page. */

.panel {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: var(--space-6);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.lead {
  margin: calc(var(--space-2) * -1) 0 0;
  color: var(--ink-muted);
}

.error {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
}

.login {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--type-body-sm-size);
  color: var(--ink-muted);
}

.login input {
  font: inherit;
  font-size: 16px; /* below 16px, iOS zooms into the field */
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
}

.login input:focus {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

.login .pf-btn {
  margin-top: var(--space-2);
}

/* The two apps: side by side when there is room. */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.app {
  position: relative;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 150ms ease-out,
    transform 150ms ease-out;
}

.app:hover {
  border-color: var(--pine);
  transform: translateY(-2px);
}

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

.app-icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-3);
  padding: 10px;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  background: var(--pine-soft);
  color: var(--pine);
}

.app-name {
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-line);
  font-weight: 600;
}

.app-go {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 20px;
  height: 20px;
  color: var(--ink-muted);
  transition:
    transform 150ms ease-out,
    color 150ms ease-out;
}

.app:hover .app-go {
  color: var(--pine);
  transform: translateX(3px);
}

/* Who is signed in, and the way out: quiet, in the brand bar. */

.account {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-body-sm-size);
  color: var(--ink-muted);
}

.account button {
  font: inherit;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.account button:hover {
  background: var(--surface-sunken);
}

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

@media (prefers-reduced-motion: reduce) {
  .app,
  .app-go {
    transition: none;
  }
}
