﻿@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");

:root {
    --first-color: hsl(208, 92%, 54%);
    --first-color-alt: hsl(208, 88%, 50%);
    --title-color: hsl(220, 68%, 4%);
    --white-color: hsl(0, 0%, 100%);
    --text-color: hsl(220, 15%, 66%);
    --body-color: hsl(0, 0%, 100%);
    --container-color: hsl(220, 50%, 97%);
    --body-font: "Montserrat", system-ui;
    --big-font-size: 1.5rem;
    --normal-font-size: .938rem;
    --small-font-size: .813rem;
    --tiny-font-size: .688rem;
    --font-semi-bold: 600;
}

/* Large screen typography scaling */
@media screen and (min-width: 1150px) {
    :root {
        --big-font-size: 3rem;
        --normal-font-size: 1rem;
        --small-font-size: .875rem;
        --tiny-font-size: .75rem;
    }
}

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

body,
input,
button {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
}

body {
    background-color: var(--body-color);
    color: var(--text-color);
}

input,
button {
    border: none;
    outline: none;
}

a {
    text-decoration: none;
}

.container {
    max-width: 600px;
    margin-inline: 1.5rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login__access {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 40px;
    align-items: center;
    padding: 2rem;
    gap: 3vh;
    width: 100%;
}

    .login__access p {
        font-size: 4vh;
        font-weight: bold;
        text-align: center;
    }

.login__title {
    color: var(--title-color);
    text-align: center;
    margin-bottom: 2rem;
}

.login__box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--container-color);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.login__input {
    background: none;
    width: 100%;
    height: 0;
    padding: 1.5rem 2.5rem 1.5rem 1.25rem;
    font-weight: var(--font-semi-bold);
    border: 3px solid transparent;
    border-radius: 1rem;
    z-index: 1;
    transition: border-color .4s;
}

.login__label {
    position: absolute;
    left: 1.25rem;
    font-weight: var(--font-semi-bold);
    transition: transform .4s, font-size .4s, color .4s;
    pointer-events: none;
}

.login__icon {
    position: absolute;
    right: 1rem;
    font-size: 1.25rem;
    transition: color .4s;
    z-index: 2;
}

.login__password {
    cursor: pointer;
}

.login__button {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    background-color: var(--first-color);
    color: var(--white-color);
    font-weight: var(--font-semi-bold);
    padding: 1rem;
    border-radius: 1rem;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: background-color .4s, box-shadow .4s;
}

    .login__button:hover {
        background-color: var(--first-color-alt);
        box-shadow: 0 8px 24px hsla(208, 92%, 32%, .3);
    }

/* Label move up when input is focused or has value */
.login__input:focus ~ .login__label,
.login__input:not(:placeholder-shown):not(:focus) ~ .login__label {
    transform: translateY(-12px);
    font-size: var(--tiny-font-size);
}

.login__input:focus,
.login__input:not(:placeholder-shown):not(:focus) {
    padding-block: 2rem 1rem;
}

.login__input:focus {
    border-color: var(--first-color);
}

    .login__input:focus ~ .login__label,
    .login__input:focus ~ .login__icon {
        color: var(--first-color);
    }

/* Responsive widths */
.login__area {
    width: 100%;
    max-width: 460px;
}

/* Tablets and small desktops */
@media screen and (min-width: 540px) {
    .login__area {
        width: 380px;
        margin-inline: auto;
    }
}

/* Very small screens */
@media screen and (max-width: 320px) {
    .container {
        margin-inline: 1rem;
    }
}

/* Large screens */
@media screen and (min-width: 1150px) {
    .container {
        margin-inline: auto;
    }

    .login__title {
        text-align: initial;
        margin-bottom: 3rem;
    }

    .login__button {
        margin-bottom: 3rem;
    }
}
