html.dark-mode {
    color-scheme: dark;
}

.auth-login {
    /* Cores reproduzidas da landing Construção Ativa usada como referência visual. */
    --auth-action: #ffcc00;
    --auth-action-hover: #ffb820;
    --auth-on-action: #210d3c;
    --auth-on-photo: #ffffff;
    --auth-deep: #2e124e;
    --auth-deep-dark: #2e104e;
    --auth-purple: #482068;
    --auth-purple-mid: #70409e;
    --auth-bg: #f6f4f8;
    --auth-surface: #ffffff;
    --auth-muted: #655a70;
    --auth-line: #d9cde4;
    min-height: 100svh;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: radial-gradient(ellipse at 8% 4%, #f1eaf8, var(--auth-bg) 60%);
    color: #210d3c;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    transition: none;
}

.auth-layout {
    display: grid;
    width: min(100%, 72rem);
    min-width: 0;
    border: 1px solid var(--auth-line);
    border-radius: 24px;
    background: var(--auth-surface);
    box-shadow: var(--shadow-lg);
}

.auth-content {
    display: grid;
    align-items: center;
    justify-items: center;
    min-width: 0;
    padding: clamp(1.25rem, 5vw, 3.75rem);
}

.auth-content-inner {
    width: min(100%, 24rem);
    min-width: 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    width: fit-content;
    color: var(--auth-action);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 11px;
    background: var(--auth-action);
    color: var(--auth-on-action);
    font-size: 1.25rem;
}

.auth-showcase {
    display: none;
}

.auth-mobile-brand {
    margin-bottom: 1.875rem;
}

.auth-heading h1 {
    font-size: clamp(1.75rem, 3vw, 2.625rem);
    letter-spacing: -0.045em;
    line-height: 1.13;
}

.auth-heading p {
    margin-top: 0.75rem;
    color: var(--auth-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.auth-feedback {
    margin-top: 1rem;
    padding: 0.75rem 0.875rem;
    border-inline-start: 3px solid var(--danger-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 1.125rem;
    margin-top: 1.75rem;
}

.auth-field {
    display: grid;
    gap: 0.4375rem;
    min-width: 0;
}

.auth-field label {
    color: #210d3c;
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    min-width: 0;
    min-height: 3.25rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: var(--auth-surface);
    color: #210d3c;
    font: inherit;
    font-size: 1rem;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.auth-field input:hover {
    border-color: var(--auth-purple-mid);
}

.dark-mode .auth-field input:not(:hover) {
    border-color: color-mix(in srgb, var(--auth-line) 70%, var(--auth-purple-mid));
}

.auth-login :is(a, button, input):focus-visible {
    outline: 2px solid var(--auth-action);
    outline-offset: 3px;
}

.auth-password {
    position: relative;
}

.auth-password:has(.auth-password-toggle:not([hidden])) input {
    padding-inline-end: 5.25rem;
}

.auth-password-toggle {
    position: absolute;
    inset-inline-end: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    min-height: 44px;
    padding-inline: 0.625rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-password-toggle:hover {
    background: #f1eaf8;
    color: var(--auth-purple);
}

.auth-submit {
    min-height: 3.25rem;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--auth-action);
    color: var(--auth-on-action);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
    background: var(--auth-action-hover);
    box-shadow: 0 8px 20px rgb(46 18 78 / 0.18);
}

.auth-register {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-line);
    color: var(--auth-muted);
    font-size: 0.875rem;
}

.auth-register a {
    color: var(--auth-purple);
    font-weight: 650;
    text-underline-offset: 0.22em;
}

.dark-mode .auth-register a {
    color: var(--auth-purple-mid);
}

@media (min-width: 840px) {
    .auth-layout {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
        min-height: 37rem;
    }

    .auth-mobile-brand {
        display: none;
    }

    .auth-showcase {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 2rem;
        padding: clamp(1.75rem, 3.4vw, 3.25rem);
        border-radius: 23px 0 0 23px;
        background-color: var(--auth-deep-dark);
        background-image:
            linear-gradient(180deg, rgb(46 18 78 / 0.78), rgb(46 18 78 / 0.12) 35%, rgb(46 16 78 / 0.96)),
            url('../img/login-arquitetura.webp');
        background-position: center;
        background-size: cover;
        color: var(--auth-on-photo);
    }

    .auth-showcase .auth-brand-mark {
        background: rgb(255 204 0 / 0.18);
        color: inherit;
        border: 1px solid rgb(255 204 0 / 0.55);
    }

    .auth-showcase-copy {
        max-width: 26rem;
    }

    .auth-showcase-copy p {
        font-size: clamp(2.25rem, 4.25vw, 3.875rem);
        line-height: 1.02;
        letter-spacing: -0.055em;
        font-weight: 700;
    }

    .auth-showcase-copy span {
        display: block;
        margin-top: 1rem;
        font-size: 0.9375rem;
        line-height: 1.45;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-login, .auth-field input, .auth-submit {
        transition: none;
    }
}
