@use "sass:map";
@use "@gouvfr-lasuite/cunningham-react/sass/fonts";
@use "@gouvfr-lasuite/cunningham-react/sass/icons";
@use "@gouvfr-lasuite/cunningham-react/style";
@use "cunningham-tokens";
@use "cunningham-tokens-sass" as *;

$lg: map.get($themes, "default", "theme", "breakpoints", "lg");
$sm: map.get($themes, "default", "theme", "breakpoints", "sm");

// Reset
h1 {
  font-family: var(--c--globals--font--families--accent);
  font-size: clamp(2.5rem, 7vw, 4rem);
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--c--contextuals--content--semantic--neutral--primary);
  text-decoration: underline;
}

// App
html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  background: linear-gradient(
    153deg,
    var(--c--contextuals--background--surface--tertiary) 0%,
    var(--c--contextuals--background--surface--primary) 100%
  );
  background-attachment: fixed;
}

.pattern {
  position: absolute;
  z-index: -1;
  top: -200px;
  left: -290px;
  transform: rotate(335deg);
}

.theme-switch {
  position: fixed;
  right: 1rem;
  top: 0.75rem;

  display: flex;
  align-items: center;
  gap: 1rem;

  --c--components--forms-field--width: 150px;
}

.card {
  background-color: var(--c--contextuals--background--surface--secondary);
  padding: 2rem;
  border-radius: var(--c--components--card--border-radius, 4px);
  border: var(--c--components--card--border-width, 1px)
    var(--c--contextuals--border--semantic--neutral--tertiary) solid;
  box-shadow: var(
    --c--components--card--box-shadow,
    rgba(149, 157, 165, 0.2) 0px 8px 24px
  );
}

.container {
  margin: auto;
  position: relative;
  overflow: hidden;
  width: 1100px;

  min-height: 100%;
  display: flex;
  flex-direction: column;

  @media (max-width: 1200px) {
    width: calc(100% - 2rem);
  }
}

// Home
.page__home {
  display: flex;
  flex-grow: 1;
  flex-direction: column;

  &__title {
    gap: 1.5rem;
    margin: 4rem 0;

    @media (max-width: $lg) {
      margin: 6rem 0 4rem 0;
    }

    button {
      margin-top: 1.5rem;
    }
  }

  section {
    flex: 1;
  }
}

html[data-theme="uikit"][data-variant="light"] body,
html[data-theme="cunningham"] body {
  background-repeat: no-repeat;
  background-position: -300px -300px;
  background-attachment: fixed;
}

html[data-theme="cunningham"][data-variant="dark"] body {
  background-image: url(/pattern_dark.png);
}

html[data-theme="uikit"][data-variant="light"] body,
html[data-theme="cunningham"][data-variant="light"] body {
  background-image: url(/pattern_default.png);
}

html[data-theme="uikit"] {
  background: linear-gradient(
    153deg,
    var(--c--theme--colors--gray-025) 0%,
    var(--c--theme--colors--gray-000) 100%
  );
  background-blend-mode: darken;
}

html[data-theme="redflux"] {
  background: #000000d7 url(/redflux_bg.webp) 50% / cover no-repeat fixed;
  background-blend-mode: darken;
}

html[data-theme="blueney"] {
  background: url(/blueney_bg.jpg) 50% / cover no-repeat fixed;
}

// Create
.page__create {
  h1 {
    text-align: center;
    margin: 4rem 0;
  }

  &__group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;

    h3,
    h4 {
      margin: 0;
    }
  }
}

// Onboarding Modal
.onboarding__title {
  margin-top: 0;
}

.onboarding__title-icon {
  font-size: 2rem;
  margin: 0;
}
.onboarding__content {
  max-width: 680px;
  line-height: 1.5rem;
  text-align: left;

  & p {
    margin-bottom: 1rem;
  }
}
.onboarding__footer {
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
  align-items: center;
  gap: 1rem;

  & > .c__button:first-child {
    min-width: 200px;
    justify-content: center;
  }

  @media (max-width: $sm) {
    flex-direction: column;
    flex-grow: 1;

    > .c__button {
      width: 100%;
      min-width: auto;
    }
  }
}

.links {
  border-top: thin solid
    var(--c--contextuals--border--semantic--neutral--tertiary);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 5rem;

  ul {
    text-align: right;
    padding: 0;
  }
  ul li {
    display: inline-block;
    padding: 0 0.5rem;
    white-space: nowrap;
  }
}
