@charset "UTF-8";

:root {
    --roxo: #5f2c82;
    --verde: #49a09d;
    --erro: #e74c3c;
    --sucesso: #2ecc71;
    --texto: #333;
}

* {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    padding: 0px;
    margin: 0px;
    box-sizing: border-box;
}
body{
    background-color: var(--roxo);
    min-height: 100vh;
}
main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px; /*Evita que o login cole das bordas em dispositivos pequenos*/
}
#login {
    background-color: white;
    width: 100%;
    max-width: 280px;
    border-radius: 20px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.301);
    overflow: hidden;
    transition: all .3s ease;
}
#imagem {
    background: var(--roxo) url(../imagens/ponte.jpg) no-repeat center center;
    background-size: cover;
    height: 200px;
}
#formulario {
    padding: 10px;
}
h1 {
    text-align: center;
    margin-bottom: 5px;
}
p {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--texto);
}
.campo {
    position: relative;
    background-color: var(--roxo);
    display: flex;
    align-items: center;
    height: 40px;
    border: 2px solid var(--roxo);
    border-radius: 8px;
    margin-bottom: 30px;
    transition: border-color .3s ease;
}
.campo.success {
    border-color: var(--sucesso);
}
.campo.error {
    border-color: var(--erro);
}
.campo-senha {
    margin-bottom: 90px;
    position: relative;
}
.campo:hover {
    background-color: lightgrey;
}
.campo span {
    color: white;
    font-size: 2em;
    width: 40px;
    text-align: center;
    transition: color .2s;
}
.campo:hover span {
    color: black;
}
.campo input {
    flex: 1;
    font-size: 1em;
    height: 38px;
    border: none;
    border-radius: 0px 6px 6px 0px;
    padding-left: 8px;
    outline: none;
    display: block;
}
.campo > input:focus-within {
    background-color: #b3acb8;
}
#olho {
    position: absolute;
    right: 10px;
    color: var(--roxo);
    cursor: pointer;
    user-select: none;
}
#olho:hover {
    color: black;
}
/*Validações*/
.error-message {
    position: absolute;
    bottom: -22px;
    left: 0;
    color: var(--erro);
    font-size: .8em;
    font-weight: bold;
}
.requisitos-senha {
    position: absolute;
    top: 62px;
    font-size: .8em;
    display: none;
}
.requisitos-senha.ativo {
    display: block;
}
.requisitos-senha p {
    line-height: 1.4;
    margin: 0;
}
.invalid {
    color: var(--erro);
}
.valid {
    color: var(--sucesso);
}
/*Botões*/
input[type=submit] {
    width: 100%;
    height: 40px;
    background-color: var(--verde);
    color: white;
    border: none;
    border-radius: 5px;
    display: block;
    font-size: 1em;
}
input[type=submit]:hover {
    background-color: #1e4847;
    font-weight: 500;
    cursor: pointer;
}
.link-esqueci {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    color: var(--verde);
    font-size: 1em;
    height: 40px;
    margin-top: 15px;
    border: 1px solid var(--verde);
    border-radius: 5px;
}
.link-esqueci:hover {
    background-color: #1e4847;
    color: white;
    font-weight: 500;
    cursor: pointer;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.campo-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97);
    border-color: var(--erro);
}
