@import url('https://fonts.googleapis.com/css?family=Raleway:400,700');

:root {
    --purple-dark: #342181;
    --purple: #5D54A4;
    --purple-light: #7C78B8;
    --purple-icon: #7875B5;
    --purple-border: #6A679E;
    --white: #fff;
    --border: #D4D3E8;
    --shadow: #171623;
    --content-max: 420px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Raleway, sans-serif;
}

html {
    min-height: 100%;
    background: var(--purple-dark);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    background: linear-gradient(
        315deg,
        rgba(140, 113, 210, 1) 3%,
        rgba(52, 25, 129, 1) 38%,
        rgba(111, 99, 194, 1) 68%,
        rgba(86, 72, 165, 1) 98%
    );
    animation: gradient 15s ease infinite;
    background-size: 400% 400%;
    background-attachment: fixed;
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    padding-top: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-top));
    padding-right: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-right));
    padding-bottom: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-bottom));
    padding-left: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-left));
    position: relative;
    z-index: 1;
}

.screen {
    position: relative;
    width: min(100%, var(--content-max));
    min-height: 560px;
    max-height: min(600px, calc(100svh - 2rem));
    background: linear-gradient(90deg, var(--purple), var(--purple-light));
    box-shadow: 10px 15px 25px var(--shadow);
    overflow: hidden;
    border-radius: 2px;
}

.screen__content {
    position: relative;
    z-index: 1;
    min-height: 100%;
}

.screen__background {
    position: absolute;
    inset: 0;
    z-index: 0;
    clip-path: inset(0);
    pointer-events: none;
}

.screen__background__shape {
    transform: rotate(45deg);
    position: absolute;
}

.screen__background__shape1 {
    width: clamp(360px, 145vw, 520px);
    height: clamp(360px, 145vw, 520px);
    background: var(--white);
    top: clamp(-90px, -12vw, -50px);
    right: clamp(45px, 25vw, 120px);
    border-radius: 0 72px 0 0;
}

.screen__background__shape2 {
    width: 220px;
    height: 220px;
    background: #6C63AC;
    top: -172px;
    right: -20px;
    border-radius: 32px;
}

.screen__background__shape3 {
    width: 190px;
    height: 540px;
    background: linear-gradient(270deg, #5D54A4, #6A679E);
    top: -24px;
    right: -5px;
    border-radius: 32px;
}

.screen__background__shape4 {
    width: 200px;
    height: 400px;
    background: #7E7BB9;
    top: 420px;
    right: 50px;
    border-radius: 60px;
}

.login {
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
    padding: clamp(24px, 8vw, 30px);
    padding-top: 100px;
    position: relative;
}

.login__field {
    padding: 20px 0;
    position: relative;
}

.login__icon {
    position: absolute;
    top: 30px;
    left: 0;
    color: var(--purple-icon);
    width: 18px;
    text-align: center;
}

.login__input {
    display: block;
    width: 70%;
    min-height: 44px;
    border: 0;
    border-bottom: 2px solid #D1D1D4;
    background: transparent;
    padding: 10px 10px 10px 30px;
    font-weight: 700;
    font-size: 1rem;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    border-radius: 0;
}

.login__input::placeholder {
    color: #666;
    opacity: 1;
}

.login__input:focus {
    outline: none;
    border-bottom-color: var(--purple-border);
    box-shadow: 0 2px 0 var(--purple-border);
}

.button,
.login__submit {
    min-height: 48px;
    width: 100%;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--white);
    color: #4C489D;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    padding: 14px 20px;
    box-shadow: 0 2px 2px #5C5696;
    cursor: pointer;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}

.login__submit {
    margin-top: 30px;
}

.button__text {
    line-height: 1.2;
}

.button__icon {
    font-size: 24px;
    margin-left: auto;
    color: var(--purple-icon);
}

.button:hover,
.button:focus-visible {
    border-color: var(--purple-border);
    outline: none;
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button_exit {
    margin: 30px auto 0;
    text-decoration: none;
}

.form-message {
    margin-top: 18px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(108, 99, 172, .95);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.login-message {
    position: relative;
    width: min(100% - 48px, 280px);
    margin: clamp(130px, 35vw, 180px) auto 0;
    background: #6C63AC;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 26px;
    border: 1px solid var(--border);
    text-align: center;
}

.social-login {
    position: absolute;
    height: 140px;
    width: 160px;
    text-align: center;
    bottom: 0;
    right: 0;
    color: #fff;
}

.social-icons {
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-login__icon {
    padding: 20px 10px;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 8px var(--purple-icon);
}

.social-login__icon:hover,
.social-login__icon:focus-visible {
    transform: scale(1.5);
    outline: none;
}

/* Decorative waves */
.wave {
    background: rgb(255 255 255 / 25%);
    border-radius: 1000% 1000% 0 0;
    position: fixed;
    width: 200%;
    height: 12em;
    animation: wave 10s -3s linear infinite;
    transform: translate3d(0, 0, 0);
    opacity: .8;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.wave:nth-of-type(2) {
    bottom: -1.25em;
    animation: wave 18s linear reverse infinite;
    opacity: .8;
}

.wave:nth-of-type(3) {
    bottom: -2.5em;
    animation: wave 20s -1s reverse infinite;
    opacity: .9;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes gradient {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes wave {
    2% { transform: translateX(1%); }
    25% { transform: translateX(-25%); }
    50% { transform: translateX(-50%); }
    75% { transform: translateX(-25%); }
    100% { transform: translateX(1%); }
}

@media screen and (max-width: 2500px) {
    .screen {
        width: 380px;
        height: 600px;
        max-height: 600px;
        border-radius: 25px;
    }

    .login {
        padding-top: 100px;
    }
    .login__input {
        width: 70%;
    }

}

@media screen and (max-width: 1280px) {
    .screen {
        width: 380px;
        height: 600px;
        max-height: 600px;
        border-radius: 25px;
    }

    .login {
        padding-top: 100px;
    }
    .login__input {
        width: 70%;
    }

}

@media screen and (max-width: 980px) {
    body {
        background-attachment: scroll;
    }

    .screen {
        min-height: 540px;
        max-height: 600px;
        border-radius: 15px;
    }
    .login__input {
        width: 70%;
    }
}

@media screen and (max-width: 736px) {
    body {
        background-attachment: scroll;
    }

    .screen {
        min-height: 540px;
        max-height: 600px;
        border-radius: 15px;
    }
    .login__input {
        width: 70%;
    }


}

@media screen and (max-width: 480px) {
    body {
        background-attachment: scroll;
    }

    .screen {
        min-height: 540px;
        max-height: 600px;
        border-radius: 15px;
    }

    .login__input {
        width: 80%;
    }

}

@media screen and (max-width: 360px) {
    body {
        background-attachment: scroll;
    }

    .container {
        padding: 50px;
    }

    .screen {
        min-height: 540px;
        max-height: 600px;
        border-radius: 15px;
    }
}


/*
@media (max-width: 479px) {
    body {
        background-attachment: scroll;
    }

    .container {
        padding: 50px;
    }

    .screen {
        min-height: 540px;
        max-height: none;
        border-radius: 12px;
    }

    .login {
        padding-inline: clamp(20px, 7vw, 28px);
        padding-top: clamp(105px, 28vw, 140px);
    }

    .screen__background__shape1 {
        right: 40px;
    }

    .screen__background__shape3 {
        right: -55px;
    }

    .screen__background__shape4 {
        right: 15px;
    }

    .wave {
        height: 8em;
    }
}

@media (max-height: 600px) {
    .container {
        place-items: start center;
    }

    .screen {
        margin-block: 8px;
        max-height: none;
    }

    .login {
        padding-top: 90px;
    }

    .login__field {
        padding-block: 14px;
    }

    .login__submit,
    .button_exit {
        margin-top: 18px;
    }
}
*/

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
