#welcome {
  // This is used to scale the font and inputs so that they are bigger on large
  // screens. Before, we used the `zoom` property, but that was causing issues
  // with the layout when zooming in/out.
  --welcome-scale: 1;

  @media screen and (min-width: 1366px) and (min-height: 700px) {
    --welcome-scale: 1.2;
  }

  @media screen and (min-width: 1400px) and (min-height: 725px) {
    --welcome-scale: 1.3;
  }

  @media screen and (min-width: 1600px) and (min-height: 750px) {
    --welcome-scale: 1.4;
  }

  @media screen and (min-width: 1800px) and (min-height: 775px) {
    --welcome-scale: 1.5;
  }

  --welcome-font-size: calc(var(--font-size) * var(--welcome-scale));
  --welcome-font-size-sm: calc(var(--font-size-sm) * var(--welcome-scale));
  --welcome-font-size-md: calc(var(--font-size-md) * var(--welcome-scale));
  --welcome-font-size-xxl: calc(var(--font-size-xxl) * var(--welcome-scale));

  // Override the height of some components to make them bigger. The new height
  // is platform specific and defined as --welcome-item-height
  --text-field-height: calc(var(--welcome-item-height) * var(--welcome-scale));
  --button-height: calc(var(--welcome-item-height) * var(--welcome-scale));
  --radio-control-radius: calc(13px * var(--welcome-scale));

  --welcome-content-width: calc(500px * var(--welcome-scale));
  --avatar-size: calc(16px * var(--welcome-scale));

  align-items: stretch;
  justify-content: center;
  flex-direction: row;
  font-size: var(--welcome-font-size-md);

  input[type='radio'] {
    width: var(--radio-control-radius);
    height: var(--radio-control-radius);
  }

  #configure-git {
    flex-grow: 1;
    justify-content: center;

    #configure-git-user {
      padding-bottom: var(--spacing);
      #commit-list.commit-list-example {
        .commit {
          font-size: var(--welcome-font-size);
        }
        .header,
        .byline {
          font-size: var(--welcome-font-size-sm);
        }

        .avatar {
          width: var(--avatar-size);
          height: var(--avatar-size);
        }

        .AvatarStack.AvatarStack--small {
          width: calc(var(--avatar-size) + 5px);
          height: var(--avatar-size);
        }
      }
    }
  }

  .actions {
    display: flex;
  }

  #sign-in-dot-com {
    display: flex;
    flex-direction: column;

    .form-component {
      display: block;
    }

    .actions {
      margin-top: var(--spacing-double);
    }

    hr {
      margin: var(--spacing-double) 0;
    }
  }

  #sign-in-enterprise {
    .sign-in-form {
      margin-top: 0;

      > button {
        margin-right: 0;
      }
    }

    .sign-in-footer {
      margin-top: var(--spacing-double);
    }

    .actions {
      display: inline-block;
      margin-top: var(--spacing-double);
    }

    hr {
      margin: var(--spacing-double) 0;
    }
  }

  #configure-git-user .form-component {
    div:last-child {
      margin-top: var(--spacing);
    }
  }

  #usage-opt-out {
    .welcome-title {
      margin: 0;
    }
  }

  input,
  button,
  select {
    font-size: var(--welcome-font-size-md);
  }

  input {
    padding: var(--spacing-half);
  }

  select {
    // We need to tweak the horizontal padding a bit here to fit correctly with
    // the bigger size
    padding: 0 1px;
  }

  button {
    margin-right: var(--spacing);
    padding: var(--spacing-half) var(--spacing);
  }

  .form-component {
    .text-box-component {
      margin-bottom: var(--spacing);
    }
  }

  .actions {
    margin-top: var(--spacing);
  }

  &.exiting {
    .welcome-left {
      transition: transform 250ms ease-in-out;
      transform: translateX(-100%);
    }
    .welcome-right {
      transition: transform 250ms ease-in-out;
      transform: translateX(100%);
    }
  }

  .create-account-link {
    font-weight: var(--font-weight-semibold);
  }

  .welcome-main-buttons {
    margin-top: var(--spacing-quad);

    .button-component {
      padding-left: var(--spacing-double);
      padding-right: var(--spacing-double);
      margin: 0 var(--spacing-double) var(--spacing) 0;

      // Allows the button to take of full-width of the container when wrapped.
      @media screen and (max-width: 600px) {
        margin-right: 0;
      }
    }

    .octicon.spin {
      margin-right: var(--spacing);
      margin-left: 0;
    }
  }
}

.welcome-title,
.welcome-text {
  margin: 0;
}

.welcome-title {
  font-size: var(--welcome-font-size-xxl);
  font-weight: var(--font-weight-light);
  line-height: 1.25;
  margin-bottom: var(--spacing);

  span {
    display: inline-block;
  }
}

.welcome-text {
  margin: var(--spacing) 0;
}

.sign-in-field {
  width: 100%;
}

.welcome-right {
  flex-grow: 1;
  width: 40%;
}

.welcome-left {
  display: flex;
  align-items: center;
  width: 60%;
  padding: var(--spacing-quad);
  position: relative;
  height: 100vh;
  overflow-y: auto;

  .welcome-content {
    max-width: var(--welcome-content-width);
    width: 100%;

    section {
      // allows scrolling of flex containers
      max-height: 100vh;
    }
  }

  .welcome-graphic-bottom {
    position: absolute;
    right: var(--spacing);
    bottom: var(--spacing);

    height: auto;
    max-height: 100%;
    width: 40%;
    // I hate this but we'll have to live with it for beta.
    z-index: -1;
  }

  .welcome-graphic-top {
    position: absolute;
    right: 80px;
    top: 40px;

    height: auto;
    max-height: 100%;
    width: 20%;
    // I hate this but we'll have to live with it for beta.
    z-index: -1;
  }
}

#start {
  // makes up for the padding on the welcome-left that is applied to all welcome screens
  // Having a min-height makes the start-footer be able to flex to take up the remaining vertical space
  min-height: calc(100vh - 2 * var(--spacing-quad));
  display: flex;
  flex-direction: column;

  .start-content {
    // Make content take of remaining height of container besides the footer.
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    // The footer is ~100px tall in 100% zoom, this makes it so that the
    // start-content is centered vertically on the screen for default zoom levels.
    // Other levels, we are more concerned about not clipping then visual
    // centering.
    margin-top: 100px;
  }

  .start-footer {
    font-size: var(--welcome-font-size-sm);
    color: var(--text-secondary-color);
  }
}

.welcome-right {
  background-color: #28373b;
  justify-content: center;
  align-items: center;
  display: flex;
  padding: var(--spacing-quad) 0 0 var(--spacing-quad);
  position: relative;
  overflow: hidden;

  .welcome-graphic {
    height: 100%;
    object-fit: cover;
    object-position: left;
  }
}

.skip-action-container {
  margin-top: var(--spacing-quad);

  .skip-button {
    color: var(--text-secondary-color);
  }
}

.forgot-password-link {
  align-self: center;
  margin-left: var(--spacing);
}

@include win32-context {
  #welcome {
    --welcome-item-height: 31.5px;
  }
}

@include darwin-context {
  #welcome {
    --welcome-item-height: 29px;
  }
}
