* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Roboto, var(--font-sans);
    font-size: 16px;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    --page-padding: clamp(12px, 2vw, 28px);
    background: #f5f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: var(--page-padding);
    overflow: hidden;
}

.login-page {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: 1920px;
    background: #f5f4f4;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: linear-gradient(135deg, #2fc4b3, #4286f4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    border-radius: 20px;
    overflow: hidden;
}

.left-panel .bemvindo,
.left-panel .logos {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.left-panel .bemvindo {
    padding: clamp(20px, 3vw, 50px);
    text-align: center;
    color: #000;
}

.left-panel .bemvindo h1 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
}

.left-panel .bemvindo p {
    margin-top: 6px;
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    opacity: 0.8;
}

.left-panel .logos {
    padding: 20px;
    background: #1c1e22;
    border-radius: 40px 40px 0 20px;
}

.logo-inovati {
    background: url("../img/logo-4inovati.svg") center / contain no-repeat;
    width: min(292px, 36vw, 30vh);
    max-width: 80%;
    aspect-ratio: 292 / 89;
    flex-shrink: 0;
}

.logo-4tel {
    background: url("../img/logo-4tel.svg") center / contain no-repeat;
    width: min(213px, 24vh);
    max-width: 70%;
    aspect-ratio: 213 / 126;
    flex-shrink: 0;
    margin-bottom: clamp(8px, 2vh, 20px);
}

.right-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 70px);
    background: #f5f4f4;
    overflow: hidden;
}

.login-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(80%, 360px);
    height: auto;
    max-height: 100%;
    gap: clamp(20px, 4vh, 42px);
}

.login-box h4 {
    margin: 0;
    font-size: clamp(16px, 1.46vw, 28px);
    font-weight: 900;
    line-height: 1.2857;
    color: #1f1f1f;
}

.login-box h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 2.5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: #1c1e22;
}

.login-box p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: clamp(10px, 1.8vh, 15px);
}

input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0;
    font-size: 0.9rem;
}

input:focus {
    outline: 2px solid rgba(66, 134, 244, 0.25);
    border-color: #4286f4;
}

.reset-password {
    align-self: flex-start;
    color: #4e4c4c;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: underline;
}

.reset-password:hover {
    text-decoration: underline;
}

button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 13px 25px;
    margin-top: clamp(14px, 4vh, 40px);
    border: 0;
    border-radius: 10px 10px 0 10px;
    background: #000;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

button:hover {
    background: #333;
}

.login-error {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid red;
    border-radius: 4px;
    background: #fff;
    color: red;
    font-size: 0.85rem;
}

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

.input-error {
    border: 2px solid red !important;
    color: red !important;
    animation: shake 0.4s ease;
}

.input-error::placeholder {
    color: rgba(255, 0, 0, 0.6);
}

@media screen and (min-width: 901px) and (max-height: 800px) {
    body {
        --page-padding: 12px;
    }

    .left-panel {
        border-radius: 18px;
    }

    .left-panel .bemvindo {
        padding: 20px;
    }

    .left-panel .bemvindo h1 {
        font-size: clamp(2rem, 3vw, 2.7rem);
    }

    .left-panel .bemvindo p {
        font-size: 0.82rem;
    }

    .left-panel .logos {
        padding: 15px;
    }

    .logo-inovati {
        width: min(240px, 28vh);
    }

    .right-panel {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .login-box {
        width: min(82%, 360px);
        gap: clamp(14px, 2.5vh, 22px);
    }

    .logo-4tel {
        width: min(150px, 19vh);
        margin-bottom: 6px;
    }

    .login-box h4 {
        font-size: clamp(16px, 1.4vw, 21px);
    }

    .login-box h2 {
        font-size: clamp(1.4rem, 2.3vw, 2rem);
        margin-bottom: 5px;
    }

    .login-box p {
        font-size: 0.85rem;
    }

    form {
        gap: 10px;
    }

    input {
        min-height: 44px;
    }

    button {
        min-height: 46px;
        margin-top: 12px;
    }
}

@media screen and (max-width: 900px) {
    html,
    body {
        height: auto;
        min-height: 100%;
    }

    body {
        display: block;
        width: 100%;
        height: auto;
        min-height: 100dvh;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-page {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .left-panel {
        flex: none;
        width: 100%;
        padding: 30px 22px;
        border-radius: 0 0 22px 22px;
    }

    .left-panel .bemvindo {
        flex: none;
        padding: 0;
    }

    .left-panel .bemvindo h1 {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .left-panel .bemvindo p {
        font-size: clamp(0.82rem, 3.5vw, 1rem);
    }

    .left-panel .logos {
        display: none;
    }

    .right-panel {
        flex: 1;
        width: 100%;
        min-height: auto;
        padding: 30px 20px calc(35px + env(safe-area-inset-bottom));
        align-items: flex-start;
        overflow: visible;
    }

    .login-box {
        width: min(100%, 420px);
        max-width: 420px;
        max-height: none;
        gap: 24px;
    }

    .logo-4tel {
        width: 110px;
        max-width: 35vw;
        margin-bottom: 12px;
    }

    .login-box h4 {
        font-size: clamp(1rem, 4vw, 1.15rem);
    }

    .login-box h2 {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
    }

    input {
        min-height: 48px;
        font-size: 1rem;
    }

    button {
        min-height: 50px;
        margin-top: 14px;
    }
}
