@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --accent-color: #55AD9B;
    --base-color: white;
    --text-color: #2F5249;
    --input-color: #F1F8E8;
    --error-color: #BB5A5A;
}

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

html {
    font-family: 'Montserrat', sans-serif;
    font-size: 12pt;
    color: var(--text-color);
    text-align: center;
}

body {
    min-height: 100vh;
    overflow: hidden;
}

.container {
    box-sizing: border-box;
    background-color: var(--base-color);
    height: 100vh;
    width: max(40%), 600px;
    padding: 10px;
    border-radius: 0 20px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    text-transform: uppercase;
}

form {
    width: min(400px, 100%);
    margin-top: 20px;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

form > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

form .icon {
    flex-shrink: 0;
    height: 50px;
    width: 50px;
    background-color: var(--accent-color);
    fill: var(--base-color);
    color: var(--base-color);
    border-radius: 10px 0 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 500;
}

form input {
    box-sizing: border-box;
    flex-grow: 1;
    min-width: 0;
    height: 50px;
    padding: 1em;
    font: inherit;
    border-radius: 0 10px 10px 0;
    border: 2px solid var(--input-color);
    border-left: none;
    background-color: var(--input-color);
    transition: 150ms ease;
}

form input:hover {
    border: 2px solid var(--accent-color);
}

form input:focus {
    outline: none;
    border-color: var(--text-color);
}

div:has(input:focus) > .icon {
    background-color: var(--text-color);
}

form input::placeholder {
    color: var(--text-color);
}

form button {
    margin-top: 10px;
    border: none;
    border-radius: 1000px;
    padding: .85em 4em;
    background-color: var(--accent-color);
    color: var(--base-color);
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

form button:hover {
    background-color: var(--text-color);
}

form button:focus {
    outline: none;
    background-color: var(--text-color);
}

a {
    text-decoration: none;
    color: var(--accent-color)
}

a:hover {
    text-decoration: underline;
}

/* Invalid */

form div.incorrect .icon {
    background-color: var(--error-color);
}

form div.incorrect input {
    border-color: var(--error-color);
}

#error-message {
    color: var(--error-color);
}

/* Reference */
/* https://www.youtube.com/watch?v=bVl5_UdcAy0 */