/* Estilos específicos para a página de login */

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

body {
    font-family: 'figtree-regular', Arial, sans-serif;
    line-height: 1.5;
    background: #f2f2f2;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    overflow: hidden;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
    padding: clamp(12px, 1.6vw, 20px);
    padding-top: max(clamp(12px, 1.6vw, 20px), env(safe-area-inset-top));
    padding-right: max(clamp(12px, 1.6vw, 20px), env(safe-area-inset-right));
    padding-bottom: max(clamp(12px, 1.6vw, 20px), env(safe-area-inset-bottom));
    padding-left: max(clamp(12px, 1.6vw, 20px), env(safe-area-inset-left));
    box-sizing: border-box;
}

.login-container {
    max-width: 1376px;
    display: flex;
    gap: clamp(16px, 1.7vw, 23px);
    height: min(704px, calc(100dvh - clamp(24px, 3.2vw, 40px)));
    min-height: 0;
    margin: 0 auto;
    width: 100%;
    align-items: stretch;
    justify-content: center;
}

/* Lado esquerdo - Card da Imagem */
.login-image-section {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    background-color: #990011;
    background-image: url('../images/backg_login.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    height: 100%;
    min-height: 0;
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-hero-brand {
    position: absolute;
    top: clamp(48px, 8vh, 86px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    white-space: nowrap;
}

.login-hero-brand img {
    width: 154px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

.login-hero-brand p {
    margin: 0;
    color: #1c1c1c;
    font: 600 16px/20px 'figtree-bold', Arial, sans-serif;
}

.login-hero-brand strong {
    color: #cc0017;
    font-weight: 700;
}

.login-pattern {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    width: clamp(50px, 6vw, 82px);
}

.login-pattern--tl {
    top: clamp(12px, 2.1vh, 15px);
    left: clamp(12px, 1.3vw, 18px);
}

.login-pattern--bl {
    left: clamp(14px, 1.6vw, 22px);
    bottom: clamp(12px, 2.4vh, 18px);
}

.login-pattern--br {
    right: clamp(10px, 1.2vw, 16px);
    bottom: clamp(10px, 1.8vh, 14px);
}

/* Lado direito - Card do Formulário */
.login-form-section {
    flex: 0 1 591px;
    width: clamp(360px, 42vw, 591px);
    min-width: 340px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4.8vh, 48px) clamp(32px, 4.4vw, 60px) 24px;
    height: 100%;
    min-height: 0;
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 471px;
    min-height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header do formulário */
.login-header {
    text-align: center;
    margin-bottom: clamp(24px, 4.2vh, 40px);
}

.form-logo {
    width: clamp(88px, 7.2vw, 108px);
    height: auto;
    margin: 0 0 12px;
}

.login-header p {
    color: #1c1c1c;
    font: 600 16px/20px 'figtree-bold', Arial, sans-serif;
    margin: 0;
}

.login-header span {
    color: #cc0017;
}

/* Formulário */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    width: 100%;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #0d0d0d;
    margin-bottom: 8px;
    font: 400 14px/20px 'figtree-regular', Arial, sans-serif;
    letter-spacing: 0.25px;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    font: 400 14px/20px 'figtree-regular', Arial, sans-serif;
    letter-spacing: 0.25px;
    background: #f2f2f2;
    color: #1c1c1c;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-escarlet-color-2);
    box-shadow: 0 0 0 3px rgba(224, 0, 26, 0.1);
}

.form-group input::placeholder {
    color: #737373;
}

/* Campo de senha com toggle */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
    height: 40px;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-color-4);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--gray-color-5);
}

/* Link "Esqueceu a senha" */
.forgot-password {
    width: 100%;
    text-align: right;
    margin: 0 0 clamp(20px, 3.4vh, 32px);
}

.forgot-password a {
    color: #cc0017;
    text-decoration: none;
    font: 300 16px/20px 'figtree-regular', Arial, sans-serif;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--brand-escarlet-color-1);
    text-decoration: underline;
}

/* Botão de login */
.login-button {
    width: 249px;
    height: 40px;
    background: #cc0017;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
    font-family: 'figtree-regular', Arial, sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 0 clamp(20px, 3.4vh, 32px);
    display: block;
}

.login-button:hover {
    background: var(--brand-escarlet-color-1);
    transform: translateY(-1px);
}

.login-button:active {
    background: var(--brand-escarlet-color-3);
    transform: translateY(0);
}

/* Divisor "ou" */
.login-divider {
    position: relative;
    text-align: center;
    width: 100%;
    margin: 0 0 clamp(20px, 3.4vh, 32px);
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-color-3);
    z-index: 1;
}

.login-divider span {
    background: #fff;
    color: #737373;
    padding: 0 21px;
    font: 500 16px/20px 'figtree-regular', Arial, sans-serif;
    position: relative;
    z-index: 2;
}

/* Botões sociais — ocultos no app/PWA (login e-mail e senha) */
.login-divider,
.social-login {
    display: none;
}

/* Botões sociais */
.social-login {
    width: 249px;
    margin-bottom: clamp(16px, 2.6vh, 24px);
}

.social-btn {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #1c1c1c;
    border-radius: 8px;
    background: #fff;
    color: #1c1c1c;
    font: 600 14px/20px 'figtree-bold', Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0 16px;
}

.social-btn:hover {
    background: var(--gray-color-1);
    border-color: var(--gray-color-4);
    transform: translateY(-1px);
}

.social-btn:active {
    transform: translateY(0);
}

.linkedin-btn:hover {
    background: rgba(0, 119, 181, 0.05);
    border-color: #0077B5;
    color: #0077B5;
}

.google-btn:hover {
    background: rgba(66, 133, 244, 0.05);
    border-color: #4285F4;
}

.social-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Link de cadastro */
.signup-link {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 16px;
    text-align: center;
    margin-top: 0;
}

.signup-link p {
    color: #1c1c1c;
    font: 300 16px/20px 'figtree-regular', Arial, sans-serif;
    margin: 0;
}

.signup-link a {
    color: var(--brand-escarlet-color-2);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.signup-link a:hover {
    color: var(--brand-escarlet-color-1);
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 900px) {
    .login-wrapper {
        padding: 18px;
    }

    .login-container {
        gap: 14px;
    }

    .login-image-section {
        flex-basis: 0;
        background-position: center center;
    }

    .login-form-section {
        flex-basis: 320px;
        width: 320px;
        min-width: 300px;
        padding: 32px 28px 24px;
    }

    .login-header {
        margin-bottom: 32px;
    }

    .form-logo {
        width: 88px;
    }

    .login-hero-brand {
        top: 48px;
    }

    .login-hero-brand img {
        width: 132px;
    }

    .login-hero-brand p {
        font-size: 14px;
    }
}

@media (max-height: 700px) and (min-width: 761px) {
    .login-form-section {
        padding: 10px 44px;
        overflow: hidden;
    }

    .login-form-container {
        justify-content: center;
        zoom: 0.86;
    }

    .login-header {
        margin-bottom: 6px;
    }

    .form-logo {
        width: 44px;
        margin-bottom: 2px;
    }

    .login-header p,
    .forgot-password a,
    .signup-link p {
        font-size: 12px;
        line-height: 16px;
    }

    .form-group {
        margin-bottom: 4px;
    }

    .form-group label {
        margin-bottom: 2px;
        font-size: 12px;
        line-height: 16px;
    }

    .form-group input,
    .password-input input,
    .login-button,
    .social-btn {
        height: 28px;
    }

    .forgot-password,
    .login-button,
    .login-divider {
        margin-bottom: 6px;
    }

    .login-divider span {
        font-size: 12px;
        line-height: 16px;
    }

    .social-login {
        margin-bottom: 0;
    }

    .social-btn {
        margin-bottom: 4px;
        font-size: 12px;
    }

    .social-btn svg {
        width: 17px;
        height: 17px;
    }

    .signup-link {
        margin-top: 0;
    }
}

@media (max-width: 760px), (max-height: 620px) and (max-width: 980px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-wrapper {
        align-items: flex-start;
        height: auto;
        min-height: 100dvh;
        padding: 16px;
    }

    .login-container {
        flex-direction: column;
        width: min(100%, 680px);
        gap: 16px;
        height: auto;
        min-height: 0;
    }

    .login-image-section,
    .login-form-section {
        width: 100%;
        min-width: 0;
    }

    .login-image-section {
        flex: none;
        height: clamp(220px, 38dvh, 360px);
        min-height: 0;
        background-position: center center;
    }

    .login-form-section {
        flex: none;
        height: auto;
        min-height: auto;
        padding: 40px 40px 32px;
        overflow: visible;
    }

    .login-form-container {
        min-height: auto;
    }

    .signup-link {
        position: static;
    }

    .login-header {
        margin-bottom: 32px;
    }

    .form-logo {
        width: 88px;
    }

    .login-hero-brand {
        top: 44px;
    }

    .login-hero-brand img {
        width: 120px;
    }

    .login-hero-brand p {
        font-size: 13px;
    }

    .forgot-password,
    .login-button,
    .login-divider {
        margin-bottom: 28px;
    }

    .login-pattern--tl {
        width: clamp(46px, 10vw, 64px);
    }

    .login-pattern--bl,
    .login-pattern--br {
        width: clamp(42px, 9vw, 60px);
    }
}

@media (max-width: 640px) {
    .login-wrapper {
        padding: 12px;
    }

    .login-container {
        gap: 12px;
    }

    .login-image-section,
    .login-form-section {
        border-radius: 12px;
    }

    .login-image-section {
        min-height: 190px;
        background-position: 34% center;
    }

    .login-form-section {
        padding: 32px 20px 24px;
    }

    .form-logo {
        width: 76px;
    }

    .login-hero-brand {
        top: 44px;
    }

    .login-hero-brand img {
        width: 112px;
    }

    .login-header p,
    .login-hero-brand p,
    .forgot-password a,
    .signup-link p {
        font-size: 14px;
    }

    .login-hero-brand p {
        font-size: 12px;
    }

    .login-button,
    .social-login {
        width: 100%;
        max-width: 249px;
    }

    .social-btn {
        width: 100%;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .login-image-section {
        min-height: 190px;
    }

    .login-hero-brand {
        top: 44px;
    }

    .login-hero-brand img {
        width: 112px;
    }

    .login-hero-brand p {
        font-size: 12px;
    }

    .login-pattern--tl {
        top: 12px;
        left: 14px;
    }
}

/* Estados de erro */
.form-group.error input {
    border-color: var(--state-error-color-2);
    background-color: var(--state-error-color-1);
}

.form-group.error input:focus {
    box-shadow: 0 0 0 3px rgba(247, 90, 90, 0.1);
}

.error-message {
    color: var(--state-error-color-2);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-message::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url('../images/icons/error.svg');
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Estados de carregamento */
.login-button:disabled {
    background: var(--gray-color-3);
    cursor: not-allowed;
    transform: none;
}

.login-button.loading {
    position: relative;
    color: transparent;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Toast (feedback de login — não desloca o formulário) */
.login-toast-root {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.login-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(420px, 100%);
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 7.86px 34.3px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    line-height: 1.4;
    color: var(--gray-color-6, #525252);
    font-family: 'figtree-regular', Arial, sans-serif;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.login-toast.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.login-toast--success {
    border-left: 4px solid var(--state-success-color-3, #40b46e);
}

.login-toast--error {
    border-left: 4px solid var(--state-error-color-3, #f24444);
}

.login-toast__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-toast__icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.login-toast__text {
    flex: 1;
    padding-top: 2px;
}

.login-toast__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: -4px -6px -4px 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--gray-color-5, #737373);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.login-toast__close:hover {
    background: var(--gray-color-1, #f5f5f5);
}

@media (max-width: 480px) {
    .login-toast-root {
        top: 12px;
        right: 12px;
        left: 12px;
        align-items: stretch;
    }

    .login-toast {
        max-width: 100%;
    }
} 