/* 1. Configuration */
@font-face {
  font-family: 'Satoshi-Medium';
  src: url('fonts/Satoshi-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Satoshi-Bold';
  src: url('fonts/Satoshi-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --font-medium: 'Satoshi-Medium', sans-serif;
  --font-bold: 'Satoshi-Bold', sans-serif;

  --color-black: #23334b;
  --color-white: #ffffff;
  --color-grey-light: #f8f8f8;
  --color-grey: #dcdcdc;
  --color-grey-dark: #a0a0a0;
  --color-purple: #3a3c9c;
  --color-green: #49a263;
  --color-red: #f35c49;

  --color-background: var(--color-grey-light);
  --color-text: var(--color-black);
  --color-link: var(--color-purple);
  --color-link-underline: var(--color-purple);
  --color-link-underline-hover: var(--color-grey-light);
  --color-input-background: var(--color-white);
  --color-input-border: var(--color-grey-dark);
  --color-input-border-focus: var(--color-purple);
  --color-input-selected: var(--color-purple);
  --color-button-text: var(--color-white);
  --color-button-text-hover: var(--color-purple);
  --color-button-background: var(--color-purple);
  --color-button-background-hover: var(--color-white);
  --color-button-border: var(--color-purple);
  --color-success: var(--color-green);
  --color-error: var(--color-red);

  --lh-165: 1.65;
  --lh-150: 1.5;
  --lh-125: 1.25;
  --lh-0: 0;

  --z-index-sticky: 1000;
  --z-index-component: 1;
}

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

:target {
  scroll-margin-block: 5ex;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: var(--lh-165);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

body,
h1,
h2,
h3,
p,
ul {
  margin-block-end: 0;
}

h1 {
  max-width: 640px;
}

/* 2. Base styles */
/* 2.1. Typography */
h1,
h2,
h3,
h4 {
  line-height: var(--lh-125);
  font-family: var(--font-bold);
}

h1 span {
  color: var(--color-purple);
}

h4 {
  line-height: var(--lh-150);
}

p,
ul {
  font-family: var(--font-medium);
}

strong {
  font-family: var(--font-bold);
}

/* 2.2. Links */
a {
  display: inline-block;
  font-family: var(--font-medium);
  line-height: var(--lh-150);
  outline: none;
  transition: background-color 0.2s linear;
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 2px solid var(--color-link-underline);
}

a:hover {
  border-bottom: 2px solid var(--color-link-underline-hover);
}

/* 2.3. Inputs */
input,
textarea {
  font-family: var(--font-medium);
  font-size: 18px;
  line-height: var(--lh-150);
  width: 100%;
  border: 2px solid var(--color-input-border);
  background-color: var(--color-input-background);
  outline: none;
  appearance: none;
  border-radius: 4px;

  &:focus-visible {
    border-color: var(--color-input-border-focus);
  }
}

input {
  height: 52px;
  padding: 0 16px;
}

textarea {
  padding: 12px 16px;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}

@media (min-width: 48rem) {
  input,
  textarea {
    font-size: 20px;
  }

  input {
    height: 62px;
    padding: 0 20px;
  }

  textarea {
    padding: 16px 20px;
  }
}

input[type='checkbox'],
input[type='radio'] {
  display: grid;
  place-content: center;
  padding: 0;
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-input-border);
  cursor: pointer;

  &::before {
    content: '';
    width: 20px;
    height: 20px;
    background-color: var(--color-input-selected);
    transition: all 0.2s ease;
    opacity: 0;
  }

  &:checked {
    border-color: var(--color-input-border-focus);
  }

  &:checked::before {
    opacity: 1;
  }
}

input[type='checkbox'] {
  border-radius: 8px;

  &::before {
    border-radius: 4px;
  }
}

input[type='radio'] {
  border-radius: 50%;

  &::before {
    border-radius: 50%;
  }
}

.input-fixed {
  @media (min-width: 48rem) {
    width: 24rem;
  }
}

.input-error {
  border-color: var(--color-error);
}

/* 2.3. Buttons */
button {
  font-family: var(--font-bold);
  font-size: 24px;
  line-height: var(--lh-150);
  padding: 12px 24px;
  border-radius: 12px;
  color: var(--color-button-text);
  border: 2px solid var(--color-button-border);
  background-color: var(--color-button-background);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  backface-visibility: hidden;

  &:hover,
  &:active {
    color: var(--color-button-background);
    background-color: var(--color-button-background-hover);
  }

  @media (min-width: 48rem) {
    font-size: 28px;
    padding: 12px 32px;
  }
}

.btn-reverse {
  color: var(--color-button-background);
  background-color: var(--color-button-text);

  &:hover,
  &:active {
    color: var(--color-button-text);
    background-color: var(--color-button-background);
  }
}

.btn-upload {
  font-size: 20px;

  @media (min-width: 48rem) {
    font-size: 24px;
  }
}

.btn-secondary {
  font-size: 18px;
  padding: 8px 16px;

  @media (min-width: 48rem) {
    font-size: 20px;
    padding: 8px 24px;
  }
}

.btn-sticky {
  position: fixed;
  top: 12px;
  z-index: var(--z-index-sticky);
}

.btn-booking {
  align-self: flex-start;
}

/* 3. Layout & Utilities */
/* 3.1. Layout containers */
header,
main,
footer {
  width: 100%;
  padding: 0 20px;
  margin: 0 auto;

  @media (min-width: 48rem) {
    width: 48rem;
    padding: 0;
  }
}

.yuka-photo {
  position: absolute;
  top: -20px;
  right: 20px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
}

.yuka-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 48rem) {
  .yuka-photo {
    top: 64px;
    right: 64px;
    width: 256px;
    height: 256px;
  }
}

.btn-sticky-container {
  width: 100%;
  padding: 0 20px;
  margin: 0 auto;

  @media (min-width: 48rem) {
    width: 48rem;
    padding: 0;
  }
}

footer {
  display: flex;
  flex-direction: column;
  margin-bottom: 80px;

  @media (min-width: 48rem) {
    margin-bottom: 128px;
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

/* 3.2. Layout utilities */
.with-dot::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-color: var(--color-purple);
  border-radius: 50%;
}

hr {
  border-color: var(--color-grey-light);
}

/* 3.3. Utility classes */
.text-48px-m {
  font-size: 48px;
}
.text-40px-m {
  font-size: 40px;
}
.text-28px-m {
  font-size: 32px;
}
.text-24px-m {
  font-size: 24px;
}
.text-20px-m {
  font-size: 20px;
}
.text-18px-m {
  font-size: 18px;
}

@media (min-width: 48rem) {
  .text-64px-d {
    font-size: 64px;
  }
  .text-48px-d {
    font-size: 48px;
  }
  .text-32px-d {
    font-size: 32px;
  }
  .text-28px-d {
    font-size: 28px;
  }
  .text-24px-d {
    font-size: 24px;
  }
  .text-20px-d {
    font-size: 20px;
  }
}

/* Margin utilities */
.mt-80-m {
  margin-top: 80px;
}
.mt-64-m {
  margin-top: 64px;
}
.mt-48-m {
  margin-top: 48px;
}
.mt-32-m {
  margin-top: 32px;
}
.mt-24-m {
  margin-top: 24px;
}
.mt-16-m {
  margin-top: 16px;
}
.mt-8-m {
  margin-top: 8px;
}

@media (min-width: 48rem) {
  .mt-128-d {
    margin-top: 128px;
  }
  .mt-80-d {
    margin-top: 80px;
  }
  .mt-64-d {
    margin-top: 64px;
  }
  .mt-48-d {
    margin-top: 48px;
  }
  .mt-32-d {
    margin-top: 32px;
  }
  .mt-24-d {
    margin-top: 24px;
  }
  .mt-16-d {
    margin-top: 16px;
  }
  .mt-8-d {
    margin-top: 8px;
  }
}

.hidden {
  display: none;
}

/* 4. Components */
/* 4.1. Form components */
.form-grid {
  display: grid;
  grid-template-columns: 1fr min(100% - 40px, 48rem) 1fr;
  margin: 0 -20px;
}

.form-container {
  grid-column: 1 / -1;
  padding: 0 20px 64px 20px;
  background-color: color-mix(in srgb, var(--color-purple) 5%, transparent);

  @media (min-width: 48rem) {
    grid-column: 2;
    padding: 0 64px 80px 64px;
  }
}

form {
  display: flex;
  flex-direction: column;
}

fieldset {
  border: none;
}

legend {
  display: block;
}

label {
  display: block;
  line-height: var(--lh-0);
}

label span,
label p {
  line-height: var(--lh-165);
}

label span,
legend {
  display: block;
  font-family: var(--font-bold);
  line-height: var(--lh-125);
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-days {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-bold);
  font-size: 20px;

  label {
    display: inline-flex;
    align-items: center;
    gap: 16px;
  }

  @media (min-width: 48rem) {
    font-size: 24px;
  }
}

.form-radio {
  display: flex;
  flex-direction: row;
  gap: 32px;
  font-family: var(--font-bold);
  font-size: 20px;

  label {
    display: inline-flex;
    align-items: center;
    gap: 16px;
  }

  @media (min-width: 48rem) {
    font-size: 24px;
  }
}

.uploader-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-container {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background-color: var(--color-background);
  overflow: hidden;

  @media (min-width: 48rem) {
    width: 128px;
    height: 128px;
  }
}

.uploader-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;

  &.loaded {
    opacity: 1;
  }
}

.uploader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background-color: color-mix(in srgb, var(--color-purple) 30%, transparent);
  transition: width 0.2s ease;
}

.uploader-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  @media (min-width: 48rem) {
    gap: 12px;
  }
}

.uploader-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-white);
  color: var(--color-purple);
  border: none;
  padding: 8px;
  z-index: 1;
  z-index: var(--z-index-component);
  border-radius: 4px;
  line-height: var(--lh-0);
  cursor: pointer;
}

.uploader-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;

  @media (min-width: 48rem) {
    width: 20px;
    height: 20px;
  }
}

.uploader-icon::before,
.uploader-icon::after {
  content: '';
  position: absolute;
  background-color: currentColor;
  width: 100%;
  height: 2px;
  top: 50%;
  left: 50%;
}

.uploader-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.uploader-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* .hidden {
  display: none !important;
} */

#formError {
  color: var(--color-error);
}

#booking-success.with-dot::before {
  background-color: var(--color-success);
}

#booking-success h2 {
  color: var(--color-success);
}

/* 4.2. Slider */
.slider-list {
  width: 100vw;
  margin-left: -20px;
  padding-left: 20px;
  scroll-padding-left: 20px;
  overflow-y: hidden;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  display: flex;
  scroll-behavior: smooth;

  @media (min-width: 48rem) {
    width: calc(100vw - ((100vw - 48rem) / 2));
    margin-right: calc((48rem - 100vw) / 2);
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
    scroll-padding-left: 0;
  }
}

.slider-list::-webkit-scrollbar {
  display: none;
}

.slider-item {
  flex: 0 0 calc(100vw - 60px);
  width: calc(100vw - 60px);
  margin-right: 20px;
  scroll-snap-align: start;
  overflow: hidden;

  @media (min-width: 48rem) {
    flex: 0 0 480px;
    width: 480px;
  }
}

.slider-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.slider-buttons {
  display: flex;
  gap: 16px;
}

.slider-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;

  &::before,
  &::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background: var(--color-purple);
    top: 50%;
    transition: opacity 0.2s ease;
  }

  &.next {
    &::before {
      right: 13px;
      transform-origin: right center;
      transform: translateY(-50%) rotate(45deg);
    }
    &::after {
      right: 13px;
      transform-origin: right center;
      transform: translateY(-50%) rotate(-45deg);
    }
  }

  &.prev {
    &::before {
      left: 13px;
      transform-origin: left center;
      transform: translateY(-50%) rotate(-45deg);
    }
    &::after {
      left: 13px;
      transform-origin: left center;
      transform: translateY(-50%) rotate(45deg);
    }
  }

  &:not(.disabled) {
    background: color-mix(in srgb, var(--color-purple) 15%, transparent);
    &::before,
    &::after {
      background: var(--color-purple);
    }
  }

  &.disabled {
    cursor: default;
    background: transparent;
    &::before,
    &::after {
      opacity: 0.5;
    }
  }

  @media (min-width: 48rem) {
    width: 48px;
    height: 48px;

    &::before,
    &::after {
      width: 16px;
    }

    &.next {
      &::before,
      &::after {
        right: 17px;
      }
    }

    &.prev {
      &::before,
      &::after {
        left: 17px;
      }
    }
  }
}

.slider-icon.prev,
.slider-icon.prev.disabled,
.slider-icon.next,
.slider-icon.next.disabled {
  background-image: none;
}

.works-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reviews-item {
  border-right: 2px solid color-mix(in srgb, var(--color-purple) 10%, transparent);
  padding-right: 24px;
  margin-right: 24px;
}

.reviews-item:last-child {
  border-right: none;
}

/* 4.3. Q&A */
.qa-list {
  display: flex;
  flex-direction: column;
}

.qa-item {
  padding: 16px 0;

  &:first-child {
    padding-top: 0;
  }

  &:last-child {
    padding-bottom: 0;
  }

  &:not(:last-child) {
    border-bottom: 1px solid var(--color-grey);
  }

  @media (min-width: 48rem) {
    padding: 24px 0;
  }
}

.qa-item ul {
  list-style: none;
  padding-left: 20px;
}

.qa-item li {
  position: relative;
  padding-left: 8px;
}

.qa-item li::before {
  content: '—';
  position: absolute;
  left: -20px;
}

summary::-webkit-details-marker {
  display: none;
}

.qa-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  width: 100%;
  padding: 0;

  &:hover {
    color: var(--color-link);
  }

  h4 {
    margin: 0;
    flex: 1;
  }

  .qa-icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    color: var(--color-purple);
    margin-left: auto;

    &::before,
    &::after {
      content: '';
      position: absolute;
      background-color: currentColor;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      transition: transform 0.2s ease, opacity 0.2s ease;

      @media (min-width: 48rem) {
        width: 24px;
        height: 24px;
      }
    }

    &::before {
      width: 20px;
      height: 2px;

      @media (min-width: 48rem) {
        width: 24px;
      }
    }

    &::after {
      width: 2px;
      height: 20px;

      @media (min-width: 48rem) {
        height: 24px;
      }
    }

    @media (min-width: 48rem) {
      width: 24px;
      height: 24px;
    }
  }
}

details[open] .qa-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%);
}

/* HTMX Styles */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: block;
}

.htmx-request.htmx-indicator {
  display: block;
}
