import styled, { css } from 'styled-components/macro'

import { isMobileDevice } from 'config/userAgent'

import { ButtonSolid as BaseButtonSolid } from 'features/Common/Button'
import { T9n } from 'features/T9n'

import { client } from 'features/AuthServiceApp/config/clients'

export const InputGroup = styled.div`
  width: 100%;
  box-shadow: ${({ theme }) => theme.colors.shadow};
  border-radius: 14px;
  overflow: hidden;

  ${client.styles.inputGroup}
`

export const Wrapper = styled.div`
  display: flex;
  flex-direction: column;
  min-height: 100%;
  align-items: center;
  padding-bottom: 1%;

  ${isMobileDevice
    ? css`
      @media screen and (orientation: landscape) {
        min-height: 450px;
      }
    ` : ''};
`

export const CenterBlock = styled.div`
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  ${client.styles.centerBlock}
`

export const Form = styled.form`
  width: 100%;
  max-width: 493px;
  margin-bottom: 6.604rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  ${isMobileDevice
    ? css`
        width: 100%;
        @media screen and (orientation: landscape){
          margin-bottom: 0;
          padding: 0;
        }
      `
    : ''};
`

export const BlockTitle = styled(T9n)`
  display: block;
  font-style: normal;
  font-weight: bold;
  font-size: 24px;
  height: 24px;
  color: ${({ theme: { colors } }) => colors.white};
  margin-bottom: 30px;
  ${isMobileDevice
    ? css`
        font-size: 20px;
        margin-bottom: 12px;
      `
    : ''};
`

type ButtonsBlockProps = {
  marginTop?: number,
}

export const ButtonsBlock = styled.div<ButtonsBlockProps>`
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: ${({ marginTop = 0 }) => marginTop}px;
`

type ButtonSolidProps = {
  width?: string,
}

export const ButtonSolid = styled(BaseButtonSolid)<ButtonSolidProps>`
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-weight: 600;
  font-size: 20px;
  ${isMobileDevice
    ? css`
        height: 44px;
        font-weight: 600;
        font-size: 17px;
        border-radius: 10px;
      `
    : ''};

  ${client.styles.submitButton}
`

export const Error = styled.span`
  align-self: flex-start;
  min-height: 20px;
  margin-left: 2px;
  color: ${({ theme }) => theme.colors.error};
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0.1px;
`

export const LanguageSelectWrapper = styled.div`
  align-self: flex-end;
`

export const ForgotPass = styled.div`
  font-size: 16px;
  color: #ffffff;
  justify-content: flex-start;
  width: 100%;
  cursor: pointer;
`

export const Container = styled.div`
  min-width: 100%;
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
`

export const FormText = styled.span`
  justify-content: flex-start;
  text-align: center;
  margin-bottom: 15px; 
  font-size: 16px;
  color: #ffffff;
  width: 100%;
  cursor: pointer;
`
export const ScLoaderWrapper = styled.span`
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
`

export const ChangePasswordModalWrapper = styled.div`
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  display: flex;
`

export const ChangePasswordModal = styled.div`
  font-family: 'Montserrat',sans-serif;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  background: #333333;
  border-radius: 5px;
  font-weight: 700;
  height: 414px;
  display: flex;
  width: 577px;
  margin: auto;
  z-index: 1;

  ${isMobileDevice ? css`
    width: 90%;
    padding: 20px;
  ` : ''};
`

export const ChangePasswordModalIcon = styled.img`
  margin-bottom: 20px;
`

export const ChangePasswordModalTitle = styled.div`
  margin-bottom: 20px;
  text-align: center;
  line-height: 34px;
  font-weight: 700;
  font-size: 24px;
  color: white;

  ${isMobileDevice ? css`
    font-size: 20px;
  ` : ''};
`

export const ChangePasswordModalText = styled.div`
  margin-bottom: 30px;
  text-align: center;
  line-height: 28px;
  font-weight: 400;
  font-size: 20px;
  color: white;

  ${isMobileDevice ? css`
    font-size: 16px;
  ` : ''};
`

export const ChangePasswordModalButton = styled(ButtonSolid)`
  width: fit-content;
  padding: 0 50px;
  cursor: pointer;
`
