:root {
  --background-color: #0D0E1F;
  --text-color: #FFFFFF;

  --phone-container-width: 306px;
  --phone-container-height: 626px;

  --glow-animation-duration: 2s;
  --glow-animation-delay: 0.7s;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
}

body, input, button, select, textarea {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--text-color);
}

/**
* Fix for a bug in Safari where the video has
* a slight gray border on hover.
* Ref: https://stackoverflow.com/questions/52508598/html5-video-element-on-iphone-has-border
*/
video {
  isolation: isolate;
  mask-image: radial-gradient(white,white);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  box-sizing: border-box;
}

@media screen and (max-width: 650px) {
  body {
    align-items: flex-start;
  }
}

.main-container {
  width: 650px;
  display: grid;
  grid-template-columns: var(--phone-container-width) auto;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "phone-section title-section"
    "phone-section title-section"
    "phone-section form-section";
  column-gap: 38px;
  row-gap: 0px;
  transform: scale(1.0);
  opacity: 1;
  transition-property: filter, transform, opacity;
  transition-duration: 0.3s;
  transition-timing-function: ease-out;

  &.blured {
    filter: blur(40px);
    transform: scale(0.9);
    opacity: 0.5;
  }
}

@media screen and (max-width: 650px) {
  .main-container {
    width: 100%;
    grid-template-columns: 1fr;
    grid-template-areas:
      "title-section"
      "phone-section"
      "form-section";
  }
}

@keyframes shadowFadeIn {
  0% {
    filter: drop-shadow(0 -5px 20px color(display-p3 0 calc(59 / 255) 1 / 0))
            drop-shadow(0 -10px 80px color(display-p3 calc(65 / 255) calc(89 / 255) calc(246 / 255) / 0));
  }
  100% {
    filter: drop-shadow(0 -5px 20px color(display-p3 0 calc(59 / 255) 1 / 0.25))
            drop-shadow(0 -10px 80px color(display-p3 calc(65 / 255) calc(89 / 255) calc(246 / 255) / 0.45));
  }
}

@keyframes glowCircleFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1.0;
  }
}

.phone-section {
  position: relative;
  grid-area: phone-section;
  justify-self: center;

  .circle-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    opacity: 0;
    transform: translate(-50%, -60%);
    border-radius: 50%;
    background: radial-gradient(circle, color(display-p3 0 calc(30 / 255) 1 / 0.9) 0%, color(display-p3 0 calc(30 / 255) 1 / 0)70%);
    pointer-events: none;
    animation: glowCircleFadeIn var(--glow-animation-duration) ease-out forwards;
    animation-delay: var(--glow-animation-delay);
  }

  .phone-container {
    position: relative;
    width: var(--phone-container-width);
    height: var(--phone-container-height);

    .iphone-bezel {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 -5px 20px color(display-p3 0 calc(59 / 255) 1 / 0))
              drop-shadow(0 -10px 80px color(display-p3 calc(65 / 255) calc(89 / 255) calc(246 / 255) / 0));
      animation: shadowFadeIn var(--glow-animation-duration) ease-out forwards;
      animation-delay: var(--glow-animation-delay);
    }

    .iphone-bezel-tinted {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      animation: fadeIn var(--glow-animation-duration) ease-out forwards;
      animation-delay: var(--glow-animation-delay);
    }

    .video {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      transform: scale(0.95);
      mask-image: url("https://lyn-assets.sfo3.cdn.digitaloceanspaces.com/screen-mask.png");
      mask-mode: alpha;
      mask-repeat: no-repeat;
      mask-position: center;
      mask-size: cover;
    }
  }
}

@media screen and (max-width: 650px) {
  .phone-section {
    .circle-glow {
      width: 100%;
    }
  }
}

.title-section {
  grid-area: title-section;
  padding-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  .name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    position: relative;
    left: -2px;

    img {
      width: 17px;
      height: 17px;
    }
  }

  .title {
    font-size: 52px;
    font-weight: 800;
    line-height: 60px;
    margin-top: 0px;
  }

  .subtitle {
    font-size: 16px;
    font-weight: normal;
    margin-top: 10px;
  }
}

@media screen and (max-width: 650px) {
  .title-section {
    padding-top: 0;
    align-items: center;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 80px;

    .name {
      margin-bottom: 20px;
    }
  }
}

.form-section {
  grid-area: form-section;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;

  .header {
    display: flex;
    align-items: center;
    gap: 5px;

    img {
      position: relative;
      height: 17px;
      width: auto;
      top: -1px;
    }
  }

  .footer {
    opacity: 0.4;
  }

  form {
    position: relative;
    width: 100%;
    margin: 0;
    height: 54px;
    left: -7px;

    input {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #21233A;
      border: 2px solid #5A77F9;
      border-radius: 27px;
      padding: 0 46px 0 24px;
      font-size: 16px;
      font-weight: 400;

      &::placeholder {
        color: #D7D9FF;
        opacity: 0.54;
      }
    }

    button {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 38px;
      height: 38px;
      border: none;
      border-radius: 50%;
      background-color: #2A46FF;

      img {
        width: 16px;
        height: auto;
      }
    }
  }
}

@media screen and (max-width: 650px) {
  .form-section {
    align-items: center;
    box-sizing: border-box;
    padding: 0 14px;
    margin: 80px 0;

    form {
      left: 0;
    }
  }
}

.confirmation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: scale(0.0);
  filter: blur(10px);
  pointer-events: none;
  transition-property: opacity, transform, filter;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0.33, 1.2, 0.66, 1);

  &.visible {
    opacity: 1;
    transform: scale(1.0);
    filter: blur(0);
    pointer-events: auto;
  }

  .message {
    max-width: 300px;
    text-align: center;
  }
}
