/* Page frame: header, columns and cards. dashboard.css styles the cards' contents and the themes. */

:root {
  --widget-gap: 23px;
  --widget-content-vertical-padding: 15px;
  --widget-content-horizontal-padding: 17px;
  --content-bounds-padding: 15px;
  --font-size-h1: 1.7rem;
  --font-size-h2: 1.6rem;
  --font-size-h3: 1.5rem;
  --font-size-h4: 1.4rem;
  --font-size-base: 1.3rem;
  --font-size-h5: 1.2rem;
  --font-size-h6: 1.1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* 1rem = 10px */
  font-size: 62.5%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-base);
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
p {
  margin: 0;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

.body-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-bounds {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 var(--content-bounds-padding);
}

.grow {
  flex: 1;
}

.header-container {
  margin-top: calc(var(--widget-gap) / 2);
}

.header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 52px;
  padding: 0 calc(var(--widget-content-horizontal-padding) + 1px);
  border: 1px solid var(--color-widget-content-border);
  border-radius: var(--dash-radius);
  background: var(--color-widget-background);
  box-shadow: var(--dash-card-shadow);
}

.logo {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  color: var(--color-text-highlight);
}

/* The circular mark has a margin inside its square image; the circle crop keeps any corner from showing. */
.logo img,
.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: scale(1.16);
}

.logo {
  width: 3rem;
  height: 3rem;
}

.desktop-navigation {
  display: flex;
  flex: 1;
  gap: 2.4rem;
  align-self: stretch;
}

.nav-item {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--color-text-subdue);
  font-size: var(--font-size-h3);
  font-weight: 700;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav-item-current {
  border-bottom-color: var(--color-primary);
  color: var(--color-text-highlight);
}

@media (hover: hover) and (pointer: fine) {
  .nav-item:not(.nav-item-current):hover {
    color: var(--color-text-highlight);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page {
  padding: var(--widget-gap) 0;
}

.page-columns {
  display: flex;
  gap: var(--widget-gap);
}

.page-column {
  display: flex;
  flex-direction: column;
  gap: var(--widget-gap);
  min-width: 0;
}

.page-column-small {
  flex-shrink: 0;
  width: 300px;
}

.page-column-full {
  flex: 1;
}

.widget-content {
  padding: var(--widget-content-vertical-padding) var(--widget-content-horizontal-padding);
}

.dash-slot:empty,
.dash-slot > :empty {
  display: none;
}

/* Narrow screens stack the columns and let the page scroll. */
@media (max-width: 1190px) {
  .page-columns {
    flex-direction: column;
  }

  .page-column-small {
    width: 100%;
  }

  .header {
    gap: 1.6rem;
  }
}

/* Sign-in page */

/* dvh: on a phone, 100vh includes the area under the address bar, so the page would scroll. */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 400px);
  padding: 36px 32px 30px;
  border: 1px solid var(--color-widget-content-border);
  border-radius: 16px;
  background: var(--color-widget-background);
  box-shadow: var(--dash-card-shadow);
  text-align: center;
  animation: dash-rise 420ms var(--ease-out) backwards;
}

.login-logo {
  width: 5.6rem;
  height: 5.6rem;
}

.login-card h1 {
  color: var(--color-text-highlight);
  font-size: 2.4rem;
  font-weight: 800;
}

.login-lead {
  color: var(--color-text-subdue);
}

.login-button {
  justify-content: center;
  width: 100%;
  height: 4.2rem;
  margin-top: 6px;
}

.login-error {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-negative) 12%, transparent);
  color: var(--color-negative);
}

.login-dev {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

/* Google sign-in, as on api-core's /admin/login: a full-width plain button with Google's 18px mark. */
.login-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 4rem;
  margin-top: 6px;
  border: 1px solid var(--color-widget-content-border);
  border-radius: 8px;
  background: var(--color-widget-background);
  color: var(--color-text-highlight);
  font-size: 1.4rem;
  font-weight: 600;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}

.login-google img {
  width: 18px;
  height: 18px;
}

.login-google:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .login-google:hover {
    background: var(--color-widget-background-highlight);
  }
}
