/* Karrera branding for the Community Solid Server pages (login, authorize,
   account) and the OIDC provider's own pages (sign-out). Values come from
   specs/DESIGN.md; apps/web/src/styles/tokens.css is the same set of tokens
   for the web app. Keep the selectors in step with the CSS's stock
   main.css: its pages are built from that stylesheet's elements. */

@font-face {
  font-family: Rubik;
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(../fonts/rubik-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-primary: #D7527D;
  --color-primary-hover: #DA547F;
  --color-on-primary: #FFFFFF;
  --color-background: #F9F9F9;
  --color-surface: #FFFFFF;
  --color-surface-container: #F7F7F7;
  --color-on-surface: #191520;
  --color-on-surface-variant: #6A6A6A;
  --color-outline: #9D9D9D;
  --color-outline-variant: #D9D9D9;
  --color-error: #D6314B;
  --color-disabled: #9D9D9D;
  --rounded-sm: 8px;
  --rounded-lg: 16px;
  --card-shadow: 0 1px 4px rgba(12, 12, 13, .10), 0 1px 4px rgba(12, 12, 13, .05);
  --button-shadow: 0 1px 1px rgba(0, 0, 0, .30), 0 1px 1.5px rgba(0, 0, 0, .15);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #191520;
    --color-surface: #25202E;
    --color-surface-container: #2E2838;
    --color-on-surface: #F9F9F9;
    --color-on-surface-variant: #B4AEBD;
    --color-outline: #5C5766;
    --color-outline-variant: rgba(217, 194, 223, .2);
    --color-error: #FF7A90;
    --color-disabled: #5C5766;
  }
}

html {
  height: 100%;
  background-color: var(--color-background);
  overscroll-behavior: none;
}

body, input, button {
  font: 16px/1.5 Rubik, system-ui, sans-serif;
  font-weight: 400;
  color: var(--color-on-surface);
}

body {
  margin: 0;
  min-height: 100%;
}

.shell {
  box-sizing: border-box;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 16px;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--color-background);
  background-position: center;
  background-size: cover;
}

header {
  margin: 0 0 24px;
  text-align: center;
}
header img {
  height: 40px;
  width: auto;
}

main {
  padding: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--rounded-lg);
  box-shadow: var(--card-shadow);
}
@media (max-width: 480px) {
  main {
    padding: 24px 20px;
  }
}

main h1 {
  margin: 0 0 .5em;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
}
main h2 {
  margin: 1.5em 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}
main p {
  margin: .75em 0;
}
main h1 + p,
main h2 + p {
  margin-top: .25em;
}

footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-outline-variant);
  text-align: center;
  font-size: .875rem;
  color: var(--color-on-surface-variant);
}
footer p {
  margin: 0;
}

strong {
  font-weight: 600;
}

a {
  color: var(--color-primary);
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
}

code {
  font-size: 90%;
}

ul {
  margin: .75em 0;
}
li {
  margin: .5em 0;
}
li p {
  margin: 0;
}
ul > li {
  list-style-type: square;
}
ul > li::marker {
  color: var(--color-primary);
}
ul ul, ol ul {
  margin-top: 0;
  padding-left: 1em;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 0;
  margin: .5em 0 1em;
  font-size: .875rem;
  color: var(--color-on-surface-variant);
}
dl dt {
  font-weight: 500;
}
dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}

pre {
  overflow-x: scroll;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}
fieldset > legend {
  margin: 1.25em 0 .5em;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
}
fieldset > legend + p {
  margin: 0 0 .5em;
}
fieldset > fieldset > legend {
  font-size: .875rem;
}
.hidden legend {
  display: none;
}
fieldset ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
fieldset ol ol {
  margin: 0 0 1em .5em;
}
fieldset ol li:not(.checkbox, .radio) {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: .25em;
  margin: 0 0 16px;
}
fieldset li label {
  font-weight: 500;
  font-size: .875rem;
  cursor: pointer;
}
fieldset li.checkbox,
fieldset li.radio {
  margin: 8px 0;
}
fieldset li.checkbox > label,
fieldset li.radio > label {
  font-size: 1rem;
  font-weight: 400;
}
fieldset li.checkbox > label > input,
fieldset li.radio > label > input {
  margin: 0 .5em 0 0;
  accent-color: var(--color-primary);
}
fieldset li.radio > label {
  display: flex;
  align-items: flex-start;
  gap: .5em;
  overflow-wrap: anywhere;
}
fieldset li.radio > label > input {
  margin: .3em 0 0;
  flex: none;
}
fieldset li p {
  margin-top: .25em;
}

input:not([type=checkbox], [type=radio]) {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--rounded-sm);
}

button {
  cursor: pointer;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--rounded-sm);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 500;
  box-shadow: var(--button-shadow);
}
button:hover {
  background-color: var(--color-primary-hover);
}
button:disabled {
  background-color: var(--color-disabled);
  cursor: not-allowed;
}

/* Cancel and similar: an outlined button, so the primary action stands out. */
button.secondary {
  background: transparent;
  border: 1px solid var(--color-outline);
  color: var(--color-on-surface);
  box-shadow: none;
}
button.secondary:hover {
  background: var(--color-surface-container);
}

button.alternate {
  display: block;
  padding: 0;
  margin: .5em 0;
  background: none;
  box-shadow: none;
  color: var(--color-primary);
  font-weight: 500;
}
button.alternate:hover {
  background: none;
  text-decoration: underline;
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: var(--color-primary) solid 2px;
  outline-offset: 2px;
}

p.error {
  color: var(--color-error);
  font-weight: 500;
}
p.error:empty {
  display: none;
}

p.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 8px;
}
p.actions > button {
  width: 100%;
}
ul.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0 0 1em 0;
}
ul.actions > li {
  list-style-type: none;
  display: inline;
  margin-right: 1em;
}

/* Directly hide hidden elements. */
.hidden {
  display: none;
}

/* Hide form elements with a sliding animation so users can track more easily what is happening. */
form.loaded * {
  max-height: 1000px;
  transition: max-height .2s;
}
form .hidden:not(button) {
  display: block;
  max-height: 0;
  overflow: hidden;
}

ul.container > li {
  margin: 0.25em 0;
  list-style-type: none;
}
ul.container > li.container > a {
  font-weight: 700;
}

ol.breadcrumbs {
  list-style: none;
  padding: 0;
  margin: 0 0 0 .25em;
  font-size: 90%;
}
ol.breadcrumbs > li {
  display: inline;
}
ol.breadcrumbs > li > a {
  color: var(--color-on-surface-variant);
  font-weight: 400;
  white-space: nowrap;
}
ol.breadcrumbs > li > a:hover {
  color: var(--color-primary);
}
ol.breadcrumbs > li:not(:last-child):after {
  padding: 0 .25em;
  content: ' > ';
  color: var(--color-on-surface-variant);
}
ol.breadcrumbs > li:last-child {
  font-weight: 500;
  color: var(--color-primary);
}
ol.breadcrumbs > li:only-child {
  display: none;
}
