@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300..800&display=swap');

:root {
  --base-text-color: #444;
  --alert-color: #f60;
  --primary-color: #008bd5;
  --gray-color: #63788d;
  --border-color: #ccc;
  --panel-base-color: #f6f9ff;
  --font-size-2xl: 3rem;
  --font-size-xl: 2rem;
  --font-size-lg: 1.3rem;
  --font-size-md: 1rem;
  --font-size-sm: 0.9rem;
  --font-size-xs: 0.8rem;

  @media (width < 576px) {
    --font-size-2xl: 2rem;
    --font-size-xl: 1.5rem;
    --font-size-lg: 1rem;
    --font-size-md: 1rem;
  }
}

@font-face {
  font-family: 'Local Noto Sans JP';
  src: local('Noto Sans JP'), local('Noto Sans CJK JP Regular');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-style: normal;
}

html {
  scroll-padding-top: 96px;

  @media (width < 576px) {
    scroll-padding-top: 120px;
  }
}

body,
input,
select,
textarea,
button {
  font-family: 'Open Sans', 'Local Noto Sans JP', 'Noto Sans JP', sans-serif;
  color: var(--base-text-color);
  line-height: 1.8;
  font-weight: 400;
  font-size: 16px;
  font-feature-settings: 'palt';

  @media (width < 576px) {
    font-size: 15px;
  }
}

ul {
  list-style-type: none;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

img {
  vertical-align: bottom;
}

body {
  display: grid;
  gap: 64px;
  grid-template-rows: 1fr auto;
  min-height: 100dvh;
}

@scope (.main) {
  :scope {
    margin: 64px auto 0;
    padding: 0 96px;
    display: grid;
    align-content: start;
    align-items: start;
    gap: 64px;
    grid-template-columns: min(40%, 380px) 1fr;
    width: 100%;
    max-width: 1280px;

    @media (width <= 1024px) {
      margin: 32px auto 0;
      padding: 0 16px;
      gap: 40px;
      grid-template-columns: auto;
    }
  }
}

@scope (.main-single) {
  :scope {
    grid-template-columns: auto;
    gap: 32px;
    max-width: 800px;
  }
}

@scope (.info-container) {
  :scope {
    text-align: center;
    font-size: var(--font-size-lg);
  }
}

@scope (.overview-container) {
  :scope {
    position: sticky;
    top: 64px;
    display: grid;
    gap: 64px;
    align-content: start;
    align-self: start;

    @media (width <= 1024px) {
      position: relative;
      top: 0;
      gap: 40px;
    }
  }

  .logo-container {
    .logo {
      width: 180px;
      height: auto;

      @media (width <= 1024px) {
        width: 120px;
      }
    }
  }

  .logo-container-single {
    text-align: center;

    .logo {
      width: 240px;

      @media (width <= 1024px) {
        width: 180px;
      }
    }
  }

  h1 {
    font-size: var(--font-size-xl);
    line-height: 1.5;
  }

  .image {
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: auto;
    display: block;
  }

  .pickup {
    display: grid;
    gap: 16px;

    h2 {
      font-size: var(--font-size-lg);
      color: var(--gray-color);
    }

    h3 {
      font-size: var(--font-size-md);
      color: var(--gray-color);
    }

    ul {
      margin: 0 0 0 1.75em;
      display: grid;
      gap: 8px;
      list-style-type: disc;
      line-height: 1.4;
    }
  }
}

@scope (.overview-container-single) {
  :scope {
    position: relative;
    top: 0;
  }
}

@scope (.form-container) {
  :scope {
    padding: 48px;
    background-color: var(--panel-base-color);
    border-radius: 16px;

    @media (width <= 1024px) {
      padding: 24px;
    }
  }

  .download-button-container {
    text-align: center;
  }
}

@scope (.form-body) {
  :scope {
    margin: 0 auto;
    width: 100%;
    display: block;
  }

  dl {
    width: 100%;
    display: grid;
    gap: 8px;
    margin-bottom: 24px;

    @media (width < 576px) {
      gap: 8px;
    }

    &.other {
      display: grid;
      opacity: 1;

      transition:
        opacity 0.5s 0.15s ease,
        display 0s allow-discrete;
    }

    @starting-style {
      &.other:not(.hidden) {
        opacity: 0;
      }
    }

    &.hidden {
      display: none;
      opacity: 0;
    }

    dt {
      display: grid;
      gap: 8px;

      .label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        color: var(--gray-color);

        .required {
          padding: 6px 8px;
          border-radius: 6px;
          background-color: var(--alert-color);
          font-size: 0.75rem;
          font-weight: normal;
          color: #fff;
          line-height: 1;
          white-space: nowrap;
        }
      }

      .msg {
        display: block;
        font-size: var(--font-size-sm);
        font-weight: normal;
        color: var(--alert-color);
        line-height: 1.4;
      }
    }

    &:has(:user-invalid) {
      dd .type-text,
      dd .type-select,
      dd .type-textarea {
        border-color: var(--alert-color);
        background-color: #fff6f6;
      }
    }

    dd {
      &.group {
        width: 100%;
        display: grid;
        grid-template-columns: auto auto;
        gap: 16px;
      }

      .heading {
        margin: 0;
        font-weight: 700;
        color: #aaa;
      }

      ul {
        display: grid;
        gap: 8px;

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

      & > *:first-child {
        margin-top: 0;
      }
    }
  }

  .button-group {
    padding: 32px 0 0 0;
    display: flex;
    gap: 32px;
    justify-content: center;
    border-top: 1px solid var(--border-color);

    @media (width < 576px) {
      margin: 48px 0 0;
      padding: 0;
      border-top: none;
    }
  }

  .privacy-container,
  .note-container {
    margin: 32px 0;
    display: grid;
    gap: 16px;

    p {
      text-align: center;
    }
  }

  .privacy-container {
    p {
      font-size: var(--font-size-xs);
    }

    div {
      padding: 16px;
      width: 100%;
      height: 8rem;
      overflow: auto;
      border-radius: 6px;
      background: #fff;
      border: 1px solid var(--border-color);
      font-size: var(--font-size-sm);
      white-space: pre-line;
      font-family: monospace;
    }
  }

  .note-container {
    dl {
      gap: 8px;

      dt {
        font-weight: 700;
      }
    }
  }

  .agree-container {
    margin-bottom: 32px;

    label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-weight: 700;
    }
  }
}

@scope (.p-mark) {
  margin: 32px 0 0 0;
  display: grid;
  gap: 8px;
  justify-items: center;

  a {
    color: var(--base-text-color);
    font-size: var(--font-size-xs);
  }

  a:hover {
    opacity: 0.75;
  }
}

@scope (.product-info-container) {
  padding: 32px 0 0 0;
  display: grid;
  gap: 16px;
  justify-content: center;
  border-top: 1px solid #ccc;
}

@scope (.footer) {
  padding: 16px 0;
  background-color: #061533;
  text-align: center;
  color: #fff;

  a {
    color: #fff;
    font-size: var(--font-size-xs);
  }

  a:hover {
    opacity: 0.75;
  }
}

.type-text,
.type-select,
.type-textarea {
  padding: 0 10px;
  width: 100%;
  height: 3rem;
  display: block;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  scroll-margin-top: 72px;
}

.type-textarea {
  padding: 10px;
  height: 8rem;
  min-height: min-content;
  field-sizing: content;
}

.is-after-input:invalid:not(:focus) {
  border-color: var(--alert-color);
  background-color: #fff0f0;
}

.type-button {
  padding: 0 24px;
  display: inline-grid;
  place-items: center;
  min-width: 200px;
  max-width: 320px;
  height: 56px;
  border: 1px solid var(--primary-color);
  border-radius: 56px;
  background-color: #fff;
  color: var(--base-text-color);
  font-size: var(--font-size-sm);
  cursor: pointer;

  @media (hover: hover) and (pointer: fine) {
    &:hover {
      opacity: 0.6;
      transition: opacity ease 0.3s;
    }
  }

  @media (width < 576px) {
    min-width: auto;
  }
}

.type-button-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.type-button-disable {
  background-color: #ccc;
  border-color: #ccc;
  pointer-events: none;
}
