/* SLOfit Keycloak login theme – shared styles for all pages. */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap');

:root {
  --slofit-color-primary: hsl(1.96deg 75.41% 52.16%);
  --slofit-color-on-primary: hsl(0 0% 100%);

  --ui-color-primary-570: hsl(1.96deg 75.41% 46%);

  --slofit-color-secondary: hsl(1.96deg 75.41% 52.16%);
  --slofit-color-on-secondary: hsl(0 0% 100%);

  --slofit-color-success: hsl(143.88deg 100% 28.32%);
  --slofit-color-on-success: hsl(0 0% 98%);

  --slofit-color-info: hsl(220, 76%, 26%);
  --slofit-color-on-info: hsl(0 0% 98%);

  --slofit-color-warning: hsl(24.32deg 100% 41.59%);
  --slofit-color-on-warning: hsl(0 0% 98%);

  --slofit-color-error: hsl(0, 100%, 63%);
  --slofit-color-on-error: hsl(0 0% 98%);

  --slofit-color-background: hsl(0 0% 100%);
  --slofit-color-on-background: hsl(0 0% 9%);

  --slofit-color-surface: hsl(0deg 0% 93.33%);
  --slofit-color-on-surface: hsl(0 0% 9%);
  --slofit-color-primary-on-surface: var(--ui-color-primary-570);

  --slofit-color-surface-variant: hsl(0deg 0% 88.63%);
  --slofit-color-on-surface-variant: hsl(0 0% 9%);
  --slofit-color-primary-on-surface-variant: hsl(1.96deg 75.41% 43%);

  --slofit-color-surface-muted: hsl(0, 100%, 5%);
  --slofit-color-on-surface-muted: hsl(0 0% 9%);

  --slofit-color-surface-dark: rgba(0, 0, 0, 0.5);
  --slofit-color-on-surface-dark: hsl(0 0% 98%);

  --slofit-color-fixed-light: hsl(0 0% 100%);
  --slofit-color-fixed-light-muted: hsl(0 0% 98% / 0.8);
  --slofit-color-fixed-dark: hsl(0 0% 9%);

  --container-width: 100rem;

  --font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--dark-bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.25;
}

/* The wrapper is the main container for the pages, it has the background image. */
#wrapper {
  background: var(--slofit-color-fixed-dark);
  background-image: url('../img/slofit-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  min-height: 100vh;
  display: flex;
  flex-direction: column;

  color: var(--slofit-color-fixed-light);

  padding: 2rem 0 4rem 0;
}

#wrapper p {
  color: var(--slofit-color-fixed-light-muted);
}

#wrapper p strong {
  color: var(--slofit-color-fixed-light);
}

#wrapper a p {
  color: var(--slofit-color-fixed-light);
}

header {
  margin-bottom: 2rem;
}

footer {
  background-color: var(--slofit-color-surface);
  color: var(--slofit-color-on-surface);
}

footer .footer-bottom {
  background-color: var(--slofit-color-surface-variant);
  color: var(--slofit-color-on-surface-variant);
}

footer .footer-bottom a {
  color: var(--slofit-color-primary-on-surface-variant);
}

#content {
  min-height: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-group label,
.main-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slofit-color-fixed-light);
}

.form-group input {
  padding: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--slofit-color-surface);
  width: 100%;
}

.form-group select {
  padding: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--slofit-color-surface);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type='radio'] {
  appearance: none;
  padding: 0.5rem;
  border-radius: 50%;
  border: 4px solid var(--slofit-color-surface);
  background-color: var(--slofit-color-background);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

input[type='radio']:checked {
  background-color: var(--slofit-color-primary);
}

a {
  color: var(--slofit-color-primary);
  text-decoration: none;
}

a:hover,
footer p a:hover {
  text-decoration: underline;
}

button:disabled,
button[disabled] {
  opacity: 0.8;
  cursor: not-allowed;
  background: var(--slofit-color-primary) !important;
}

button,
a.button-link {
  background: var(--slofit-color-primary);
  border: 1px solid var(--slofit-color-primary);
  color: var(--slofit-color-on-primary);
  font-size: 1rem;
  padding: 1rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  opacity: 1;
  text-decoration: none;
  text-align: center;
}

button:hover,
a.button-link:hover {
  background-color: var(--ui-color-primary-570);
}

button:focus-visible,
a.button-link:focus-visible {
  outline: 2px solid var(--slofit-color-fixed-light);
  outline-offset: 3px;
}

.button--outlined:focus-visible {
  outline: 2px solid var(--slofit-color-fixed-light);
  outline-offset: 3px;
}

hr {
  border: 1px solid var(--slofit-color-surface);
  margin: 2rem 0;
  opacity: 0.1;
}

#form-wrapper {
  display: flex;
  gap: 2rem;
  width: 100%;
}

.form-wrapper--centered {
  justify-content: center;
  align-items: center;
  margin: auto;
  padding-bottom: 84px; /* The approximate height of the header. So that the content is centered. */
}

.form-box {
  background: var(--slofit-color-surface-dark);
  padding: 2rem;
  border-radius: 0.5rem;
  width: 450px;
  flex-shrink: 0;
}

.form-wrapper--centered .form-box {
  width: 660px;
}

fieldset {
  border-style: none;
}

@media (max-width: 880px) {
  #form-wrapper {
    flex-direction: column;
  }

  .form-box {
    width: 100%;
  }

  .container {
    padding: 0 1rem;
  }
}

a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slofit-color-fixed-light);
  opacity: 0.8;
}

header a,
footer a,
a:hover,
a:focus {
  opacity: 1;
}

.form-error,
.field-error:not([hidden]) {
  display: block;
}

.field-error {
  border: var(--slofit-color-error);
  /* color: var(--slofit-color-on-error); */
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  padding: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--slofit-color-error);
  outline-offset: 0.2rem;
}

.heading {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

p {
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

p strong {
  font-weight: 600;
  opacity: 1;
}

p a {
  font-weight: 600;
  opacity: 0.9;
  text-decoration: underline;
}

#form-buttons {
  margin: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#form-buttons button {
  width: 100%;
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 0.5rem 0;
}

.radio-option {
  cursor: pointer;
}

.radio-options label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slofit-color-fixed-light);
  cursor: pointer;
}

.info-box p {
  margin-bottom: 0;
}

.field-hint {
  font-size: 0.8rem;
  color: #6b7280;
}

.global-message,
.invite-alert,
.logout-reason:not([hidden]) {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

.invite-alert {
  border: 1px solid var(--slofit-color-warning);
}

.logout-reason:not([hidden]) {
  display: block;
  border: 1px solid var(--slofit-color-primary);
}

.global-message {
  display: block;
  border: 1px solid var(--slofit-color-info);
}

.global-message--success {
  border-color: var(--slofit-color-success);
}

.global-message--warning {
  border-color: var(--slofit-color-warning);
}

.global-message--error {
  border-color: var(--slofit-color-error);
}

ul {
  list-style: disc;
  margin-left: 1rem;
}

.spacing {
  height: 1rem;
}

.icon-wrapper {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slofit-color-surface-dark);
  border-radius: 50%;
  padding: 0.5rem;
  margin-bottom: 1rem;
}

.button--outlined {
  background: transparent;
  color: var(--slofit-color-fixed-light);
  border: 1px solid var(--slofit-color-fixed-light);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.button--outlined:hover {
  background: var(--slofit-color-primary);
  color: var(--slofit-color-on-primary);
}

#form-buttons.form-buttons--row {
  flex-direction: row;
}

#form-buttons.form-buttons--row button {
  flex: 1;
  width: auto;
}

/* global: readonly inputs should look non-interactive everywhere in the theme */
input[readonly] {
  opacity: 0.65;
  cursor: default;
}

input[readonly]:focus {
  outline: none;
  box-shadow: none;
}

.confirm-subtitle {
  margin-bottom: 1.5rem;
  font-weight: 500;
}

button.button--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
  opacity: 0.8;
}

button.button--loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-top: -0.5rem;
  margin-left: -0.5rem;
  border: 2px solid var(--slofit-color-on-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.header-container {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--slofit-color-fixed-light);
  transition: all 0.2s ease;
}

.header-link-text {
  margin: 0;
}

.header-link--desktop {
  display: none;
}

@media (min-width: 880px) {
  .header-link--desktop {
    display: inline;
  }
}

.no-margin {
  margin-bottom: 0;
}

.footer-bottom-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.footer-bottom-content a {
  text-decoration: none;
}

.footer-content-top {
  padding-top: 2rem;
}

.footer-content {
  padding-bottom: 2rem;
}

address {
  font-style: normal;
}

.footer-content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 880px) {
  .footer-content-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.footer-content-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-content-grid-item h2,
.footer-content-grid-item h3,
.footer-content-grid-item p {
  margin-bottom: 0;
}

footer p a {
  color: var(--slofit-color-primary-on-surface);
  text-decoration: none;
}

.footer-content-social {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-content-social a {
  display: flex;
}

.checkbox-group {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slofit-color-fixed-light);
  margin: 1rem 0;
}

.checkbox-group label {
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-row label a {
  text-decoration: underline;
  opacity: 1;
  font-size: 1rem;
}

input[type='checkbox'] {
  accent-color: var(--slofit-color-primary);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#change-language-select {
  background: transparent;
  border: none;
  color: var(--slofit-color-fixed-light);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--slofit-color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.loader-indicator {
  --loader-color: #fff;
  width: var(--loader-size);
  height: var(--loader-size);
  border: calc(1px) solid var(--loader-color);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  flex-shrink: 0;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}